-
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.
[Feature/BAR-243] 끄적이는 페이지 상단 탭 툴팁 노출 및 폴더 기능 추가 (#73)
* feat: 상단 탭 툴팁 노출 * style(domain/끄적이는): 레이아웃 수정 * feat(domain/끄적이는): 히스토리 메모의 폴더 저장 기능 추가 * refactor(domain/참고하는): 공통 컴포넌트 FolderDropdown 적용 * feat(domain/끄적이는): 오늘 메모의 폴더 저장 기능 추가 * refactor(domain/끄적이는): 공통 컴포넌트 Card 적용 * feat(domain/저장하는): 기본 폴더 구분 * style(SpellCheckNotice): 수정 내용이 없는 경우 marginTop 추가
- Loading branch information
Showing
27 changed files
with
358 additions
and
282 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,67 @@ | ||
import { type Folder } from '@api/memoFolder/types'; | ||
import Button from '@components/Button'; | ||
import Dropdown from '@components/Dropdown'; | ||
import Icon from '@components/Icon'; | ||
import useGetMyProfile from '@queries/useGetMyProfile'; | ||
import { useModalStore } from '@stores/modal'; | ||
import { COLORS } from '@styles/tokens'; | ||
|
||
import * as styles from './style.css'; | ||
|
||
interface FolderDropdownProps { | ||
isArchived: boolean; | ||
memoFolders: Folder[]; | ||
onClickFolder: (id: Folder['id']) => void; | ||
onClickBookmark: () => void; | ||
} | ||
|
||
const FolderDropdown = ({ | ||
isArchived, | ||
memoFolders, | ||
onClickFolder, | ||
onClickBookmark, | ||
}: FolderDropdownProps) => { | ||
const { openModal } = useModalStore(); | ||
|
||
const { data } = useGetMyProfile(); | ||
|
||
if (isArchived) { | ||
return ( | ||
<Button onClick={onClickBookmark}> | ||
<Icon icon="bookmark" color={COLORS['Blue/Default']} /> | ||
</Button> | ||
); | ||
} | ||
|
||
return ( | ||
<Dropdown size="medium" placement="bottom-center"> | ||
<Dropdown.Trigger> | ||
<Icon | ||
icon="bookmark" | ||
className={styles.hover} | ||
color={COLORS['Grey/300']} | ||
/> | ||
</Dropdown.Trigger> | ||
<Dropdown.List> | ||
{memoFolders.map(({ id, name }) => ( | ||
<Dropdown.Item key={id} onClick={() => onClickFolder(id)}> | ||
{name === '기본' ? ( | ||
<span> | ||
{data?.nickname}님의 폴더 | ||
<span className={styles.badge}>기본</span> | ||
</span> | ||
) : ( | ||
<span>{name}</span> | ||
)} | ||
</Dropdown.Item> | ||
))} | ||
<Dropdown.Item onClick={() => openModal('makeFolder')}> | ||
<Icon icon="add" width={20} height={20} /> | ||
<span className={styles.iconMediumText}>새 폴더 만들기</span> | ||
</Dropdown.Item> | ||
</Dropdown.List> | ||
</Dropdown> | ||
); | ||
}; | ||
|
||
export default FolderDropdown; |
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
Oops, something went wrong.