Refactor component code for improved readability and consistency
Some checks failed
CI / ci (push) Failing after 1m36s
Some checks failed
CI / ci (push) Failing after 1m36s
- Simplified map creation in ActivityCorrelations component. - Adjusted className formatting in AccordionTrigger and other UI components for better readability. - Removed unnecessary line breaks in various components including Breadcrumb, Calendar, Checkbox, and others. - Enhanced code formatting in NativeSelect and NavigationMenuTrigger components for consistency. - Updated route imports in routeTree.gen.ts for uniformity in quotation marks. - Cleaned up JSX structure in ReminderCard and ReminderForm components for clarity.
This commit is contained in:
@@ -11,9 +11,7 @@ export function ActivityCorrelations() {
|
||||
|
||||
const { data: correlations, isLoading } = useAllCorrelations(activeIds)
|
||||
|
||||
const activityMap = new Map(
|
||||
(activities ?? []).map((a) => [a.id, a.name])
|
||||
)
|
||||
const activityMap = new Map((activities ?? []).map((a) => [a.id, a.name]))
|
||||
|
||||
const sorted = [...(correlations ?? [])].sort(
|
||||
(a, b) => Math.abs(b.correlation!) - Math.abs(a.correlation!)
|
||||
@@ -54,7 +52,7 @@ function CorrelationBar({ name, value }: { name: string; value: number }) {
|
||||
}`}
|
||||
style={{ width: `${pct / 2}%` }}
|
||||
/>
|
||||
<div className="absolute left-1/2 top-0 h-full w-px bg-muted-foreground/30" />
|
||||
<div className="absolute top-0 left-1/2 h-full w-px bg-muted-foreground/30" />
|
||||
</div>
|
||||
<span
|
||||
className={`w-12 shrink-0 text-right text-xs font-medium ${
|
||||
|
||||
@@ -39,8 +39,14 @@ function AccordionTrigger({
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
<ChevronDownIcon data-slot="accordion-trigger-icon" className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" />
|
||||
<ChevronUpIcon data-slot="accordion-trigger-icon" className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" />
|
||||
<ChevronDownIcon
|
||||
data-slot="accordion-trigger-icon"
|
||||
className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden"
|
||||
/>
|
||||
<ChevronUpIcon
|
||||
data-slot="accordion-trigger-icon"
|
||||
className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline"
|
||||
/>
|
||||
</AccordionPrimitive.Trigger>
|
||||
</AccordionPrimitive.Header>
|
||||
)
|
||||
|
||||
@@ -85,9 +85,7 @@ function BreadcrumbSeparator({
|
||||
className={cn("[&>svg]:size-3.5", className)}
|
||||
{...props}
|
||||
>
|
||||
{children ?? (
|
||||
<ChevronRightIcon />
|
||||
)}
|
||||
{children ?? <ChevronRightIcon />}
|
||||
</li>
|
||||
)
|
||||
}
|
||||
@@ -107,8 +105,7 @@ function BreadcrumbEllipsis({
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<MoreHorizontalIcon
|
||||
/>
|
||||
<MoreHorizontalIcon />
|
||||
<span className="sr-only">More</span>
|
||||
</span>
|
||||
)
|
||||
|
||||
@@ -10,7 +10,11 @@ import {
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { Button, buttonVariants } from "@/components/ui/button"
|
||||
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from "lucide-react"
|
||||
import {
|
||||
ChevronLeftIcon,
|
||||
ChevronRightIcon,
|
||||
ChevronDownIcon,
|
||||
} from "lucide-react"
|
||||
|
||||
function Calendar({
|
||||
className,
|
||||
@@ -153,7 +157,10 @@ function Calendar({
|
||||
|
||||
if (orientation === "right") {
|
||||
return (
|
||||
<ChevronRightIcon className={cn("size-4", className)} {...props} />
|
||||
<ChevronRightIcon
|
||||
className={cn("size-4", className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@ function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
|
||||
data-slot="checkbox-indicator"
|
||||
className="grid place-content-center text-current transition-none [&>svg]:size-3.5"
|
||||
>
|
||||
<CheckIcon
|
||||
/>
|
||||
<CheckIcon />
|
||||
</CheckboxPrimitive.Indicator>
|
||||
</CheckboxPrimitive.Root>
|
||||
)
|
||||
|
||||
@@ -108,7 +108,10 @@ function ComboboxContent({
|
||||
<ComboboxPrimitive.Popup
|
||||
data-slot="combobox-content"
|
||||
data-chips={!!anchor}
|
||||
className={cn("group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}
|
||||
className={cn(
|
||||
"group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
</ComboboxPrimitive.Positioner>
|
||||
|
||||
@@ -11,10 +11,7 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@/components/ui/dialog"
|
||||
import {
|
||||
InputGroup,
|
||||
InputGroupAddon,
|
||||
} from "@/components/ui/input-group"
|
||||
import { InputGroup, InputGroupAddon } from "@/components/ui/input-group"
|
||||
import { SearchIcon, CheckIcon } from "lucide-react"
|
||||
|
||||
function Command({
|
||||
|
||||
@@ -52,7 +52,10 @@ function ContextMenuContent({
|
||||
>
|
||||
<ContextMenuPrimitive.Popup
|
||||
data-slot="context-menu-content"
|
||||
className={cn("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}
|
||||
className={cn(
|
||||
"z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
</ContextMenuPrimitive.Positioner>
|
||||
@@ -174,8 +177,7 @@ function ContextMenuCheckboxItem({
|
||||
>
|
||||
<span className="pointer-events-none absolute right-2">
|
||||
<ContextMenuPrimitive.CheckboxItemIndicator>
|
||||
<CheckIcon
|
||||
/>
|
||||
<CheckIcon />
|
||||
</ContextMenuPrimitive.CheckboxItemIndicator>
|
||||
</span>
|
||||
{children}
|
||||
@@ -214,8 +216,7 @@ function ContextMenuRadioItem({
|
||||
>
|
||||
<span className="pointer-events-none absolute right-2">
|
||||
<ContextMenuPrimitive.RadioItemIndicator>
|
||||
<CheckIcon
|
||||
/>
|
||||
<CheckIcon />
|
||||
</ContextMenuPrimitive.RadioItemIndicator>
|
||||
</span>
|
||||
{children}
|
||||
|
||||
@@ -76,8 +76,7 @@ function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
|
||||
role="separator"
|
||||
{...props}
|
||||
>
|
||||
<MinusIcon
|
||||
/>
|
||||
<MinusIcon />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -80,7 +80,10 @@ function MenubarContent({
|
||||
align={align}
|
||||
alignOffset={alignOffset}
|
||||
sideOffset={sideOffset}
|
||||
className={cn("min-w-36 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95", className )}
|
||||
className={cn(
|
||||
"min-w-36 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
@@ -128,8 +131,7 @@ function MenubarCheckboxItem({
|
||||
>
|
||||
<span className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
|
||||
<MenuPrimitive.CheckboxItemIndicator>
|
||||
<CheckIcon
|
||||
/>
|
||||
<CheckIcon />
|
||||
</MenuPrimitive.CheckboxItemIndicator>
|
||||
</span>
|
||||
{children}
|
||||
@@ -163,8 +165,7 @@ function MenubarRadioItem({
|
||||
>
|
||||
<span className="pointer-events-none absolute left-1.5 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
|
||||
<MenuPrimitive.RadioItemIndicator>
|
||||
<CheckIcon
|
||||
/>
|
||||
<CheckIcon />
|
||||
</MenuPrimitive.RadioItemIndicator>
|
||||
</span>
|
||||
{children}
|
||||
@@ -254,7 +255,10 @@ function MenubarSubContent({
|
||||
return (
|
||||
<DropdownMenuSubContent
|
||||
data-slot="menubar-sub-content"
|
||||
className={cn("min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}
|
||||
className={cn(
|
||||
"min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -105,8 +105,7 @@ function MessageScrollerButton({
|
||||
>
|
||||
{children ?? (
|
||||
<>
|
||||
<ArrowDownIcon
|
||||
/>
|
||||
<ArrowDownIcon />
|
||||
<span className="sr-only">
|
||||
{direction === "end" ? "Scroll to end" : "Scroll to start"}
|
||||
</span>
|
||||
|
||||
@@ -27,7 +27,11 @@ function NativeSelect({
|
||||
className="h-8 w-full min-w-0 appearance-none rounded-lg border border-input bg-transparent py-1 pr-8 pl-2.5 text-sm transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40"
|
||||
{...props}
|
||||
/>
|
||||
<ChevronDownIcon className="pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none" aria-hidden="true" data-slot="native-select-icon" />
|
||||
<ChevronDownIcon
|
||||
className="pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none"
|
||||
aria-hidden="true"
|
||||
data-slot="native-select-icon"
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -71,7 +71,10 @@ function NavigationMenuTrigger({
|
||||
{...props}
|
||||
>
|
||||
{children}{" "}
|
||||
<ChevronDownIcon className="relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180" aria-hidden="true" />
|
||||
<ChevronDownIcon
|
||||
className="relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</NavigationMenuPrimitive.Trigger>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,11 @@ import * as React from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
|
||||
import {
|
||||
ChevronLeftIcon,
|
||||
ChevronRightIcon,
|
||||
MoreHorizontalIcon,
|
||||
} from "lucide-react"
|
||||
|
||||
function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
|
||||
return (
|
||||
@@ -112,8 +116,7 @@ function PaginationEllipsis({
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<MoreHorizontalIcon
|
||||
/>
|
||||
<MoreHorizontalIcon />
|
||||
<span className="sr-only">More pages</span>
|
||||
</span>
|
||||
)
|
||||
|
||||
@@ -125,7 +125,10 @@ function QuestionnaireChoice({
|
||||
data-slot="questionnaire-choice-indicator-dot"
|
||||
className="hidden size-2 rounded-full bg-primary-foreground group-data-[type=checkbox]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block"
|
||||
/>
|
||||
<CheckIcon data-slot="questionnaire-choice-indicator-check" className="hidden size-3.5 group-data-[type=radio]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block" />
|
||||
<CheckIcon
|
||||
data-slot="questionnaire-choice-indicator-check"
|
||||
className="hidden size-3.5 group-data-[type=radio]/questionnaire-choice:hidden group-data-checked/questionnaire-choice:block"
|
||||
/>
|
||||
</span>
|
||||
<QuestionnairePrimitive.ChoiceLabel
|
||||
data-slot="questionnaire-choice-label"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import * as React from "react"
|
||||
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
@@ -83,7 +83,10 @@ function SelectContent({
|
||||
<SelectPrimitive.Popup
|
||||
data-slot="select-content"
|
||||
data-align-trigger={alignItemWithTrigger}
|
||||
className={cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}
|
||||
className={cn(
|
||||
"relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<SelectScrollUpButton />
|
||||
@@ -162,8 +165,7 @@ function SelectScrollUpButton({
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<ChevronUpIcon
|
||||
/>
|
||||
<ChevronUpIcon />
|
||||
</SelectPrimitive.ScrollUpArrow>
|
||||
)
|
||||
}
|
||||
@@ -181,8 +183,7 @@ function SelectScrollDownButton({
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
<ChevronDownIcon
|
||||
/>
|
||||
<ChevronDownIcon />
|
||||
</SelectPrimitive.ScrollDownArrow>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,13 @@ import { Loader2Icon } from "lucide-react"
|
||||
|
||||
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
|
||||
return (
|
||||
<Loader2Icon data-slot="spinner" role="status" aria-label="Loading" className={cn("size-4 animate-spin", className)} {...props} />
|
||||
<Loader2Icon
|
||||
data-slot="spinner"
|
||||
role="status"
|
||||
aria-label="Loading"
|
||||
className={cn("size-4 animate-spin", className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,198 +8,198 @@
|
||||
// You should NOT make any changes in this file as it will be overwritten.
|
||||
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
||||
|
||||
import { Route as rootRouteImport } from './routes/__root'
|
||||
import { Route as AuthRouteImport } from './routes/_auth'
|
||||
import { Route as LoginRouteImport } from './routes/login'
|
||||
import { Route as RegisterRouteImport } from './routes/register'
|
||||
import { Route as AuthIndexRouteImport } from './routes/_auth/index'
|
||||
import { Route as AuthActivitiesRouteImport } from './routes/_auth/activities'
|
||||
import { Route as AuthAddRouteImport } from './routes/_auth/add'
|
||||
import { Route as AuthCalendarRouteImport } from './routes/_auth/calendar'
|
||||
import { Route as AuthDiaryRouteImport } from './routes/_auth/diary'
|
||||
import { Route as AuthExportRouteImport } from './routes/_auth/export'
|
||||
import { Route as AuthImportRouteImport } from './routes/_auth/import'
|
||||
import { Route as AuthRemindersRouteImport } from './routes/_auth/reminders'
|
||||
import { Route as AuthSettingsRouteImport } from './routes/_auth/settings'
|
||||
import { Route as AuthStatsRouteImport } from './routes/_auth/stats'
|
||||
import { Route as AuthEditIdRouteImport } from './routes/_auth/edit.$id'
|
||||
import { Route as AuthEntryIdRouteImport } from './routes/_auth/entry.$id'
|
||||
import { Route as rootRouteImport } from "./routes/__root"
|
||||
import { Route as AuthRouteImport } from "./routes/_auth"
|
||||
import { Route as LoginRouteImport } from "./routes/login"
|
||||
import { Route as RegisterRouteImport } from "./routes/register"
|
||||
import { Route as AuthIndexRouteImport } from "./routes/_auth/index"
|
||||
import { Route as AuthActivitiesRouteImport } from "./routes/_auth/activities"
|
||||
import { Route as AuthAddRouteImport } from "./routes/_auth/add"
|
||||
import { Route as AuthCalendarRouteImport } from "./routes/_auth/calendar"
|
||||
import { Route as AuthDiaryRouteImport } from "./routes/_auth/diary"
|
||||
import { Route as AuthExportRouteImport } from "./routes/_auth/export"
|
||||
import { Route as AuthImportRouteImport } from "./routes/_auth/import"
|
||||
import { Route as AuthRemindersRouteImport } from "./routes/_auth/reminders"
|
||||
import { Route as AuthSettingsRouteImport } from "./routes/_auth/settings"
|
||||
import { Route as AuthStatsRouteImport } from "./routes/_auth/stats"
|
||||
import { Route as AuthEditIdRouteImport } from "./routes/_auth/edit.$id"
|
||||
import { Route as AuthEntryIdRouteImport } from "./routes/_auth/entry.$id"
|
||||
|
||||
const AuthRoute = AuthRouteImport.update({
|
||||
id: '/_auth',
|
||||
id: "/_auth",
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
const LoginRoute = LoginRouteImport.update({
|
||||
id: '/login',
|
||||
path: '/login',
|
||||
id: "/login",
|
||||
path: "/login",
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
const RegisterRoute = RegisterRouteImport.update({
|
||||
id: '/register',
|
||||
path: '/register',
|
||||
id: "/register",
|
||||
path: "/register",
|
||||
getParentRoute: () => rootRouteImport,
|
||||
} as any)
|
||||
const AuthIndexRoute = AuthIndexRouteImport.update({
|
||||
id: '/',
|
||||
path: '/',
|
||||
id: "/",
|
||||
path: "/",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthActivitiesRoute = AuthActivitiesRouteImport.update({
|
||||
id: '/activities',
|
||||
path: '/activities',
|
||||
id: "/activities",
|
||||
path: "/activities",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthAddRoute = AuthAddRouteImport.update({
|
||||
id: '/add',
|
||||
path: '/add',
|
||||
id: "/add",
|
||||
path: "/add",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthCalendarRoute = AuthCalendarRouteImport.update({
|
||||
id: '/calendar',
|
||||
path: '/calendar',
|
||||
id: "/calendar",
|
||||
path: "/calendar",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthDiaryRoute = AuthDiaryRouteImport.update({
|
||||
id: '/diary',
|
||||
path: '/diary',
|
||||
id: "/diary",
|
||||
path: "/diary",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthExportRoute = AuthExportRouteImport.update({
|
||||
id: '/export',
|
||||
path: '/export',
|
||||
id: "/export",
|
||||
path: "/export",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthImportRoute = AuthImportRouteImport.update({
|
||||
id: '/import',
|
||||
path: '/import',
|
||||
id: "/import",
|
||||
path: "/import",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthRemindersRoute = AuthRemindersRouteImport.update({
|
||||
id: '/reminders',
|
||||
path: '/reminders',
|
||||
id: "/reminders",
|
||||
path: "/reminders",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthSettingsRoute = AuthSettingsRouteImport.update({
|
||||
id: '/settings',
|
||||
path: '/settings',
|
||||
id: "/settings",
|
||||
path: "/settings",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthStatsRoute = AuthStatsRouteImport.update({
|
||||
id: '/stats',
|
||||
path: '/stats',
|
||||
id: "/stats",
|
||||
path: "/stats",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any).lazy(() => import('./routes/_auth/stats.lazy').then((d) => d.Route))
|
||||
} as any).lazy(() => import("./routes/_auth/stats.lazy").then((d) => d.Route))
|
||||
const AuthEditIdRoute = AuthEditIdRouteImport.update({
|
||||
id: '/edit/$id',
|
||||
path: '/edit/$id',
|
||||
id: "/edit/$id",
|
||||
path: "/edit/$id",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
const AuthEntryIdRoute = AuthEntryIdRouteImport.update({
|
||||
id: '/entry/$id',
|
||||
path: '/entry/$id',
|
||||
id: "/entry/$id",
|
||||
path: "/entry/$id",
|
||||
getParentRoute: () => AuthRoute,
|
||||
} as any)
|
||||
|
||||
export interface FileRoutesByFullPath {
|
||||
'/': typeof AuthIndexRoute
|
||||
'/login': typeof LoginRoute
|
||||
'/register': typeof RegisterRoute
|
||||
'/activities': typeof AuthActivitiesRoute
|
||||
'/add': typeof AuthAddRoute
|
||||
'/calendar': typeof AuthCalendarRoute
|
||||
'/diary': typeof AuthDiaryRoute
|
||||
'/export': typeof AuthExportRoute
|
||||
'/import': typeof AuthImportRoute
|
||||
'/reminders': typeof AuthRemindersRoute
|
||||
'/settings': typeof AuthSettingsRoute
|
||||
'/stats': typeof AuthStatsRoute
|
||||
'/edit/$id': typeof AuthEditIdRoute
|
||||
'/entry/$id': typeof AuthEntryIdRoute
|
||||
"/": typeof AuthIndexRoute
|
||||
"/login": typeof LoginRoute
|
||||
"/register": typeof RegisterRoute
|
||||
"/activities": typeof AuthActivitiesRoute
|
||||
"/add": typeof AuthAddRoute
|
||||
"/calendar": typeof AuthCalendarRoute
|
||||
"/diary": typeof AuthDiaryRoute
|
||||
"/export": typeof AuthExportRoute
|
||||
"/import": typeof AuthImportRoute
|
||||
"/reminders": typeof AuthRemindersRoute
|
||||
"/settings": typeof AuthSettingsRoute
|
||||
"/stats": typeof AuthStatsRoute
|
||||
"/edit/$id": typeof AuthEditIdRoute
|
||||
"/entry/$id": typeof AuthEntryIdRoute
|
||||
}
|
||||
export interface FileRoutesByTo {
|
||||
'/login': typeof LoginRoute
|
||||
'/register': typeof RegisterRoute
|
||||
'/activities': typeof AuthActivitiesRoute
|
||||
'/add': typeof AuthAddRoute
|
||||
'/calendar': typeof AuthCalendarRoute
|
||||
'/diary': typeof AuthDiaryRoute
|
||||
'/export': typeof AuthExportRoute
|
||||
'/import': typeof AuthImportRoute
|
||||
'/reminders': typeof AuthRemindersRoute
|
||||
'/settings': typeof AuthSettingsRoute
|
||||
'/stats': typeof AuthStatsRoute
|
||||
'/': typeof AuthIndexRoute
|
||||
'/edit/$id': typeof AuthEditIdRoute
|
||||
'/entry/$id': typeof AuthEntryIdRoute
|
||||
"/login": typeof LoginRoute
|
||||
"/register": typeof RegisterRoute
|
||||
"/activities": typeof AuthActivitiesRoute
|
||||
"/add": typeof AuthAddRoute
|
||||
"/calendar": typeof AuthCalendarRoute
|
||||
"/diary": typeof AuthDiaryRoute
|
||||
"/export": typeof AuthExportRoute
|
||||
"/import": typeof AuthImportRoute
|
||||
"/reminders": typeof AuthRemindersRoute
|
||||
"/settings": typeof AuthSettingsRoute
|
||||
"/stats": typeof AuthStatsRoute
|
||||
"/": typeof AuthIndexRoute
|
||||
"/edit/$id": typeof AuthEditIdRoute
|
||||
"/entry/$id": typeof AuthEntryIdRoute
|
||||
}
|
||||
export interface FileRoutesById {
|
||||
__root__: typeof rootRouteImport
|
||||
'/_auth': typeof AuthRouteWithChildren
|
||||
'/login': typeof LoginRoute
|
||||
'/register': typeof RegisterRoute
|
||||
'/_auth/activities': typeof AuthActivitiesRoute
|
||||
'/_auth/add': typeof AuthAddRoute
|
||||
'/_auth/calendar': typeof AuthCalendarRoute
|
||||
'/_auth/diary': typeof AuthDiaryRoute
|
||||
'/_auth/export': typeof AuthExportRoute
|
||||
'/_auth/import': typeof AuthImportRoute
|
||||
'/_auth/reminders': typeof AuthRemindersRoute
|
||||
'/_auth/settings': typeof AuthSettingsRoute
|
||||
'/_auth/stats': typeof AuthStatsRoute
|
||||
'/_auth/': typeof AuthIndexRoute
|
||||
'/_auth/edit/$id': typeof AuthEditIdRoute
|
||||
'/_auth/entry/$id': typeof AuthEntryIdRoute
|
||||
"/_auth": typeof AuthRouteWithChildren
|
||||
"/login": typeof LoginRoute
|
||||
"/register": typeof RegisterRoute
|
||||
"/_auth/activities": typeof AuthActivitiesRoute
|
||||
"/_auth/add": typeof AuthAddRoute
|
||||
"/_auth/calendar": typeof AuthCalendarRoute
|
||||
"/_auth/diary": typeof AuthDiaryRoute
|
||||
"/_auth/export": typeof AuthExportRoute
|
||||
"/_auth/import": typeof AuthImportRoute
|
||||
"/_auth/reminders": typeof AuthRemindersRoute
|
||||
"/_auth/settings": typeof AuthSettingsRoute
|
||||
"/_auth/stats": typeof AuthStatsRoute
|
||||
"/_auth/": typeof AuthIndexRoute
|
||||
"/_auth/edit/$id": typeof AuthEditIdRoute
|
||||
"/_auth/entry/$id": typeof AuthEntryIdRoute
|
||||
}
|
||||
export interface FileRouteTypes {
|
||||
fileRoutesByFullPath: FileRoutesByFullPath
|
||||
fullPaths:
|
||||
| '/'
|
||||
| '/login'
|
||||
| '/register'
|
||||
| '/activities'
|
||||
| '/add'
|
||||
| '/calendar'
|
||||
| '/diary'
|
||||
| '/export'
|
||||
| '/import'
|
||||
| '/reminders'
|
||||
| '/settings'
|
||||
| '/stats'
|
||||
| '/edit/$id'
|
||||
| '/entry/$id'
|
||||
| "/"
|
||||
| "/login"
|
||||
| "/register"
|
||||
| "/activities"
|
||||
| "/add"
|
||||
| "/calendar"
|
||||
| "/diary"
|
||||
| "/export"
|
||||
| "/import"
|
||||
| "/reminders"
|
||||
| "/settings"
|
||||
| "/stats"
|
||||
| "/edit/$id"
|
||||
| "/entry/$id"
|
||||
fileRoutesByTo: FileRoutesByTo
|
||||
to:
|
||||
| '/login'
|
||||
| '/register'
|
||||
| '/activities'
|
||||
| '/add'
|
||||
| '/calendar'
|
||||
| '/diary'
|
||||
| '/export'
|
||||
| '/import'
|
||||
| '/reminders'
|
||||
| '/settings'
|
||||
| '/stats'
|
||||
| '/'
|
||||
| '/edit/$id'
|
||||
| '/entry/$id'
|
||||
| "/login"
|
||||
| "/register"
|
||||
| "/activities"
|
||||
| "/add"
|
||||
| "/calendar"
|
||||
| "/diary"
|
||||
| "/export"
|
||||
| "/import"
|
||||
| "/reminders"
|
||||
| "/settings"
|
||||
| "/stats"
|
||||
| "/"
|
||||
| "/edit/$id"
|
||||
| "/entry/$id"
|
||||
id:
|
||||
| '__root__'
|
||||
| '/_auth'
|
||||
| '/login'
|
||||
| '/register'
|
||||
| '/_auth/activities'
|
||||
| '/_auth/add'
|
||||
| '/_auth/calendar'
|
||||
| '/_auth/diary'
|
||||
| '/_auth/export'
|
||||
| '/_auth/import'
|
||||
| '/_auth/reminders'
|
||||
| '/_auth/settings'
|
||||
| '/_auth/stats'
|
||||
| '/_auth/'
|
||||
| '/_auth/edit/$id'
|
||||
| '/_auth/entry/$id'
|
||||
| "__root__"
|
||||
| "/_auth"
|
||||
| "/login"
|
||||
| "/register"
|
||||
| "/_auth/activities"
|
||||
| "/_auth/add"
|
||||
| "/_auth/calendar"
|
||||
| "/_auth/diary"
|
||||
| "/_auth/export"
|
||||
| "/_auth/import"
|
||||
| "/_auth/reminders"
|
||||
| "/_auth/settings"
|
||||
| "/_auth/stats"
|
||||
| "/_auth/"
|
||||
| "/_auth/edit/$id"
|
||||
| "/_auth/entry/$id"
|
||||
fileRoutesById: FileRoutesById
|
||||
}
|
||||
export interface RootRouteChildren {
|
||||
@@ -208,110 +208,110 @@ export interface RootRouteChildren {
|
||||
RegisterRoute: typeof RegisterRoute
|
||||
}
|
||||
|
||||
declare module '@tanstack/react-router' {
|
||||
declare module "@tanstack/react-router" {
|
||||
interface FileRoutesByPath {
|
||||
'/_auth': {
|
||||
id: '/_auth'
|
||||
path: ''
|
||||
fullPath: '/'
|
||||
"/_auth": {
|
||||
id: "/_auth"
|
||||
path: ""
|
||||
fullPath: "/"
|
||||
preLoaderRoute: typeof AuthRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/login': {
|
||||
id: '/login'
|
||||
path: '/login'
|
||||
fullPath: '/login'
|
||||
"/login": {
|
||||
id: "/login"
|
||||
path: "/login"
|
||||
fullPath: "/login"
|
||||
preLoaderRoute: typeof LoginRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/register': {
|
||||
id: '/register'
|
||||
path: '/register'
|
||||
fullPath: '/register'
|
||||
"/register": {
|
||||
id: "/register"
|
||||
path: "/register"
|
||||
fullPath: "/register"
|
||||
preLoaderRoute: typeof RegisterRouteImport
|
||||
parentRoute: typeof rootRouteImport
|
||||
}
|
||||
'/_auth/': {
|
||||
id: '/_auth/'
|
||||
path: '/'
|
||||
fullPath: '/'
|
||||
"/_auth/": {
|
||||
id: "/_auth/"
|
||||
path: "/"
|
||||
fullPath: "/"
|
||||
preLoaderRoute: typeof AuthIndexRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/activities': {
|
||||
id: '/_auth/activities'
|
||||
path: '/activities'
|
||||
fullPath: '/activities'
|
||||
"/_auth/activities": {
|
||||
id: "/_auth/activities"
|
||||
path: "/activities"
|
||||
fullPath: "/activities"
|
||||
preLoaderRoute: typeof AuthActivitiesRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/add': {
|
||||
id: '/_auth/add'
|
||||
path: '/add'
|
||||
fullPath: '/add'
|
||||
"/_auth/add": {
|
||||
id: "/_auth/add"
|
||||
path: "/add"
|
||||
fullPath: "/add"
|
||||
preLoaderRoute: typeof AuthAddRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/calendar': {
|
||||
id: '/_auth/calendar'
|
||||
path: '/calendar'
|
||||
fullPath: '/calendar'
|
||||
"/_auth/calendar": {
|
||||
id: "/_auth/calendar"
|
||||
path: "/calendar"
|
||||
fullPath: "/calendar"
|
||||
preLoaderRoute: typeof AuthCalendarRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/diary': {
|
||||
id: '/_auth/diary'
|
||||
path: '/diary'
|
||||
fullPath: '/diary'
|
||||
"/_auth/diary": {
|
||||
id: "/_auth/diary"
|
||||
path: "/diary"
|
||||
fullPath: "/diary"
|
||||
preLoaderRoute: typeof AuthDiaryRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/export': {
|
||||
id: '/_auth/export'
|
||||
path: '/export'
|
||||
fullPath: '/export'
|
||||
"/_auth/export": {
|
||||
id: "/_auth/export"
|
||||
path: "/export"
|
||||
fullPath: "/export"
|
||||
preLoaderRoute: typeof AuthExportRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/import': {
|
||||
id: '/_auth/import'
|
||||
path: '/import'
|
||||
fullPath: '/import'
|
||||
"/_auth/import": {
|
||||
id: "/_auth/import"
|
||||
path: "/import"
|
||||
fullPath: "/import"
|
||||
preLoaderRoute: typeof AuthImportRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/reminders': {
|
||||
id: '/_auth/reminders'
|
||||
path: '/reminders'
|
||||
fullPath: '/reminders'
|
||||
"/_auth/reminders": {
|
||||
id: "/_auth/reminders"
|
||||
path: "/reminders"
|
||||
fullPath: "/reminders"
|
||||
preLoaderRoute: typeof AuthRemindersRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/settings': {
|
||||
id: '/_auth/settings'
|
||||
path: '/settings'
|
||||
fullPath: '/settings'
|
||||
"/_auth/settings": {
|
||||
id: "/_auth/settings"
|
||||
path: "/settings"
|
||||
fullPath: "/settings"
|
||||
preLoaderRoute: typeof AuthSettingsRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/stats': {
|
||||
id: '/_auth/stats'
|
||||
path: '/stats'
|
||||
fullPath: '/stats'
|
||||
"/_auth/stats": {
|
||||
id: "/_auth/stats"
|
||||
path: "/stats"
|
||||
fullPath: "/stats"
|
||||
preLoaderRoute: typeof AuthStatsRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/edit/$id': {
|
||||
id: '/_auth/edit/$id'
|
||||
path: '/edit/$id'
|
||||
fullPath: '/edit/$id'
|
||||
"/_auth/edit/$id": {
|
||||
id: "/_auth/edit/$id"
|
||||
path: "/edit/$id"
|
||||
fullPath: "/edit/$id"
|
||||
preLoaderRoute: typeof AuthEditIdRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
'/_auth/entry/$id': {
|
||||
id: '/_auth/entry/$id'
|
||||
path: '/entry/$id'
|
||||
fullPath: '/entry/$id'
|
||||
"/_auth/entry/$id": {
|
||||
id: "/_auth/entry/$id"
|
||||
path: "/entry/$id"
|
||||
fullPath: "/entry/$id"
|
||||
preLoaderRoute: typeof AuthEntryIdRouteImport
|
||||
parentRoute: typeof AuthRoute
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ function ReminderCard({ reminder }: { reminder: ReminderResponse }) {
|
||||
const handleUpdate = (schedule: CreateReminderRequest) => {
|
||||
updateReminder.mutate(
|
||||
{ id: reminder.id, body: { schedule } },
|
||||
{ onSuccess: () => setEditing(false) },
|
||||
{ onSuccess: () => setEditing(false) }
|
||||
)
|
||||
}
|
||||
|
||||
@@ -133,9 +133,7 @@ function ReminderCard({ reminder }: { reminder: ReminderResponse }) {
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{DAYS.map(({ key, label }) => {
|
||||
const time = reminder.schedule[key]
|
||||
return (
|
||||
<DayPill key={key} label={label} time={time} />
|
||||
)
|
||||
return <DayPill key={key} label={label} time={time} />
|
||||
})}
|
||||
</div>
|
||||
|
||||
@@ -151,7 +149,11 @@ function ReminderCard({ reminder }: { reminder: ReminderResponse }) {
|
||||
<AlertDialog>
|
||||
<AlertDialogTrigger
|
||||
render={
|
||||
<Button variant="outline" size="sm" className="text-destructive" />
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="text-destructive"
|
||||
/>
|
||||
}
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
@@ -217,18 +219,20 @@ function ReminderForm({
|
||||
isPending: boolean
|
||||
}) {
|
||||
const defaultTime = "20:00"
|
||||
const [schedule, setSchedule] = useState<Record<DayKey, string | null>>(() => {
|
||||
if (initial) return { ...initial }
|
||||
return {
|
||||
monday: null,
|
||||
tuesday: null,
|
||||
wednesday: null,
|
||||
thursday: null,
|
||||
friday: null,
|
||||
saturday: null,
|
||||
sunday: null,
|
||||
const [schedule, setSchedule] = useState<Record<DayKey, string | null>>(
|
||||
() => {
|
||||
if (initial) return { ...initial }
|
||||
return {
|
||||
monday: null,
|
||||
tuesday: null,
|
||||
wednesday: null,
|
||||
thursday: null,
|
||||
friday: null,
|
||||
saturday: null,
|
||||
sunday: null,
|
||||
}
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
const toggleDay = (day: DayKey) => {
|
||||
setSchedule((prev) => ({
|
||||
@@ -262,7 +266,12 @@ function ReminderForm({
|
||||
<CardContent className="flex flex-col gap-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="text-xs text-muted-foreground">Select days</span>
|
||||
<Button variant="ghost" size="sm" onClick={selectAll} className="text-xs">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={selectAll}
|
||||
className="text-xs"
|
||||
>
|
||||
{DAYS.every(({ key }) => schedule[key]) ? "Clear all" : "Every day"}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user