Skip to content

Commit 5e97988

Browse files
authored
Merge pull request #72 from boostcampwm-2024/feature-fe-#71
삭제 모달 UI 개선, 새 페이지 작성 버튼 색상 변경
2 parents 5984352 + 210e3e5 commit 5e97988

File tree

6 files changed

+39
-26
lines changed

6 files changed

+39
-26
lines changed

frontend/public/warning-icon.png

2.72 KB
Loading

frontend/src/components/commons/button/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ export default function Button({ className, onClick, children }: ButtonProps) {
1010
return (
1111
<button
1212
onClick={onClick}
13-
className={cn(
14-
"rounded-md px-6 py-2 shadow-md transition-colors",
15-
className,
16-
)}
13+
className={cn("rounded-md px-8 py-2 transition-colors", className)}
1714
>
1815
{children}
1916
</button>

frontend/src/components/commons/dialog/index.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@ function DialogTitle({ children }: DialogTitleProps) {
99
return <h2 className="text-lg font-semibold">{children}</h2>;
1010
}
1111

12+
interface DialogDescriptionProps {
13+
children: React.ReactNode;
14+
}
15+
16+
function DialogDescription({ children }: DialogDescriptionProps) {
17+
return <div className="text-neutral-500">{children}</div>;
18+
}
19+
1220
interface DialogCloseButtonProps {
1321
onCloseModal: () => void;
1422
}
1523

1624
function DialogCloseButton({ onCloseModal }: DialogCloseButtonProps) {
1725
return (
1826
<button
19-
className="absolute right-4 top-4 text-neutral-400 transition-colors hover:text-neutral-700"
27+
className="absolute right-3 top-3 text-neutral-400 transition-colors hover:text-neutral-700"
2028
onClick={onCloseModal}
2129
>
2230
<X width={16} height={16} />
@@ -49,7 +57,7 @@ function DialogMain({ isOpen, onCloseModal, children }: DialogMainProps) {
4957

5058
return (
5159
<dialog
52-
className="rounded-xl"
60+
className="w-80 rounded-xl"
5361
open={isOpen}
5462
ref={dialogRef}
5563
onClick={() => {
@@ -58,7 +66,7 @@ function DialogMain({ isOpen, onCloseModal, children }: DialogMainProps) {
5866
}}
5967
>
6068
<div
61-
className="flex flex-col gap-4 px-12 py-10"
69+
className="flex flex-col gap-2 p-8"
6270
onClick={(e) => e.stopPropagation()}
6371
>
6472
{children}
@@ -69,5 +77,6 @@ function DialogMain({ isOpen, onCloseModal, children }: DialogMainProps) {
6977

7078
export const Dialog = Object.assign(DialogMain, {
7179
Title: DialogTitle,
80+
Description: DialogDescription,
7281
CloseButton: DialogCloseButton,
7382
});

frontend/src/components/sidebar/NoteList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function NoteList({ className }: NoteListProps) {
3434
<button
3535
onClick={() => handleNoteClick(id)}
3636
key={id}
37-
className="group flex flex-row justify-between rounded-sm px-2 py-1 hover:bg-neutral-100"
37+
className="group flex flex-row justify-between rounded-sm px-3 py-1 hover:bg-neutral-100"
3838
>
3939
<div className="flex flex-row gap-1">
4040
<div>{title}</div>
Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Button from "../commons/button";
22
import { Dialog } from "../commons/dialog";
3+
import WarningIcon from "@/../public/warning-icon.png";
34

45
type RemoveNoteModalProps = {
56
isOpen: boolean;
@@ -14,22 +15,28 @@ export default function RemoveNoteModal({
1415
}: RemoveNoteModalProps) {
1516
return (
1617
<Dialog isOpen={isOpen} onCloseModal={onCloseModal}>
17-
<Dialog.Title>페이지를 삭제하시겠습니까?</Dialog.Title>
18-
<Dialog.CloseButton onCloseModal={onCloseModal} />
19-
<div className="flex flex-row justify-center gap-2">
20-
<Button
21-
className="bg-red-500 text-neutral-200 hover:bg-red-600"
22-
onClick={onConfirm}
23-
>
24-
삭제
25-
</Button>
26-
<Button
27-
className="text-neutral-700 hover:bg-neutral-100"
28-
onClick={onCloseModal}
29-
>
30-
취소
31-
</Button>
18+
<div className="flex flex-col items-center gap-4">
19+
<div className="flex flex-col items-center gap-1.5">
20+
<img src={WarningIcon} alt="warning" className="h-16 w-16" />
21+
<Dialog.Title>페이지 삭제</Dialog.Title>
22+
<Dialog.Description>정말 삭제하시겠습니까?</Dialog.Description>
23+
</div>
24+
<div className="flex w-full flex-row justify-between gap-2">
25+
<Button
26+
className="w-full rounded-lg bg-[#fd5b56] text-neutral-100 hover:bg-red-500"
27+
onClick={onConfirm}
28+
>
29+
삭제
30+
</Button>
31+
<Button
32+
className="w-full rounded-lg bg-[#f4f4f5] text-neutral-700 hover:bg-neutral-200"
33+
onClick={onCloseModal}
34+
>
35+
취소
36+
</Button>
37+
</div>
3238
</div>
39+
<Dialog.CloseButton onCloseModal={onCloseModal} />
3340
</Dialog>
3441
);
3542
}

frontend/src/components/sidebar/Tools.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default function Tools() {
2424
content: [
2525
{
2626
type: "paragraph",
27-
content: [{ type: "text", text: "This is page 1" }],
27+
content: [{ type: "text", text: "" }],
2828
},
2929
],
3030
},
@@ -35,9 +35,9 @@ export default function Tools() {
3535
}}
3636
>
3737
<div>
38-
<PencilLine width={20} height={20} widths={1} />
38+
<PencilLine width={20} height={20} widths={1} color="#7f796d" />
3939
</div>
40-
<div>새 페이지 작성</div>
40+
<div className="text-neutral-600">새 페이지 작성</div>
4141
</button>
4242
);
4343
}

0 commit comments

Comments
 (0)