Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zestlee1106 committed Oct 11, 2023
2 parents cceeb5d + 6cd1d71 commit 1f44370
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 10 deletions.
8 changes: 7 additions & 1 deletion components/RoomCard/RoomCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ const UserInfo = ({ userInfo }: UserInfoProps) => {
const age = formatAge(userInfo.birthDate);

const handleUserClick = () => {
router.push('/userInfo');
router.push(
{
pathname: '/userInfo',
query: { data: JSON.stringify(userInfo) },
},
'/userInfo'
);
};

return (
Expand Down
21 changes: 14 additions & 7 deletions pages/liked/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint-disable react/no-unstable-nested-components */
import React from 'react';
import NoPosting from '@/public/icons/noPosting.svg';
import Step1 from '@/pages/room/addRoom/step1.tsx';
import NoLiked from '@/public/icons/noLiked.svg';
import useModal from '@/hooks/useModal';
import DefaultLayout from '@/components/layouts/DefaultLayout';
// import { useRouter } from 'next/router';
import { Nav } from '@/components/index.tsx';

// TODO 데이터가 구체화되면 바꿔줘야함
interface MyPostingProps {
Expand All @@ -26,15 +25,15 @@ export default function Liked({ roomInfo }: MyPostingProps) {
};

/**
* 룸이 없을 때 보여주는 Component
* 좋아요 없을 때 보여주는 Component
*/
const NoPostings = () => {
const noPostingStyle = 'text-[20px] font-bold mt-[29px] text-center';
const containerStyle = 'h-screen flex flex-col items-center justify-start mt-[135px]'; // 'justify-start'로 변경
const containerStyle = 'flex flex-col items-center justify-start mt-[135px]'; // 'justify-start'로 변경

return (
<div className={containerStyle}>
<NoPosting />
<NoLiked />
<div className={noPostingStyle}>{`You don't have liked room`}</div>
<div className="text-[16px] text-g5 font-pretendard">{`There aren't any rooms you liked yet.`}</div>
<div className="text-[16px] text-g5 font-pretendard">Find places that you like!</div>
Expand All @@ -48,12 +47,20 @@ export default function Liked({ roomInfo }: MyPostingProps) {
Look around
</button>
</div>
<div className="fixed bottom-[0px] w-full overflow-x-hidden left-[50%] translate-x-[-50%] px-[20px] max-w-max">
<div className="w-full">
<hr />
<div className="mb-[13px] space-x-[8px] max-w-max">
<Nav initMenu={2} />
</div>
</div>
</div>
</div>
);
};

/**
* 룸이 있을 때 보여주는 Component (TODO : 구체화 해줘야함)
* 좋아요 있을 때 보여주는 Component (TODO : 구체화 해줘야함)
*/
const MyLiked = () => {
return <div>호이호이</div>;
Expand Down
8 changes: 7 additions & 1 deletion pages/userInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import React from 'react';
import { Nav, ProfileCard } from '@/components/index.tsx';
import { useRouter } from 'next/router';
import { formatAge, formatDate, formatPrice } from '@/utils/transform';

interface UserProfileProps {
imgSrc: string;
}

export default function UserProfile({ imgSrc }: UserProfileProps) {
const router = useRouter();
const { query } = router;
const userInfo = query.data ? JSON.parse(query.data as string) : {};
const age = formatAge(userInfo.year);
return (
<>
<ProfileCard age={22} name="James" gender="Male" imageSrc={imgSrc} />
<ProfileCard age={age} name={userInfo.name} gender={userInfo.gender} imageSrc={userInfo.image || imgSrc} />
<div className="mt-[83px] fixed bottom-[-15px] w-full overflow-x-hidden left-[50%] translate-x-[-50%] px-[20px] max-w-max">
<div className="w-full">
<div className="mb-[13px] space-x-[8px] max-w-max">
Expand Down
11 changes: 10 additions & 1 deletion pages/userInfo/myPostings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import NoPosting from '@/public/icons/noPosting.svg';
import Step1 from '@/pages/room/addRoom/step1.tsx';
import useModal from '@/hooks/useModal';
import DefaultLayout from '@/components/layouts/DefaultLayout';
import { Nav } from '@/components/index.tsx';
// import { useRouter } from 'next/router';

// TODO 데이터가 구체화되면 바꿔줘야함
Expand All @@ -30,7 +31,7 @@ export default function MyPosting({ roomInfo }: MyPostingProps) {
*/
const NoPostings = () => {
const noPostingStyle = 'text-[20px] font-bold mt-[29px] text-center';
const containerStyle = 'h-screen flex flex-col items-center justify-start mt-[135px]'; // 'justify-start'로 변경
const containerStyle = 'flex flex-col items-center justify-start mt-[135px]'; // 'justify-start'로 변경

return (
<div className={containerStyle}>
Expand All @@ -46,6 +47,14 @@ export default function MyPosting({ roomInfo }: MyPostingProps) {
+ Add post
</button>
</div>
<div className="fixed bottom-[0px] w-full overflow-x-hidden left-[50%] translate-x-[-50%] px-[20px] max-w-max">
<div className="w-full">
<hr />
<div className="mb-[13px] space-x-[8px] max-w-max">
<Nav />
</div>
</div>
</div>
</div>
);
};
Expand Down
22 changes: 22 additions & 0 deletions public/icons/noLiked.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1f44370

Please sign in to comment.