Fixed layout and routing

This commit is contained in:
Patrick Alvin Alcala 2025-09-24 17:55:40 +08:00
parent c57727e20a
commit ddff738d2e
5 changed files with 54 additions and 26 deletions

33
src/routers/router.tsx Normal file
View file

@ -0,0 +1,33 @@
import { lazy } from 'solid-js'
import Layout from '../layouts/Layout.tsx'
const routes = [
{
path: '/',
component: (props: any) => <Layout>{props.children}</Layout>,
children: [
{
path: '/',
component: lazy(() => import('../pages/IndexPage/Index.tsx')),
},
{
path: '/main',
component: lazy(() => import('../pages/MainPage/Main.tsx')),
},
{
path: '/register',
component: lazy(() => import('../pages/RegisterPage/Register.tsx')),
},
{
path: '/login',
component: lazy(() => import('../pages/LoginPage/Login.tsx')),
},
],
},
{
path: '**',
component: () => <div>404</div>,
},
]
export default routes