-
Notifications
You must be signed in to change notification settings - Fork 44
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 #441 from HMRyu/part3-유호민-week14
[유호민] Week14
- Loading branch information
Showing
38 changed files
with
968 additions
and
234 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,25 @@ | ||
import Modal from "./Modal"; | ||
|
||
export default function AddFolderModal({ | ||
modalStates, | ||
closeModal, | ||
}: { | ||
modalStates: any; | ||
closeModal: any; | ||
}) { | ||
return ( | ||
<Modal | ||
isOpen={modalStates.addModal} | ||
onClose={() => closeModal("addModal")} | ||
title="폴더 추가" | ||
> | ||
<input | ||
placeholder="내용 입력" | ||
className="px-4 py-5 rounded-md border border-[#6d6afe] bg-[#fff] w-full" | ||
/> | ||
<button className="flex m-auto justify-center w-full px-5 py-4 mt-4 rounded-md text-[#f5f5f5] text-[16px] bg-gradient-to-r from-[#6D6AFE] to-[#6AE3FE]"> | ||
추가하기 | ||
</button> | ||
</Modal> | ||
); | ||
} |
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,31 @@ | ||
import Modal from "./Modal"; | ||
|
||
export default function DeleteFolderModal({ | ||
openModal, | ||
closeModal, | ||
modalStates, | ||
}: { | ||
openModal: any; | ||
closeModal: any; | ||
modalStates: any; | ||
}) { | ||
return ( | ||
<> | ||
<img | ||
src="/images/delete.svg" | ||
alt="delete" | ||
className="cursor-pointer" | ||
onClick={() => openModal("deleteModal")} | ||
/> | ||
<Modal | ||
isOpen={modalStates.deleteModal} | ||
onClose={() => closeModal("deleteModal")} | ||
title="폴더 삭제" | ||
> | ||
<button className="flex m-auto justify-center w-full px-5 py-4 mt-4 rounded-md text-[#f5f5f5] text-[16px] bg-[#FF5B56]"> | ||
삭제하기 | ||
</button> | ||
</Modal> | ||
</> | ||
); | ||
} |
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,35 @@ | ||
import Modal from "./Modal"; | ||
|
||
export default function EditFolderModal({ | ||
openModal, | ||
closeModal, | ||
modalStates, | ||
}: { | ||
openModal: any; | ||
closeModal: any; | ||
modalStates: any; | ||
}) { | ||
return ( | ||
<> | ||
<img | ||
src="/images/pen.svg" | ||
alt="pen" | ||
className="cursor-pointer" | ||
onClick={() => openModal("editModal")} | ||
/> | ||
<Modal | ||
isOpen={modalStates.editModal} | ||
onClose={() => closeModal("editModal")} | ||
title="폴더 이름 변경" | ||
> | ||
<input | ||
placeholder="내용 입력" | ||
className="px-4 py-5 rounded-md border border-[#6d6afe] bg-[#fff] w-full" | ||
/> | ||
<button className="flex m-auto justify-center w-full px-5 py-4 mt-4 rounded-md text-[#f5f5f5] text-[16px] bg-gradient-to-r from-[#6D6AFE] to-[#6AE3FE]"> | ||
변경하기 | ||
</button> | ||
</Modal> | ||
</> | ||
); | ||
} |
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,69 @@ | ||
import AddFolderModal from "./AddFolderModal"; | ||
|
||
interface Folder { | ||
id: number; | ||
created_at: Date; | ||
name: string; | ||
user_id: number; | ||
favorite?: boolean; | ||
} | ||
|
||
export default function FolderButtons({ | ||
clickedButton, | ||
handleButtonClick, | ||
handleAllButtonClick, | ||
folders, | ||
openModal, | ||
closeModal, | ||
modalStates, | ||
}: { | ||
clickedButton: any; | ||
handleButtonClick: any; | ||
handleAllButtonClick: any; | ||
folders: any; | ||
openModal: any; | ||
closeModal: any; | ||
modalStates: any; | ||
}) { | ||
return ( | ||
<div className="flex items-center justify-between mt-[40px] px-[32px] xl:px-[200px]"> | ||
<div> | ||
<button | ||
className={`px-3 py-2 mr-2 border rounded-md ${ | ||
clickedButton === 0 | ||
? "bg-blue-500 text-white" | ||
: "border-[#6D6AFE] text-black" | ||
}`} | ||
onClick={handleAllButtonClick} | ||
> | ||
전체 | ||
</button> | ||
{folders && | ||
folders.data.map((folder: Folder) => { | ||
return ( | ||
<button | ||
key={folder.id} | ||
className={`px-3 py-2 mr-2 border rounded-md ${ | ||
folder.id === clickedButton | ||
? "bg-blue-500 text-white" | ||
: "border-[#6D6AFE] text-black" | ||
}`} | ||
onClick={() => { | ||
handleButtonClick(folder.id); | ||
}} | ||
> | ||
{folder.name} | ||
</button> | ||
); | ||
})} | ||
</div> | ||
<div | ||
className="text-[#6D6AFE] cursor-pointer" | ||
onClick={() => openModal("addModal")} | ||
> | ||
폴더 추가 + | ||
</div> | ||
<AddFolderModal modalStates={modalStates} closeModal={closeModal} /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import DeleteFolderModal from "./DeleteFolderModal"; | ||
import EditFolderModal from "./EditFolderModal"; | ||
import ShareFolderModal from "./ShareFolderModal"; | ||
|
||
export default function FolderTitlebar({ | ||
title, | ||
openModal, | ||
closeModal, | ||
modalStates, | ||
}: { | ||
title: string; | ||
openModal: any; | ||
closeModal: any; | ||
modalStates: any; | ||
}) { | ||
return ( | ||
<div className="flex items-center justify-between mt-[40px] px-[32px] xl:px-[200px]"> | ||
<div className="text-[30px] font-bold">{title}</div> | ||
<div className="flex space-x-2"> | ||
{title !== "전체" ? ( | ||
<> | ||
<ShareFolderModal | ||
openModal={openModal} | ||
closeModal={closeModal} | ||
modalStates={modalStates} | ||
/> | ||
<EditFolderModal | ||
openModal={openModal} | ||
closeModal={closeModal} | ||
modalStates={modalStates} | ||
/> | ||
<DeleteFolderModal | ||
openModal={openModal} | ||
closeModal={closeModal} | ||
modalStates={modalStates} | ||
/> | ||
</> | ||
) : null} | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.