diff --git a/src/components/pages/select/belong.tsx b/src/components/pages/select/belong.tsx index 0d03473..a9ae11b 100644 --- a/src/components/pages/select/belong.tsx +++ b/src/components/pages/select/belong.tsx @@ -1,3 +1,5 @@ +import { Link } from "@tanstack/react-router"; + const belongOptions = [ { value: 'campus', label: '校園活動', ariaLabel: 'Select campus event' }, { value: 'club', label: '社團活動', ariaLabel: 'Select club event' }, @@ -26,11 +28,13 @@ const SelectionContent: React.FC = ({options, onSelect})
{options.map(({ value, label }) => ( ))}
diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 7c23185..6d08c3e 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -1,12 +1,12 @@ +/* prettier-ignore-start */ + /* eslint-disable */ // @ts-nocheck // noinspection JSUnusedGlobalSymbols -// This file was automatically generated by TanStack Router. -// 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. +// This file is auto-generated by TanStack Router // Import Routes @@ -20,56 +20,47 @@ import { Route as DinnerIndexImport } from './routes/dinner/index' import { Route as CalendarIndexImport } from './routes/calendar/index' import { Route as HomeInfoCardImport } from './routes/home/infoCard' import { Route as EventsSelectImport } from './routes/events/select' -import { Route as EventsEventImport } from './routes/events/event' import { Route as EventsCreateImport } from './routes/events/create' import { Route as EventsEventIdImport } from './routes/events/$eventId' // Create/Update Routes const LoginRoute = LoginImport.update({ - id: '/login', path: '/login', getParentRoute: () => rootRoute, } as any) const IndexRoute = IndexImport.update({ - id: '/', path: '/', getParentRoute: () => rootRoute, } as any) const SalesIndexRoute = SalesIndexImport.update({ - id: '/sales/', path: '/sales/', getParentRoute: () => rootRoute, } as any) const MapIndexRoute = MapIndexImport.update({ - id: '/map/', path: '/map/', getParentRoute: () => rootRoute, } as any) const EventsIndexRoute = EventsIndexImport.update({ - id: '/events/', path: '/events/', getParentRoute: () => rootRoute, } as any) const DinnerIndexRoute = DinnerIndexImport.update({ - id: '/dinner/', path: '/dinner/', getParentRoute: () => rootRoute, } as any) const CalendarIndexRoute = CalendarIndexImport.update({ - id: '/calendar/', path: '/calendar/', getParentRoute: () => rootRoute, } as any) const HomeInfoCardRoute = HomeInfoCardImport.update({ - id: '/home/infoCard', path: '/home/infoCard', getParentRoute: () => rootRoute, } as any) @@ -79,19 +70,12 @@ const EventsSelectRoute = EventsSelectImport.update({ getParentRoute: () => rootRoute, } as any) -const EventsEventRoute = EventsEventImport.update({ - path: '/events/event', - getParentRoute: () => rootRoute, -} as any) - const EventsCreateRoute = EventsCreateImport.update({ - id: '/events/create', path: '/events/create', getParentRoute: () => rootRoute, } as any) const EventsEventIdRoute = EventsEventIdImport.update({ - id: '/events/$eventId', path: '/events/$eventId', getParentRoute: () => rootRoute, } as any) @@ -128,13 +112,6 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof EventsCreateImport parentRoute: typeof rootRoute } - '/events/event': { - id: '/events/event' - path: '/events/event' - fullPath: '/events/event' - preLoaderRoute: typeof EventsEventImport - parentRoute: typeof rootRoute - } '/events/select': { id: '/events/select' path: '/events/select' @@ -194,7 +171,6 @@ export interface FileRoutesByFullPath { '/login': typeof LoginRoute '/events/$eventId': typeof EventsEventIdRoute '/events/create': typeof EventsCreateRoute - '/events/event': typeof EventsEventRoute '/events/select': typeof EventsSelectRoute '/home/infoCard': typeof HomeInfoCardRoute '/calendar': typeof CalendarIndexRoute @@ -209,7 +185,6 @@ export interface FileRoutesByTo { '/login': typeof LoginRoute '/events/$eventId': typeof EventsEventIdRoute '/events/create': typeof EventsCreateRoute - '/events/event': typeof EventsEventRoute '/events/select': typeof EventsSelectRoute '/home/infoCard': typeof HomeInfoCardRoute '/calendar': typeof CalendarIndexRoute @@ -225,7 +200,6 @@ export interface FileRoutesById { '/login': typeof LoginRoute '/events/$eventId': typeof EventsEventIdRoute '/events/create': typeof EventsCreateRoute - '/events/event': typeof EventsEventRoute '/events/select': typeof EventsSelectRoute '/home/infoCard': typeof HomeInfoCardRoute '/calendar/': typeof CalendarIndexRoute @@ -242,7 +216,6 @@ export interface FileRouteTypes { | '/login' | '/events/$eventId' | '/events/create' - | '/events/event' | '/events/select' | '/home/infoCard' | '/calendar' @@ -256,7 +229,6 @@ export interface FileRouteTypes { | '/login' | '/events/$eventId' | '/events/create' - | '/events/event' | '/events/select' | '/home/infoCard' | '/calendar' @@ -270,7 +242,6 @@ export interface FileRouteTypes { | '/login' | '/events/$eventId' | '/events/create' - | '/events/event' | '/events/select' | '/home/infoCard' | '/calendar/' @@ -286,7 +257,6 @@ export interface RootRouteChildren { LoginRoute: typeof LoginRoute EventsEventIdRoute: typeof EventsEventIdRoute EventsCreateRoute: typeof EventsCreateRoute - EventsEventRoute: typeof EventsEventRoute EventsSelectRoute: typeof EventsSelectRoute HomeInfoCardRoute: typeof HomeInfoCardRoute CalendarIndexRoute: typeof CalendarIndexRoute @@ -301,7 +271,6 @@ const rootRouteChildren: RootRouteChildren = { LoginRoute: LoginRoute, EventsEventIdRoute: EventsEventIdRoute, EventsCreateRoute: EventsCreateRoute, - EventsEventRoute: EventsEventRoute, EventsSelectRoute: EventsSelectRoute, HomeInfoCardRoute: HomeInfoCardRoute, CalendarIndexRoute: CalendarIndexRoute, @@ -315,6 +284,8 @@ export const routeTree = rootRoute ._addFileChildren(rootRouteChildren) ._addFileTypes() +/* prettier-ignore-end */ + /* ROUTE_MANIFEST_START { "routes": { @@ -325,7 +296,6 @@ export const routeTree = rootRoute "/login", "/events/$eventId", "/events/create", - "/events/event", "/events/select", "/home/infoCard", "/calendar/", @@ -347,9 +317,6 @@ export const routeTree = rootRoute "/events/create": { "filePath": "events/create.tsx" }, - "/events/event": { - "filePath": "events/event.tsx" - }, "/events/select": { "filePath": "events/select.tsx" }, diff --git a/src/routes/events/select.tsx b/src/routes/events/select.tsx index 3d48b2c..f9a08d9 100644 --- a/src/routes/events/select.tsx +++ b/src/routes/events/select.tsx @@ -1,5 +1,5 @@ import { createFileRoute, Link } from '@tanstack/react-router' -import { useState, useEffect } from 'react' +import { useState } from 'react' import ScaleContent from '../../components/pages/select/scale' import TypeContent from '../../components/pages/select/type' @@ -11,21 +11,12 @@ export const Route = createFileRoute('/events/select')({ function SelectContent() { - const navigate = Route.useNavigate(); - const [step, setStep] = useState(0) const handleNextStep = () => { setStep((prevStep) => Math.min(prevStep + 1, 3)) } - - useEffect(() => { - if (step >= 3) { - console.log('Redirecting to /events/create') - navigate({ to: '/events/create' }) - } - }, [step]); - + return (
{/* Header */} diff --git a/tsconfig.json b/tsconfig.json index a7fc6fb..e9b8b36 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,25 +1,25 @@ { - "compilerOptions": { - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true - }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src", "src/routes/events/select/type.tsx"], + "references": [{ "path": "./tsconfig.node.json" }] }