Skip to content

Commit

Permalink
12/21 update
Browse files Browse the repository at this point in the history
  • Loading branch information
xCk27x committed Dec 21, 2024
1 parent 5f9a4c3 commit 65e027f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 72 deletions.
8 changes: 6 additions & 2 deletions src/components/pages/select/belong.tsx
Original file line number Diff line number Diff line change
@@ -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' },
Expand Down Expand Up @@ -26,11 +28,13 @@ const SelectionContent: React.FC<SelectionContentProps> = ({options, onSelect})
<div className="flex w-full flex-col">
{options.map(({ value, label }) => (
<button
className="card bg-neutral-content rounded-box grid h-20 place-items-center text-gray-800 font-bold text-2xl mb-8 hover:scale-105 transition-transform"
className="card bg-neutral-content rounded-box h-20 text-gray-800 font-bold text-2xl mb-8 hover:scale-105 transition-transform"
key={value}
onClick={() => onSelect(value)}
>
{ label }
<Link className="w-full h-full flex justify-center items-center" key={value} to={`/events/create`}>
{ label }
</Link>
</button>
))}
</div>
Expand Down
43 changes: 5 additions & 38 deletions src/routeTree.gen.ts
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -242,7 +216,6 @@ export interface FileRouteTypes {
| '/login'
| '/events/$eventId'
| '/events/create'
| '/events/event'
| '/events/select'
| '/home/infoCard'
| '/calendar'
Expand All @@ -256,7 +229,6 @@ export interface FileRouteTypes {
| '/login'
| '/events/$eventId'
| '/events/create'
| '/events/event'
| '/events/select'
| '/home/infoCard'
| '/calendar'
Expand All @@ -270,7 +242,6 @@ export interface FileRouteTypes {
| '/login'
| '/events/$eventId'
| '/events/create'
| '/events/event'
| '/events/select'
| '/home/infoCard'
| '/calendar/'
Expand All @@ -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
Expand All @@ -301,7 +271,6 @@ const rootRouteChildren: RootRouteChildren = {
LoginRoute: LoginRoute,
EventsEventIdRoute: EventsEventIdRoute,
EventsCreateRoute: EventsCreateRoute,
EventsEventRoute: EventsEventRoute,
EventsSelectRoute: EventsSelectRoute,
HomeInfoCardRoute: HomeInfoCardRoute,
CalendarIndexRoute: CalendarIndexRoute,
Expand All @@ -315,6 +284,8 @@ export const routeTree = rootRoute
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()

/* prettier-ignore-end */

/* ROUTE_MANIFEST_START
{
"routes": {
Expand All @@ -325,7 +296,6 @@ export const routeTree = rootRoute
"/login",
"/events/$eventId",
"/events/create",
"/events/event",
"/events/select",
"/home/infoCard",
"/calendar/",
Expand All @@ -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"
},
Expand Down
13 changes: 2 additions & 11 deletions src/routes/events/select.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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 (
<div className="flex flex-col items-center h-screen">
{/* Header */}
Expand Down
42 changes: 21 additions & 21 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -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" }]
}

0 comments on commit 65e027f

Please sign in to comment.