Compare commits

...

6 commits

18 changed files with 87 additions and 96 deletions

View file

@ -1,28 +1,3 @@
## Usage
![OCBO e-Sign Logo](/src/assets/images/logo.png)
```bash
$ npm install # or pnpm install or yarn install
```
### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
## Available Scripts
In the project directory, you can run:
### `npm run dev`
Runs the app in the development mode.<br>
Open [http://localhost:5173](http://localhost:5173) to view it in the browser.
### `npm run build`
Builds the app for production to the `dist` folder.<br>
It correctly bundles Solid in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!
## Deployment
Learn more about deploying your application with the [documentations](https://vite.dev/guide/static-deploy.html)
# OCBO e-Sign

View file

@ -19,6 +19,6 @@
<body class="body">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script type="module" src="./index.tsx"></script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>

View file

@ -1,8 +0,0 @@
import { render } from 'solid-js/web'
import { Router } from '@solidjs/router'
import routes from './src/routers/router'
const root = document.getElementById('root') as HTMLElement
render(() => <Router>{routes}</Router>, root)

13
src/app.tsx Normal file
View file

@ -0,0 +1,13 @@
import { Suspense, type Component } from 'solid-js'
const App: Component<{ children: Element }> = (props) => {
return (
<>
<main>
<Suspense>{props.children}</Suspense>
</main>
</>
)
}
export default App

View file

@ -33,14 +33,14 @@ export default (props: Props) => {
<Show when={props.to}>
<Switch>
<Match when={props.design}>
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : '_self'}>
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : ''}>
<button class={props.design} style={borderRadius}>
{props.label || 'Click Me!'}
</button>
</A>
</Match>
<Match when={!props.design}>
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : '_self'}>
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : ''}>
<button class="button" style={borderRadius}>
{props.label || 'Click Me!'}
</button>

View file

@ -10,7 +10,7 @@ interface Props {
export default (props: Props) => {
return (
<>
<A href={props.to} aria-label={`Go to ${props.to}`} target={props.newtab ? '_blank' : '_self'} data-astro-prefetch>
<A href={props.to} aria-label={`Go to ${props.to}`} target={props.newtab ? '_blank' : ''}>
{props.children}
</A>
</>

View file

@ -3,8 +3,8 @@ import { type JSXElement } from 'solid-js'
interface Props {
left: number
right: number
top?: number
bottom?: number
top: number
bottom: number
children: JSXElement
}

18
src/errors/404.tsx Normal file
View file

@ -0,0 +1,18 @@
import { Column, Logo, Page, Button, Padding } from '../components'
export default function NotFound() {
return (
<>
<Page alignment="column">
<Column>
<Logo size={200} />
<h1>Error 404</h1>
<h2>Page not found</h2>
<Padding top={2} left={0} right={0} bottom={0}>
<Button edges="curved" to="/" label="Return"></Button>
</Padding>
</Column>
</Page>
</>
)
}

13
src/index.tsx Normal file
View file

@ -0,0 +1,13 @@
import './index.sass'
import { render } from 'solid-js/web'
import { Router } from '@solidjs/router'
import { routes } from './routes'
import App from './app.tsx'
const root = document.getElementById('root') as HTMLElement
if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
throw new Error('Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?')
}
// @ts-ignore
render(() => <Router root={(props) => <App>{props.children}</App>}>{routes}</Router>, root)

View file

@ -1,14 +0,0 @@
import './Layout.sass'
import type { JSXElement } from 'solid-js'
interface Props {
children: JSXElement
}
export default (props: Props) => {
return (
<>
<div class="layout">{props.children}</div>
</>
)
}

View file

@ -10,7 +10,7 @@ export default () => {
const getAssessors = async () => {
try {
const assessors = await ofetch(API + 'get-list-assessors', { parseResponse: JSON.parse })
assessorsNameList = [...assessors.result2]
assessorsNameList = [...assessors.result]
} catch (error) {
console.error(error)
}
@ -24,7 +24,7 @@ export default () => {
return (
<>
<Page>
<Padding left={4.75} right={4.75}>
<Padding left={4.75} right={4.75} top={0} bottom={0}>
<Display desktop tablet>
<Row content="split">
<Row content="left" gap={2}>

View file

@ -6,7 +6,7 @@ export default () => {
return (
<>
<Page alignment="column">
<Padding left={4.75} right={4.75}>
<Padding left={4.75} right={4.75} top={0} bottom={0}>
<Row content="split">
<Link to="/">
<Row content="left" gap={2}>
@ -23,7 +23,7 @@ export default () => {
</Link>
</Row>
<Padding top={2} left={0} right={0}>
<Padding top={2} left={0} right={0} bottom={0}>
<Row>
<Box curved thickness={2} padding={2} color="#2f465cd7">
<Row>

View file

@ -7,7 +7,7 @@ export default () => {
return (
<>
<Page alignment="column">
<Padding left={4.75} right={4.75}>
<Padding left={4.75} right={4.75} top={0} bottom={0}>
<Row content="split">
<Link to="/">
<Row content="left" gap={2}>

View file

@ -13,7 +13,7 @@ export default () => {
return (
<>
<Page alignment="column">
<Padding left={4.75} right={4.75}>
<Padding left={4.75} right={4.75} top={0} bottom={0}>
<Row content="split">
<Link to="/">
<Row content="left" gap={2}>
@ -30,7 +30,7 @@ export default () => {
</Link>
</Row>
<Padding top={2} left={0} right={0}>
<Padding top={2} left={0} right={0} bottom={0}>
<Row>
<Box curved thickness={2} padding={2} color="#2f465cd7">
<Row>

View file

@ -1,33 +0,0 @@
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

27
src/routes.tsx Normal file
View file

@ -0,0 +1,27 @@
import { lazy } from 'solid-js'
import type { RouteDefinition } from '@solidjs/router'
import Index from './pages/IndexPage/Index'
export const routes: RouteDefinition[] = [
{
path: '/',
component: Index,
},
{
path: '/main',
component: lazy(() => import('./pages/MainPage/Main')),
},
{
path: '/register',
component: lazy(() => import('./pages/RegisterPage/Register.tsx')),
},
{
path: '/login',
component: lazy(() => import('./pages/LoginPage/Login.tsx')),
},
{
path: '**',
component: lazy(() => import('./errors/404')),
},
]

View file

@ -24,5 +24,5 @@
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
},
"include": ["src", "index.tsx"]
"include": ["src", "src/index.tsx"]
}