-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
383ea90
commit 39fbba5
Showing
6 changed files
with
72 additions
and
17 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
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,16 @@ | ||
import { useSuspenseQuery } from "@tanstack/react-query"; | ||
import { getTopTagsFromUploaded } from "@/apis/tag"; | ||
|
||
const useGetTopTagsFromUploaded = () => { | ||
const { data, ...rest } = useSuspenseQuery({ | ||
queryKey: ["topTagsFromUploaded"], | ||
queryFn: getTopTagsFromUploaded, | ||
}); | ||
|
||
return { | ||
topTags: data, | ||
...rest, | ||
}; | ||
}; | ||
|
||
export default useGetTopTagsFromUploaded; |
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
24 changes: 24 additions & 0 deletions
24
src/routes/_layout-with-chat/my-uploaded-zzals/route.lazy.tsx
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,24 @@ | ||
import { createLazyFileRoute } from "@tanstack/react-router"; | ||
import TagSearchForm from "@/components/common/SearchTag/TagSearchForm"; | ||
import TagBadge from "@/components/common/TagBadge"; | ||
import useGetTopTagsFromUploaded from "@/hooks/api/tag/useGetTopTagsFromUploaded"; | ||
|
||
const MyUploadedZzals = () => { | ||
const { topTags } = useGetTopTagsFromUploaded(); | ||
|
||
return ( | ||
<div className="flex w-full flex-col items-center"> | ||
<div className="mb-10pxr min-w-650pxr pl-10pxr"> | ||
<div className="mb-8pxr font-semibold">내가 가장 많이 사용한 태그</div> | ||
{topTags.map(({ tagId, tagName }) => ( | ||
<TagBadge key={tagId} content={tagName} isClickable className="mr-5pxr" /> | ||
))} | ||
</div> | ||
<TagSearchForm /> | ||
</div> | ||
); | ||
}; | ||
|
||
export const Route = createLazyFileRoute("/_layout-with-chat/my-uploaded-zzals")({ | ||
component: MyUploadedZzals, | ||
}); |
8 changes: 4 additions & 4 deletions
8
...yout-with-chat/my-uploaded-zzal/index.tsx → ...out-with-chat/my-uploaded-zzals/route.tsx
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,9 +1,9 @@ | ||
import { createFileRoute } from "@tanstack/react-router"; | ||
|
||
const MyUploadedZzal = () => { | ||
return <div>업로드 한 짤 페이지</div>; | ||
const PendingComponent = () => { | ||
return <div>pending</div>; | ||
}; | ||
|
||
export const Route = createFileRoute("/_layout-with-chat/my-uploaded-zzal/")({ | ||
component: MyUploadedZzal, | ||
export const Route = createFileRoute("/_layout-with-chat/my-uploaded-zzals")({ | ||
pendingComponent: PendingComponent, | ||
}); |
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