code/layouts/default.jsx

49 lines
1.3 KiB
React
Raw Normal View History

2021-08-01 18:32:24 +00:00
import { useRoutes } from 'solid-app-router';
2021-07-05 18:32:33 +00:00
// eslint-disable-next-line no-unused-vars
2021-08-01 18:32:24 +00:00
import { For, lazy } from 'solid-js';
2021-07-12 08:23:02 +00:00
// eslint-disable-next-line no-unused-vars
2021-08-01 18:32:24 +00:00
import { MetaProvider, Title, Link, Meta } from 'solid-meta';
2021-07-12 08:23:02 +00:00
import head from '../config/head.js';
2021-07-23 18:33:16 +00:00
import '@fontsource/poppins';
2021-07-05 18:32:33 +00:00
2021-08-01 18:32:24 +00:00
const route = [
{
path: '/',
component: () => lazy(() => import('../pages/index.jsx')),
},
{
path: '/projects',
component: () => lazy(() => import('../pages/projects.jsx')),
},
{
path: '*all',
component: () => lazy(() => import('../pages/index.jsx')),
},
];
// eslint-disable-next-line no-unused-vars
const Routes = useRoutes(route);
2021-07-05 18:32:33 +00:00
function Default() {
return (
2021-07-12 08:23:02 +00:00
<>
<MetaProvider>
<Title>{head.title}</Title>
<For each={head.link}>{link =>
<Link rel={link.rel} href={link.href} type={link?.type ?? ''} />
}</For>
<For each={head.meta}>{meta =>
<Meta name={meta?.name ?? ''} property={meta?.property ?? ''} content={meta.content} />
}</For>
</MetaProvider>
2021-08-01 18:32:24 +00:00
<div class="bg-cool-gray-900 text-white min-h-screen min-w-full h-full w-full font-body">
<div class="container mx-auto px-10 md:px-20 lg:px-32">
<Routes />
</div>
</div>
2021-07-12 08:23:02 +00:00
</>
2021-07-05 18:32:33 +00:00
);
}
export default Default;