-
Notifications
You must be signed in to change notification settings - Fork 46
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 #453 from sj0724/part3-박상준-week14
[박상준] Week14
- Loading branch information
Showing
56 changed files
with
2,236 additions
and
1,409 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
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 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 styled from 'styled-components'; | ||
|
||
export const FolderModal = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 1.2rem; | ||
`; | ||
|
||
export const FolderModalIcon = styled.div` | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
gap: 0.4rem; | ||
color: var(--Linkbrary-gray60); | ||
font-size: 1.4rem; | ||
`; |
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,62 @@ | ||
import Image from 'next/image'; | ||
import { ReactNode } from 'react'; | ||
import * as S from './FolderModals.styled'; | ||
import { useModal } from '@/contexts/ModalContext'; | ||
import ModalPortal from '@/Portal'; | ||
import ShareModal from '../Modal/ShareModal/ShareModal'; | ||
import EditModal from '../Modal/EditModal/EditModal'; | ||
import DeleteModal from '../Modal/DeleteModal/DeleteModal'; | ||
|
||
function FolderIcon({ | ||
image, | ||
children, | ||
onOpen, | ||
state, | ||
}: { | ||
image: string; | ||
children: ReactNode; | ||
onOpen: (modalName: string) => void; | ||
state: string; | ||
}) { | ||
return ( | ||
<S.FolderModalIcon onClick={() => onOpen(`${state}`)}> | ||
<Image src={image} alt={`${image}`} width={20} height={20} /> | ||
{children} | ||
</S.FolderModalIcon> | ||
); | ||
} | ||
|
||
function FolderModals({ id, name }: { id: number; name: string }) { | ||
const { modalState, openModal, closeModal } = useModal(); | ||
|
||
return ( | ||
<S.FolderModal> | ||
<FolderIcon image="/share.svg" onOpen={openModal} state={'share'}> | ||
공유 | ||
</FolderIcon> | ||
<FolderIcon image="/pen.svg" onOpen={openModal} state={'edit'}> | ||
이름 변경 | ||
</FolderIcon> | ||
<FolderIcon image="/Group36.svg" onOpen={openModal} state={'delete'}> | ||
삭제 | ||
</FolderIcon> | ||
{modalState.share && ( | ||
<ModalPortal> | ||
<ShareModal folderName={name} /> | ||
</ModalPortal> | ||
)} | ||
{modalState.edit && ( | ||
<ModalPortal> | ||
<EditModal /> | ||
</ModalPortal> | ||
)} | ||
{modalState.delete && ( | ||
<ModalPortal> | ||
<DeleteModal folderName={name} folderId={id} /> | ||
</ModalPortal> | ||
)} | ||
</S.FolderModal> | ||
); | ||
} | ||
|
||
export default FolderModals; |
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.