diff --git a/src/components/pages/select/belong.tsx b/src/components/pages/select/belong.tsx index 723b429..0d03473 100644 --- a/src/components/pages/select/belong.tsx +++ b/src/components/pages/select/belong.tsx @@ -1,35 +1,44 @@ +const belongOptions = [ + { value: 'campus', label: '校園活動', ariaLabel: 'Select campus event' }, + { value: 'club', label: '社團活動', ariaLabel: 'Select club event' }, + // ... other options +]; + interface BelongContentProps { onNext: () => void; // 定义 onNext 是一个无参数、无返回值的函数 } -export default function BelongContent({onNext}: BelongContentProps) { - return ( - <> -
-
-
- - - - -
+ ))}
- - ) + + +); + + +export default function BelongContent({onNext}: BelongContentProps) { + return ; } \ No newline at end of file diff --git a/src/components/pages/select/scale.tsx b/src/components/pages/select/scale.tsx index 4ae3965..ae16b34 100644 --- a/src/components/pages/select/scale.tsx +++ b/src/components/pages/select/scale.tsx @@ -1,5 +1,5 @@ interface ScaleContentProps { - onNext: () => void; // 定义 onNext 是一个无参数、无返回值的函数 + onNext: (scale: 'small' | 'formal') => void; // 定义 onNext 是一个无参数、无返回值的函数 } export default function ScaleContent({onNext}: ScaleContentProps) { @@ -9,14 +9,18 @@ export default function ScaleContent({onNext}: ScaleContentProps) {

快速建立小型活動

diff --git a/src/routes/events/select.tsx b/src/routes/events/select.tsx index f1dac86..3d48b2c 100644 --- a/src/routes/events/select.tsx +++ b/src/routes/events/select.tsx @@ -1,4 +1,4 @@ -import { createFileRoute, Link, useRouter } from '@tanstack/react-router' +import { createFileRoute, Link } from '@tanstack/react-router' import { useState, useEffect } from 'react' import ScaleContent from '../../components/pages/select/scale' @@ -10,8 +10,9 @@ export const Route = createFileRoute('/events/select')({ }) function SelectContent() { - const router = useRouter(); - + + const navigate = Route.useNavigate(); + const [step, setStep] = useState(0) const handleNextStep = () => { @@ -20,9 +21,10 @@ function SelectContent() { useEffect(() => { if (step >= 3) { - router.navigate('/events/create') + console.log('Redirecting to /events/create') + navigate({ to: '/events/create' }) } - }, [step, router]); + }, [step]); return (
@@ -35,13 +37,18 @@ function SelectContent() { {/* Content */}
{/* Render Content Based on Step */} - {step === 0 ? ( - - ) : step === 1 ? ( - - ) : step === 2 ? ( - - ) : null} + {(() => { + switch (step) { + case 0: + return ; + case 1: + return ; + case 2: + return ; + default: + return null; + } + })()} {/* Steps */}