|
| 1 | +import { NavigateByAuthState } from "~/components/common/NavigateByAuthState"; |
| 2 | +import TopNavigation from "~/components/common/TopNavigation"; |
| 3 | + |
| 4 | +// Notification型を定義 |
| 5 | +type Notification = { |
| 6 | + date: string; // お知らせの日付 (例: "2024-12-15") |
| 7 | + title: string; // お知らせのタイトル (例: "システムメンテナンスのお知らせ") |
| 8 | + content: string; // お知らせの内容 (例: "2024年12月20日午後2時より...") |
| 9 | +}; |
| 10 | + |
| 11 | +// お知らせリスト |
| 12 | +const notifications: Notification[] = [ |
| 13 | + { |
| 14 | + date: "2024-12-28", |
| 15 | + title: "CourseMate Ver2.0.0リリースのお知らせ", |
| 16 | + content: "検索機能など、新たな機能を実装しました。ぜひご活用ください。", |
| 17 | + }, |
| 18 | + { |
| 19 | + date: "2024-10-9", |
| 20 | + title: "CourseMate Ver1.0.1リリースのお知らせ", |
| 21 | + content: "授業登録モーダルにおいて、授業IDを追加しました。", |
| 22 | + }, |
| 23 | + { |
| 24 | + date: "2024-10-1", |
| 25 | + title: "CourseMate リリースのお知らせ", |
| 26 | + content: "CourseMateがリリースされました!ぜひご活用ください。", |
| 27 | + }, |
| 28 | +]; |
| 29 | + |
| 30 | +// 日付の降順(最近の順)で並べ替え |
| 31 | +const sortedNotifications = notifications.sort( |
| 32 | + (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime(), |
| 33 | +); |
| 34 | + |
| 35 | +export default function Notification() { |
| 36 | + return ( |
| 37 | + <NavigateByAuthState type="toLoginForUnauthenticated"> |
| 38 | + <div className="flex flex-col p-2"> |
| 39 | + <TopNavigation title="お知らせ" /> |
| 40 | + |
| 41 | + <ul className="w-full space-y-6 p-8 text-left"> |
| 42 | + {sortedNotifications.map((notification) => ( |
| 43 | + <li key={notification.date} className="border-b pb-4"> |
| 44 | + <h2 className="font-semibold text-lg">{notification.title}</h2> |
| 45 | + <p className="text-gray-500 text-sm">{notification.date}</p> |
| 46 | + <p className="mt-2 leading-7">{notification.content}</p> |
| 47 | + </li> |
| 48 | + ))} |
| 49 | + </ul> |
| 50 | + </div> |
| 51 | + </NavigateByAuthState> |
| 52 | + ); |
| 53 | +} |
0 commit comments