-
Notifications
You must be signed in to change notification settings - Fork 3
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 #87 from dnd-side-project/v1.1.0
✨ v1.1.0
- Loading branch information
Showing
23 changed files
with
166 additions
and
292 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
File renamed without changes.
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,67 @@ | ||
'use client'; | ||
|
||
import Link from 'next/link'; | ||
import { usePathname } from 'next/navigation'; | ||
import { useState } from 'react'; | ||
|
||
import { useMyposeCountQuery } from '@/apis'; | ||
import { COOKIE_ACCESS_TOKEN } from '@/constants'; | ||
import { getClientCookie } from '@/utils'; | ||
|
||
const Data = { | ||
upload: { title: '등록', path: '/mypose' }, | ||
bookmark: { title: '저장', path: '/mypose/bookmark' }, | ||
}; | ||
|
||
interface TabItemI { | ||
title: string; | ||
path: string; | ||
current: boolean; | ||
} | ||
const TabItem = ({ title, path, current }: TabItemI) => | ||
current ? ( | ||
<Link href={path} className="flex flex-1 items-center justify-center rounded-8 bg-white"> | ||
<div id="subtitle-1" className="text-main-violet"> | ||
{title} | ||
</div> | ||
</Link> | ||
) : ( | ||
<Link href={path} className="flex flex-1 items-center justify-center rounded-8"> | ||
<div id="subtitle-1" className="text-tertiary"> | ||
{title} | ||
</div> | ||
</Link> | ||
); | ||
|
||
export default function MyposeTab() { | ||
const path = usePathname(); | ||
const accesstoken = getClientCookie(COOKIE_ACCESS_TOKEN); | ||
|
||
const [countData, setCountData] = useState({ uploadCount: 0, bookmarkCount: 0 }); | ||
|
||
const query = useMyposeCountQuery({ | ||
enabled: accesstoken !== '', | ||
onSuccess: (data) => { | ||
setCountData(data); | ||
}, | ||
}); | ||
|
||
return ( | ||
<div className="h-72 px-20 py-12"> | ||
<div className="flex h-full gap-4 rounded-8 bg-divider p-4 "> | ||
<TabItem | ||
key="upload" | ||
title={`${Data.upload.title} ${countData.uploadCount}`} | ||
path={Data.upload.path} | ||
current={path === Data.upload.path} | ||
/> | ||
<TabItem | ||
key="bookmark" | ||
title={`${Data.bookmark.title} ${countData.bookmarkCount}`} | ||
path={Data.bookmark.path} | ||
current={path === Data.bookmark.path} | ||
/> | ||
</div> | ||
</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 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
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.
Oops, something went wrong.