Compare commits
No commits in common. "b330d6685a8bea590255a8f15eda607bfad03976" and "00881be3e210eaed8a08213046aa9e8062b66bea" have entirely different histories.
b330d6685a
...
00881be3e2
18 changed files with 96 additions and 87 deletions
29
README.md
29
README.md
|
|
@ -1,3 +1,28 @@
|
||||||

|
## Usage
|
||||||
|
|
||||||
# OCBO e-Sign
|
```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)
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,6 @@
|
||||||
<body class="body">
|
<body class="body">
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script type="module" src="/src/index.tsx"></script>
|
<script type="module" src="./index.tsx"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
8
index.tsx
Normal file
8
index.tsx
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
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
13
src/app.tsx
|
|
@ -1,13 +0,0 @@
|
||||||
import { Suspense, type Component } from 'solid-js'
|
|
||||||
|
|
||||||
const App: Component<{ children: Element }> = (props) => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<main>
|
|
||||||
<Suspense>{props.children}</Suspense>
|
|
||||||
</main>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default App
|
|
||||||
|
|
@ -33,14 +33,14 @@ export default (props: Props) => {
|
||||||
<Show when={props.to}>
|
<Show when={props.to}>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Match when={props.design}>
|
<Match when={props.design}>
|
||||||
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : ''}>
|
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : '_self'}>
|
||||||
<button class={props.design} style={borderRadius}>
|
<button class={props.design} style={borderRadius}>
|
||||||
{props.label || 'Click Me!'}
|
{props.label || 'Click Me!'}
|
||||||
</button>
|
</button>
|
||||||
</A>
|
</A>
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={!props.design}>
|
<Match when={!props.design}>
|
||||||
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : ''}>
|
<A href={props.to!} aria-label={props.label} target={props.newtab ? '_blank' : '_self'}>
|
||||||
<button class="button" style={borderRadius}>
|
<button class="button" style={borderRadius}>
|
||||||
{props.label || 'Click Me!'}
|
{props.label || 'Click Me!'}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ interface Props {
|
||||||
export default (props: Props) => {
|
export default (props: Props) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<A href={props.to} aria-label={`Go to ${props.to}`} target={props.newtab ? '_blank' : ''}>
|
<A href={props.to} aria-label={`Go to ${props.to}`} target={props.newtab ? '_blank' : '_self'} data-astro-prefetch>
|
||||||
{props.children}
|
{props.children}
|
||||||
</A>
|
</A>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ import { type JSXElement } from 'solid-js'
|
||||||
interface Props {
|
interface Props {
|
||||||
left: number
|
left: number
|
||||||
right: number
|
right: number
|
||||||
top: number
|
top?: number
|
||||||
bottom: number
|
bottom?: number
|
||||||
children: JSXElement
|
children: JSXElement
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
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>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
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)
|
|
||||||
14
src/layouts/Layout.tsx
Normal file
14
src/layouts/Layout.tsx
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import './Layout.sass'
|
||||||
|
import type { JSXElement } from 'solid-js'
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
children: JSXElement
|
||||||
|
}
|
||||||
|
|
||||||
|
export default (props: Props) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div class="layout">{props.children}</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,7 @@ export default () => {
|
||||||
const getAssessors = async () => {
|
const getAssessors = async () => {
|
||||||
try {
|
try {
|
||||||
const assessors = await ofetch(API + 'get-list-assessors', { parseResponse: JSON.parse })
|
const assessors = await ofetch(API + 'get-list-assessors', { parseResponse: JSON.parse })
|
||||||
assessorsNameList = [...assessors.result]
|
assessorsNameList = [...assessors.result2]
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
|
@ -24,7 +24,7 @@ export default () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Page>
|
<Page>
|
||||||
<Padding left={4.75} right={4.75} top={0} bottom={0}>
|
<Padding left={4.75} right={4.75}>
|
||||||
<Display desktop tablet>
|
<Display desktop tablet>
|
||||||
<Row content="split">
|
<Row content="split">
|
||||||
<Row content="left" gap={2}>
|
<Row content="left" gap={2}>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ export default () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Page alignment="column">
|
<Page alignment="column">
|
||||||
<Padding left={4.75} right={4.75} top={0} bottom={0}>
|
<Padding left={4.75} right={4.75}>
|
||||||
<Row content="split">
|
<Row content="split">
|
||||||
<Link to="/">
|
<Link to="/">
|
||||||
<Row content="left" gap={2}>
|
<Row content="left" gap={2}>
|
||||||
|
|
@ -23,7 +23,7 @@ export default () => {
|
||||||
</Link>
|
</Link>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<Padding top={2} left={0} right={0} bottom={0}>
|
<Padding top={2} left={0} right={0}>
|
||||||
<Row>
|
<Row>
|
||||||
<Box curved thickness={2} padding={2} color="#2f465cd7">
|
<Box curved thickness={2} padding={2} color="#2f465cd7">
|
||||||
<Row>
|
<Row>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ export default () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Page alignment="column">
|
<Page alignment="column">
|
||||||
<Padding left={4.75} right={4.75} top={0} bottom={0}>
|
<Padding left={4.75} right={4.75}>
|
||||||
<Row content="split">
|
<Row content="split">
|
||||||
<Link to="/">
|
<Link to="/">
|
||||||
<Row content="left" gap={2}>
|
<Row content="left" gap={2}>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ export default () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Page alignment="column">
|
<Page alignment="column">
|
||||||
<Padding left={4.75} right={4.75} top={0} bottom={0}>
|
<Padding left={4.75} right={4.75}>
|
||||||
<Row content="split">
|
<Row content="split">
|
||||||
<Link to="/">
|
<Link to="/">
|
||||||
<Row content="left" gap={2}>
|
<Row content="left" gap={2}>
|
||||||
|
|
@ -30,7 +30,7 @@ export default () => {
|
||||||
</Link>
|
</Link>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
<Padding top={2} left={0} right={0} bottom={0}>
|
<Padding top={2} left={0} right={0}>
|
||||||
<Row>
|
<Row>
|
||||||
<Box curved thickness={2} padding={2} color="#2f465cd7">
|
<Box curved thickness={2} padding={2} color="#2f465cd7">
|
||||||
<Row>
|
<Row>
|
||||||
|
|
|
||||||
33
src/routers/router.tsx
Normal file
33
src/routers/router.tsx
Normal 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
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
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')),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
@ -24,5 +24,5 @@
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"noUncheckedSideEffectImports": true
|
"noUncheckedSideEffectImports": true
|
||||||
},
|
},
|
||||||
"include": ["src", "src/index.tsx"]
|
"include": ["src", "index.tsx"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue