Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit ce21a34

Browse files
committed
๐Ÿ“† ๊ณต์ง€๊ธ€ ๊ณ ์ •, ๋งŒ๋ฃŒ๊ธฐ๊ฐ„ ์ถ”๊ฐ€
1 parent 3dffdcd commit ce21a34

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

โ€Žapis/types/notice.tsโ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export interface Notice {
2020
tags: string[];
2121
isPinned: boolean;
2222
isImportant: boolean;
23+
pinnedUntil: Date;
24+
importantUntil: Date;
2325
author: string;
2426

2527
id: number;

โ€Žapp/[locale]/community/notice/[id]/edit/EditNoticePageContent.tsxโ€Ž

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export default function EditNoticePageContent({ id, data }: { id: number; data:
3030
isPrivate: data.isPrivate,
3131
isImportant: data.isImportant,
3232
isPinned: data.isPinned,
33+
pinnedUntil: data.pinnedUntil ? new Date(data.pinnedUntil) : new Date(),
34+
importantUntil: data.importantUntil ? new Date(data.importantUntil) : new Date(),
3335
};
3436

3537
const onCancel = () => router.push(`${noticePath}/${id}`);
@@ -55,13 +57,15 @@ export default function EditNoticePageContent({ id, data }: { id: number; data:
5557
isPrivate: content.isPrivate,
5658
isPinned: content.isPinned,
5759
isImportant: content.isImportant,
60+
pinnedUntil: content.pinnedUntil.toISOString().slice(0, 10),
61+
importantUntil: content.importantUntil.toISOString().slice(0, 10),
5862
tags: content.tags,
5963
deleteIds,
6064
}),
6165
],
6266
{
6367
type: 'application/json',
64-
},
68+
}
6569
),
6670
);
6771

โ€Žapp/[locale]/community/notice/components/NoticeEditor.tsxโ€Ž

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export interface NoticeFormData {
1414
isPrivate: boolean;
1515
isPinned: boolean;
1616
isImportant: boolean;
17+
pinnedUntil: Date;
18+
importantUntil: Date;
1719
}
1820

1921
interface Props {
@@ -34,6 +36,8 @@ export default function NoticeEditor({ defaultValues, onCancel, onSubmit, onDele
3436
isPrivate: false,
3537
isPinned: false,
3638
isImportant: false,
39+
pinnedUntil: new Date(),
40+
importantUntil: new Date(),
3741
},
3842
});
3943
const { handleSubmit, setValue } = formMethods;
@@ -88,13 +92,23 @@ export default function NoticeEditor({ defaultValues, onCancel, onSubmit, onDele
8892
if (isImportant) setValue('isPrivate', false);
8993
}}
9094
/>
95+
<Form.Date
96+
name="pinnedUntil"
97+
enablePast
98+
hideTime
99+
/>
91100
<Form.Checkbox
92101
label="๋ฉ”์ธ-์ค‘์š” ์•ˆ๋‚ด์— ํ‘œ์‹œ"
93102
name="isImportant"
94103
onChange={(isImportant) => {
95104
if (isImportant) setValue('isPrivate', false);
96105
}}
97106
/>
107+
<Form.Date
108+
name="importantUntil"
109+
enablePast
110+
hideTime
111+
/>
98112
</div>
99113
</Fieldset>
100114
<Form.Action

โ€Žapp/[locale]/community/notice/create/page.tsxโ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export default function NoticeCreatePage() {
3232
isPrivate: content.isPrivate,
3333
isPinned: content.isPinned,
3434
isImportant: content.isImportant,
35+
pinnedUntil: content.pinnedUntil.toISOString().slice(0, 10),
36+
importantUntil: content.importantUntil.toISOString().slice(0, 10),
3537
tags: content.tags,
3638
}),
3739
],

0 commit comments

Comments
ย (0)