-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
376 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import type { ParentComponent } from "solid-js"; | ||
import { checkDb } from "@/bindings"; | ||
import { useNavigate } from "@solidjs/router"; | ||
|
||
const Loader: ParentComponent = (props) => { | ||
const navigate = useNavigate(); | ||
const startup = async () => { | ||
const data = await checkDb(); | ||
|
||
if (data === 200) { | ||
navigate("/setup"); | ||
return; | ||
} | ||
navigate("/setup"); | ||
}; | ||
|
||
startup(); | ||
|
||
return ( | ||
<div class="flex justify-center items-center h-screen"> | ||
<div class="flex flex-col justify-center items-center"> | ||
<h1 class="text-4xl font-bold">Loading...</h1> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Loader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,48 @@ | ||
import { lazy } from "solid-js"; | ||
|
||
import "./styles/index.css"; | ||
import "@unocss/reset/tailwind-compat.css"; | ||
import "uno.css"; | ||
|
||
const Overview = lazy(() => import("./screens/Dashboard/pages")); | ||
const Invoices = lazy(() => import("./screens/Dashboard/pages/Sales/Invoices")); | ||
const Expenses = lazy(() => import("./screens/Dashboard/pages/Purchase/Expenses")); | ||
const Clients = lazy(() => import("./screens/Dashboard/pages/Other/Clients")); | ||
const Reports = lazy(() => import("./screens/Dashboard/pages/Other")); | ||
const Settings = lazy(() => import("./screens/Dashboard/pages/Settings")); | ||
const Dashboard = lazy(() => import("./screens/Dashboard")); | ||
const Setup = lazy(() => import("./screens/Setup")); | ||
const App = lazy(() => import("./App")); | ||
|
||
import { render } from "solid-js/web"; | ||
|
||
import App from "./App"; | ||
import { Theme, getTheme, setTheme } from "./utils/theme"; | ||
import { Navigate, Route, Router } from "@solidjs/router"; | ||
|
||
setTheme(getTheme()); | ||
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (e) => e.matches && setTheme(Theme.Dark)); | ||
window | ||
.matchMedia("(prefers-color-scheme: light)") | ||
.addEventListener("change", (e) => e.matches && setTheme(Theme.Light)); | ||
|
||
render(() => <App />, document.getElementById("root") as HTMLElement); | ||
render( | ||
() => ( | ||
<Router root={App}> | ||
<Route path="/" component={() => <Navigate href={"/setup"} />} /> | ||
<Route path="/loader" component={App} /> | ||
<Route path="/setup" component={Setup} /> | ||
<Route path="/dashboard" component={Dashboard}> | ||
<Route path="/" component={Overview} /> | ||
<Route path="/sales"> | ||
<Route path="/invoices" component={Invoices} /> | ||
</Route> | ||
<Route path="/other/clients" component={Clients} /> | ||
<Route path="/other/reports" component={Reports} /> | ||
<Route path="/purchase/expenses" component={Expenses} /> | ||
<Route path="/settings" component={Settings} /> | ||
<Route path="*" component={Overview} /> | ||
</Route> | ||
</Router> | ||
), | ||
document.getElementById("root") as HTMLElement, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { ParentComponent } from "solid-js"; | ||
|
||
export const Button: ParentComponent<{ onClick?: (e: MouseEvent) => void; class?: string }> = (props) => { | ||
return ( | ||
<button | ||
class={`py-1.5 px-8 bg-primary rounded-md text-secondary font-medium text-sm ${props.class}`} | ||
type="button" | ||
onClick={props.onClick} | ||
> | ||
{props.children} | ||
</button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.