diff --git a/.gitignore b/.gitignore index 5b3eca4..2938463 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,9 @@ __pycache__ package-lock.json .parcel-cache *.old + +data/*.db* + +# macOS duplicate copies +* 2 +* 2.* diff --git a/.postcssrc b/.postcssrc deleted file mode 100644 index 39ef0bb..0000000 --- a/.postcssrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "plugins": { - "tailwindcss": {}, - "cssnano": {} - } -} diff --git a/Dockerfile b/Dockerfile index 988a57c..4ce9fa5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN npm i --package-lock-only RUN npm ci COPY ./client ./client -COPY ./tailwind.config.js ./.postcssrc ./ +COPY ./tailwind.config.js ./postcss.config.js ./vite.config.ts ./tsconfig.json ./ RUN npm run build # RUNTIME diff --git a/client/App.tsx b/client/App.tsx index c9b05a7..37688fe 100644 --- a/client/App.tsx +++ b/client/App.tsx @@ -1,17 +1,26 @@ -import React from 'react'; -import { BrowserRouter, Routes, Route, Outlet } from 'react-router-dom'; +import { lazy, Suspense } from 'react' +import { BrowserRouter, Routes, Route } from 'react-router-dom' -import { BASE_URL } from './api'; +import { BASE_URL } from './api' +import { ToastProvider } from './components/Toast' -import Login from './pages/Login'; -import New from './pages/New'; +import Login from './pages/Login' import Home from './pages/Home' import AllFlights from './pages/AllFlights' -import Statistics from './pages/Statistics'; -import Settings from './pages/Settings'; +import { AppShell } from './components/shell/AppShell' +import { Spinner } from './components/ui/Spinner' -import Navbar from './components/Navbar'; -import { ToastProvider } from './components/Toast'; +const New = lazy(() => import('./pages/New')) +const Statistics = lazy(() => import('./pages/Statistics')) +const Settings = lazy(() => import('./pages/Settings')) + +function Loading() { + return ( +
- {text} -
- ) -} - -interface LabelProps { - text: string; - required?: boolean; -} -export function Label({ text, required }: LabelProps) { - return ( - - ); -} - -interface ButtonProps { - text: string; - level?: "default"|"success"|"danger"; - right?: boolean; - submit?: boolean; - disabled?: boolean; - onClick?: React.MouseEventHandler