refactor: adjust layout and remove redundant flex properties
This commit is contained in:
parent
079fb1ca0f
commit
cd687d7ce9
3 changed files with 15 additions and 11 deletions
|
|
@ -29,11 +29,14 @@ function RootRoute() {
|
|||
navigate={(to, options) => router.navigate({ to, ...options })}
|
||||
useHref={to => router.buildLocation({ to }).href}
|
||||
>
|
||||
<WindowFrame />
|
||||
{/* questionable fix copied from old frontend but it works */}
|
||||
<main className='max-h-screen min-h-screen flex flex-col'>
|
||||
<WindowFrame />
|
||||
|
||||
<Outlet />
|
||||
<Outlet />
|
||||
|
||||
<TanStackRouterDevtools />
|
||||
<TanStackRouterDevtools />
|
||||
</main>
|
||||
</RouterProvider>
|
||||
</AnimatedOutletProvider>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export const Route = createFileRoute('/onboarding/')({
|
|||
|
||||
function RouteComponent() {
|
||||
return (
|
||||
<div className="grid grid-cols-2 h-full w-full flex-col items-center justify-center gap-x-16">
|
||||
<div className="grid grid-cols-2 h-full w-full items-center gap-x-16">
|
||||
<h1 className="text-6xl">
|
||||
Welcome to
|
||||
{' '}
|
||||
|
|
|
|||
|
|
@ -8,24 +8,24 @@ export const Route = createFileRoute('/onboarding')({
|
|||
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
|
||||
|
||||
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] })
|
||||
|
|
@ -37,6 +37,7 @@ function RouteComponent() {
|
|||
|
||||
return (
|
||||
// remind me 2 hours! i'll fix this
|
||||
// update: it's fixed!
|
||||
<div className="w-full flex flex-col items-center h-screen">
|
||||
<div className="h-0.5 w-full">
|
||||
<div
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue