From 0500c3c1d5fb983c17b9b0b166df578616a2c078 Mon Sep 17 00:00:00 2001 From: satsuki2200 <132316826+satsuki2200@users.noreply.github.com> Date: Sun, 27 Oct 2024 10:45:24 +0900 Subject: [PATCH] chore: format --- task_yell/src/app/home/page.tsx | 368 ++++++++++++++++++++----- task_yell/src/components/ui/sheet.tsx | 94 ++++++- task_yell/src/components/ui/switch.tsx | 11 +- 3 files changed, 393 insertions(+), 80 deletions(-) diff --git a/task_yell/src/app/home/page.tsx b/task_yell/src/app/home/page.tsx index 17ed505..8a148dd 100644 --- a/task_yell/src/app/home/page.tsx +++ b/task_yell/src/app/home/page.tsx @@ -3,18 +3,65 @@ import { DateTimeInput } from "@/components/date-time-input"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; -import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"; +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; -import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; -import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "@/components/ui/sheet"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { + Sheet, + SheetContent, + SheetHeader, + SheetTitle, + SheetTrigger, +} from "@/components/ui/sheet"; import { Switch } from "@/components/ui/switch"; import { Textarea } from "@/components/ui/textarea"; -import { AngleIcon, ListBulletIcon, Pencil1Icon, ViewGridIcon } from "@radix-ui/react-icons"; -import { addMonths, eachDayOfInterval, endOfMonth, endOfWeek, format, isSameDay, isSameMonth, startOfMonth, startOfWeek, subMonths } from "date-fns"; +import { + AngleIcon, + ListBulletIcon, + Pencil1Icon, + ViewGridIcon, +} from "@radix-ui/react-icons"; +import { + addMonths, + eachDayOfInterval, + endOfMonth, + endOfWeek, + format, + isSameDay, + isSameMonth, + startOfMonth, + startOfWeek, + subMonths, +} from "date-fns"; import { ja } from "date-fns/locale"; import { AnimatePresence, motion, useDragControls } from "framer-motion"; -import { ChevronLeft, ChevronRight, ChevronUp, Edit, MapPinIcon, Menu, Trash2, UserPlusIcon, X, Bell, Users, Download, LogOut } from "lucide-react"; +import { + ChevronLeft, + ChevronRight, + ChevronUp, + Edit, + MapPinIcon, + Menu, + Trash2, + UserPlusIcon, + X, + Bell, + Users, + Download, + LogOut, +} from "lucide-react"; import { useEffect, useMemo, useRef, useState } from "react"; type Priority = "low" | "medium" | "high"; @@ -57,7 +104,15 @@ const priorityColors: Record = { high: "bg-red-100 dark:bg-red-900", }; -function EventCreator({ onSave, onCancel, initialTitle = "" }: { onSave: (event: Event) => void; onCancel: () => void; initialTitle?: string }) { +function EventCreator({ + onSave, + onCancel, + initialTitle = "", +}: { + onSave: (event: Event) => void; + onCancel: () => void; + initialTitle?: string; +}) { const [title, setTitle] = useState(initialTitle); const [description, setDescription] = useState(""); const [date] = useState(new Date()); @@ -96,7 +151,9 @@ function EventCreator({ onSave, onCancel, initialTitle = "" }: { onSave: (event:
-

{format(date || new Date(), "yyyy年MM月dd日 (E)", { locale: ja })}

+

+ {format(date || new Date(), "yyyy年MM月dd日 (E)", { locale: ja })} +

{Array.from({ length: 24 }).map((_, hour) => (
@@ -109,12 +166,20 @@ function EventCreator({ onSave, onCancel, initialTitle = "" }: { onSave: (event:
- setIsTask(checked as boolean)} /> + setIsTask(checked as boolean)} + />
- setTitle(e.target.value)} /> + setTitle(e.target.value)} + />
{isTask ? ( @@ -128,19 +193,35 @@ function EventCreator({ onSave, onCancel, initialTitle = "" }: { onSave: (event:
-