Skip to content

Commit 4fab378

Browse files
committed
chore: better loading
1 parent 8107958 commit 4fab378

File tree

3 files changed

+35
-37
lines changed

3 files changed

+35
-37
lines changed

src/index.tsx

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,36 @@ import { Router } from '@solidjs/router';
33
import { render } from 'solid-js/web';
44
import { App } from './App';
55
import './assets/css/main.css';
6+
const Main = () => (
7+
<MetaProvider>
8+
<Title>JOSH | Home</Title>
9+
<Meta name='title' content='JOSH | Home' />
10+
<Meta
11+
name='description'
12+
content='JOSH is the JavaScript Object Storage Helper - a simple, effective, and efficient database wrapper written in Typescript'
13+
/>
614

7-
render(
8-
() => (
9-
<MetaProvider>
10-
<Title>JOSH | Home</Title>
11-
<Meta name='title' content='JOSH | Home' />
12-
<Meta
13-
name='description'
14-
content='JOSH is the JavaScript Object Storage Helper - a simple, effective, and efficient database wrapper written in Typescript'
15-
/>
15+
<Meta property='og:type' content='website' />
16+
<Meta property='og:url' content='https://josh.evie.dev/' />
17+
<Meta property='og:title' content='JOSH | Home' />
18+
<Meta
19+
property='og:description'
20+
content='JOSH is the JavaScript Object Storage Helper - a simple, effective, and efficient database wrapper written in Typescript'
21+
/>
22+
<Meta property='og:image' content='https://josh.evie.dev/.gitbook/assets/josh_p_light.svg' />
1623

17-
<Meta property='og:type' content='website' />
18-
<Meta property='og:url' content='https://josh.evie.dev/' />
19-
<Meta property='og:title' content='JOSH | Home' />
20-
<Meta
21-
property='og:description'
22-
content='JOSH is the JavaScript Object Storage Helper - a simple, effective, and efficient database wrapper written in Typescript'
23-
/>
24-
<Meta property='og:image' content='https://josh.evie.dev/.gitbook/assets/josh_p_light.svg' />
25-
26-
<Meta property='twitter:card' content='summary_large_image' />
27-
<Meta property='twitter:url' content='https://josh.evie.dev/' />
28-
<Meta property='twitter:title' content='JOSH | Home' />
29-
<Meta
30-
property='twitter:description'
31-
content='JOSH is the JavaScript Object Storage Helper - a simple, effective, and efficient database wrapper written in Typescript'
32-
/>
33-
<Meta property='twitter:image' content='https://josh.evie.dev/.gitbook/assets/josh_p_light.svg' />
34-
<Router>
35-
<App />
36-
</Router>
37-
</MetaProvider>
38-
),
39-
document.getElementById('root')!
24+
<Meta property='twitter:card' content='summary_large_image' />
25+
<Meta property='twitter:url' content='https://josh.evie.dev/' />
26+
<Meta property='twitter:title' content='JOSH | Home' />
27+
<Meta
28+
property='twitter:description'
29+
content='JOSH is the JavaScript Object Storage Helper - a simple, effective, and efficient database wrapper written in Typescript'
30+
/>
31+
<Meta property='twitter:image' content='https://josh.evie.dev/.gitbook/assets/josh_p_light.svg' />
32+
<Router>
33+
<App />
34+
</Router>
35+
</MetaProvider>
4036
);
37+
38+
render(() => <Main />, document.getElementById('root')!);

src/pages/Home.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import packages from '../store/packages';
66
import { md } from '../utils/mdit';
77

88
const Home = () => {
9-
const [code] = createSignal(`\`\`\`ts\nimport { Josh } from "@joshdb/core";
9+
const code = `\`\`\`ts\nimport { Josh } from "@joshdb/core";
1010
1111
const josh = new Josh({ name: "website" });
1212
13-
await josh.set("foo", "bar");\n\`\`\``);
13+
await josh.set("foo", "bar");\n\`\`\``;
1414

1515
const [pkgs] = packages;
1616
const [pkg, setPackage] = createSignal('core');
@@ -88,7 +88,7 @@ await josh.set("foo", "bar");\n\`\`\``);
8888
</div>
8989
<div class='sm:w-1/2 sm:px-8 mt-8 sm:mt-0'>
9090
<div
91-
innerHTML={md.render(code())}
91+
innerHTML={md.render(code)}
9292
class='bg-zinc-800 px-8 sm:px-0 text-white rounded-lg shadow-xl py-8 sm:px-10 text-sm sm:text-md xl:text-lg sm:py-10'
9393
></div>
9494
<div></div>

src/routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import type { RouteDefinition } from '@solidjs/router';
2-
import { lazy } from 'solid-js';
32
import Docs from './pages/Docs';
3+
import Home from './pages/Home';
44
import NotFound from './pages/NotFound';
55

66
export const routes: RouteDefinition[] = [
77
{
88
path: '/',
9-
component: lazy(() => import('./pages/Home'))
9+
component: Home
1010
},
1111
{
1212
path: ['/docs', '/docs/guide', '/docs/guide/:category', '/docs/guide/:category/:page', '/docs/', '/docs/:pkg', '/docs/:pkg/:type'],

0 commit comments

Comments
 (0)