快速建立小型活動
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 */}