Skip to content

Commit

Permalink
Merge pull request #161 from bsideproject/moon
Browse files Browse the repository at this point in the history
[feat] UserProfile 우선 커밋!!
  • Loading branch information
KinDDoGGang authored Sep 25, 2023
2 parents ab3d7f9 + 9ad0f1d commit 3a185d8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 6 deletions.
1 change: 0 additions & 1 deletion components/Nav/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default function Nav() {
<div className={`${styles.container} grid grid-cols-4 bg-g0 w-full h-[66px] text-center`}>
{menus.map((menu, index) => {
const IconComponent = menu.icon;

return (
<div
className="my-[9px] align-middle items-center cursor-pointer"
Expand Down
18 changes: 13 additions & 5 deletions components/RoomCard/RoomCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import Like from '@/public/icons/like.svg';
import Camera from '@/public/icons/camera.svg';
import Card from '../Card/Card';
import styles from '@/pages/room/room.module.scss';
import useModal from '@/hooks/useModal.ts';
import UserProfile from '@/pages/profile/index.tsx';
import {useRouter} from 'next/router';

interface CardProps {
room: Room;
Expand All @@ -19,14 +22,20 @@ interface UserInfoProps {

interface PhotoProps {
photos: string[];
onClick?: () => void;
}

const UserInfo = ({ userInfo }: UserInfoProps) => {
const router = useRouter();
const age = formatAge(userInfo.year);

const handleUserClick = () => {
router.push("/profile");
}

return (
<div className="flex">
<img className="rounded-[40px] w-[40px] h-[40px]" src={userInfo.image} alt="user" />
<img className="rounded-[40px] w-[40px] h-[40px]" src={userInfo.image} alt="user" onClick={handleUserClick}/>
<div className="ml-[12px]">
<div className="text-[16px] text-g7 font-semibold">{userInfo.name}</div>
<div className="text-a2 text-[12px]">
Expand All @@ -39,9 +48,9 @@ const UserInfo = ({ userInfo }: UserInfoProps) => {
);
};

const Photo = ({ photos }: PhotoProps) => {
const Photo = ({ photos, onClick }: PhotoProps) => {
return (
<div className="relative h-[190px] bg-cover" style={{ backgroundImage: `url(${photos[0]})` }}>
<div className="relative h-[190px] bg-cover" style={{ backgroundImage: `url(${photos[0]})` }} onClick={onClick}>
<div className={`${styles.tag} flex items-center gap-[4px]`}>
<Camera
xmlns="http://www.w3.org/2000/svg"
Expand Down Expand Up @@ -97,9 +106,8 @@ export default function RoomCard({ room, onClick }: CardProps) {
return (
<Card
title={<UserInfo userInfo={room?.userInfo} />}
content={<Photo photos={room.images} />}
content={<Photo photos={room.images} onClick={onClick}/>}
footer={<Footer room={room} />}
onClick={onClick}
/>
);
}
26 changes: 26 additions & 0 deletions pages/profile/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import React from 'react';

export default function UserProfile() {
return (
<>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
<h1>hi~~</h1>
</>
)
};

0 comments on commit 3a185d8

Please sign in to comment.