diff --git a/apps/onelauncher/frontend/src/components/base/Button.tsx b/apps/onelauncher/frontend/src/components/base/Button.tsx index 45c0de83..3dc34d8e 100644 --- a/apps/onelauncher/frontend/src/components/base/Button.tsx +++ b/apps/onelauncher/frontend/src/components/base/Button.tsx @@ -41,6 +41,7 @@ export type ButtonProps = AriaButtonProps & RefAttributes & { color?: ButtonVariants['color']; size?: ButtonVariants['size']; className?: string; + isDisabled?: boolean; }; function Button({ @@ -52,6 +53,7 @@ function Button({ return ( ); diff --git a/apps/onelauncher/frontend/src/routes/onboarding/index.tsx b/apps/onelauncher/frontend/src/routes/onboarding/index.tsx new file mode 100644 index 00000000..baed4aff --- /dev/null +++ b/apps/onelauncher/frontend/src/routes/onboarding/index.tsx @@ -0,0 +1,19 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/onboarding/')({ + component: RouteComponent, +}) + +function RouteComponent() { + return ( +
+

+ Welcome to + {' '} + OneLauncher +

+ +

A powerful yet easy to use launcher for Minecraft.

+
+ ) +} diff --git a/apps/onelauncher/frontend/src/routes/onboarding/route.tsx b/apps/onelauncher/frontend/src/routes/onboarding/route.tsx new file mode 100644 index 00000000..67e71de1 --- /dev/null +++ b/apps/onelauncher/frontend/src/routes/onboarding/route.tsx @@ -0,0 +1,62 @@ +import Button from '@/components/base/Button' +import { createFileRoute, Outlet, useNavigate, useRouterState } from '@tanstack/react-router' + +export const Route = createFileRoute('/onboarding')({ + component: RouteComponent, +}) + +function RouteComponent() { + const navigate = useNavigate() + const routerState = useRouterState() + + const steps = [ + '/onboarding/', + ] + + const currentPath = routerState.location.pathname + const currentStepIndex = steps.findIndex(path => currentPath === path || currentPath.startsWith(path)) + + const progressPercentage = steps.length > 1 + ? ((currentStepIndex + 1) / steps.length) * 100 + : (currentStepIndex === 0 ? 100 : 0) + + const handleBack = () => { + if (currentStepIndex > 0) { + navigate({ to: steps[currentStepIndex - 1] }) + } + } + + const handleNext = () => { + if (currentStepIndex < steps.length - 1) { + navigate({ to: steps[currentStepIndex + 1] }) + } else { + // if completed navigate to main + navigate({ to: '/app' }) + } + } + + return ( + // remind me 2 hours! i'll fix this +
+
+
+
+ +
+ +
+ +
+
+ + +
+
+
+ ) +}