-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from InQ-InQ-InQ-InQ-InQ/feature-7
[FEAT] : 프로필, 검색결과 화면 UI 구현
- Loading branch information
Showing
25 changed files
with
203 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Nav } from "@/widgets/menu/ui"; | ||
import React from "react"; | ||
|
||
export default function layout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className="flex min-h-screen flex-col"> | ||
<Nav /> | ||
<div className="flex size-full p-4 pb-0">{children}</div> | ||
<footer className="bottom-0 mt-auto flex-shrink-0 p-4 py-6 text-center text-gray-600"> | ||
© 2024 SpotShare. All rights reserved. | ||
</footer> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ProfileLayout } from "@/widgets/profile/ui"; | ||
|
||
interface ProfileParams { | ||
params: { | ||
id: string; | ||
}; | ||
} | ||
|
||
export default async function Page({ params }: ProfileParams) { | ||
const awaitedParams = await Promise.resolve(params); | ||
return <ProfileLayout id={awaitedParams.id} />; | ||
} | ||
|
||
// async function getProfile(id: string) { | ||
// const response = await fetch(`/api/profile/${id}`); | ||
// const data = await response.json(); | ||
// return data; | ||
// } | ||
|
||
export async function generateMetadata({ params }: ProfileParams) { | ||
const awaitedParams = await Promise.resolve(params); | ||
return { | ||
description: `${awaitedParams.id}의 공유 Spots`, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { SearchLayout } from "@/widgets/search/ui"; | ||
import React from "react"; | ||
|
||
export default function page() { | ||
return <SearchLayout />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./useModal"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./hooks"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"use client"; | ||
|
||
import React, { useState } from "react"; | ||
import { IoIosHeartEmpty, IoIosHeart, IoMdShare } from "react-icons/io"; | ||
|
||
export default function Post() { | ||
return ( | ||
<div className="flex h-60 flex-col rounded-lg border"> | ||
<div className="bg-bgGray flex-1 rounded-t-lg">photo</div> | ||
<PostButton /> | ||
</div> | ||
); | ||
} | ||
|
||
function PostButton() { | ||
const [liked, setLiked] = useState(false); | ||
return ( | ||
<div className="flex w-full justify-between rounded-b-lg bg-white p-2"> | ||
<div className="flex justify-center gap-x-1"> | ||
<button | ||
className="hover:text-gray cursor-pointer" | ||
onClick={() => setLiked((prev) => !prev)} | ||
> | ||
{liked ? <IoIosHeart color="red" /> : <IoIosHeartEmpty />} | ||
</button> | ||
<span className="text-sm">1</span> | ||
</div> | ||
<IoMdShare /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from "react"; | ||
import Post from "./Post"; | ||
|
||
export default function PostView() { | ||
return ( | ||
<div className="grid size-full flex-1 grid-cols-2 gap-4 bg-white p-4 md:grid-cols-4 lg:grid-cols-6"> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
<Post /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from "./constants"; | ||
export * from "./hooks"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const PROFILE_ENDPOINT = { | ||
FOLLOWER_COUNT: "/api/users/{id}/follower/count", | ||
FOLLOWING_COUNT: "/api/users/{id}/following/count", | ||
POSTS: "/api/users/{id}/posts", | ||
} as const; | ||
|
||
export default PROFILE_ENDPOINT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./endpoint"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const CONTENT = ["팔로워", "팔로잉", "게시글"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./content"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./constants"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { PostView } from "@/shared/ui"; | ||
import React, { type ReactNode } from "react"; | ||
import { CONTENT } from "@/widgets/profile/model"; | ||
|
||
export default function ProfileLayout({ id }: { id: string }) { | ||
const ProfileHeader = (): ReactNode => ( | ||
<div className="flex w-full gap-x-4 bg-white px-18 py-10"> | ||
<div className="flex size-12 items-center justify-center rounded-[50%] border bg-white text-2xl md:size-30 md:text-6xl"> | ||
K | ||
</div> | ||
<div className="flex h-full flex-col justify-center"> | ||
<p className="text-4xl font-bold">{id}</p> | ||
<p className="text-gray font-medium">@{id}</p> | ||
<button className="mt-2 cursor-pointer rounded-md border py-1 transition duration-300 ease-in-out hover:bg-gray-600 hover:text-white"> | ||
프로필 편집 | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
|
||
const infoContent = CONTENT; | ||
|
||
const ProfileInfo = (): ReactNode => ( | ||
<div className="bg-bgGray-50 flex gap-x-4 px-18 py-6 text-lg"> | ||
{infoContent.map((info) => ( | ||
<div className="text-center" key={info}> | ||
<p className="font-bold">{info}</p> | ||
<p>1</p> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
|
||
return ( | ||
<div className="size-full flex-col"> | ||
<ProfileHeader /> | ||
<ProfileInfo /> | ||
<PostView /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as ProfileLayout } from "./ProfileLayout"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { PostView } from "@/shared/ui"; | ||
import React from "react"; | ||
|
||
export default function SearchLayout() { | ||
return ( | ||
<div className="flex size-full flex-col"> | ||
<p className="p-4 pt-0 text-xl font-extrabold md:text-2xl"> | ||
"" 에 대한 검색 결과입니다. | ||
</p> | ||
<PostView /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as SearchLayout } from "./SearchLayout"; |