-
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.
- Loading branch information
Showing
5 changed files
with
128 additions
and
3 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,43 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
import { sprinkles } from '@styles/sprinkles.css'; | ||
import { COLORS } from '@styles/tokens'; | ||
|
||
export const wrapper = style({ | ||
position: 'absolute', | ||
top: '52px', | ||
right: '-75px', | ||
}); | ||
|
||
export const badge = style([ | ||
sprinkles({ | ||
typography: '11/Caption/Medium', | ||
}), | ||
{ | ||
marginLeft: '4px', | ||
backgroundColor: COLORS['Blue/Light'], | ||
color: COLORS['Blue/Default'], | ||
width: '32px', | ||
height: '20px', | ||
display: 'inline-block', | ||
verticalAlign: 'middle', | ||
marginTop: '-2px', | ||
padding: '3px 6px', | ||
borderRadius: '100px', | ||
}, | ||
]); | ||
|
||
export const iconMediumText = style([ | ||
sprinkles({ | ||
typography: '15/Body/Medium', | ||
}), | ||
{ | ||
color: COLORS['Grey/400'], | ||
marginLeft: '28px', | ||
}, | ||
]); | ||
|
||
export const icon = style({ | ||
position: 'absolute', | ||
marginTop: '2px', | ||
}); |
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,51 @@ | ||
import { forwardRef } from 'react'; | ||
|
||
import { type Folder } from '@api/memoFolder/types'; | ||
import Dialog from '@components/Dialog'; | ||
import Icon from '@components/Icon'; | ||
import * as styles from '@domain/참고하는/components/FolderDialog.css'; | ||
import { useModalStore } from '@stores/modal'; | ||
|
||
interface FolderDialogProps { | ||
memoFolders: Folder[]; | ||
closeDialog: () => void; | ||
} | ||
|
||
const FolderDialog = forwardRef<HTMLButtonElement, FolderDialogProps>( | ||
({ memoFolders, closeDialog }, ref) => { | ||
const { openModal } = useModalStore(); | ||
|
||
return ( | ||
<Dialog | ||
className={styles.wrapper} | ||
type="medium" | ||
closeDialog={closeDialog} | ||
ref={ref} | ||
> | ||
{memoFolders.map(({ id, name }) => { | ||
if (name === '기본') | ||
return ( | ||
<Dialog.Button key={id} onClick={() => {}}> | ||
OOO님의 폴더<span className={styles.badge}>기본</span> | ||
</Dialog.Button> | ||
); | ||
return ( | ||
<Dialog.Button key={id} onClick={() => {}}> | ||
{name} | ||
</Dialog.Button> | ||
); | ||
})} | ||
<Dialog.Button onClick={() => openModal('makeFolder')}> | ||
<div className={styles.icon}> | ||
<Icon icon="add" width={20} height={20} /> | ||
</div> | ||
<span className={styles.iconMediumText}>새 폴더 만들기</span> | ||
</Dialog.Button> | ||
</Dialog> | ||
); | ||
}, | ||
); | ||
|
||
FolderDialog.displayName = 'FolderDialog'; | ||
|
||
export default FolderDialog; |
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ export const wrapper = style([ | |
}, | ||
}), | ||
{ | ||
position: 'relative', | ||
padding: '28px 32px 20px', | ||
}, | ||
]); | ||
|
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