diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-15 16:23:06 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-15 16:23:06 +0900 |
| commit | 805f30f2b26d325cd772efc3cb30cb50a8e4c226 (patch) | |
| tree | 7458e90389a88dfc72d9d41f8494474ebaeed074 | |
| parent | 6f40259a4eb0e4d35f1d56c160df3f06df251e42 (diff) | |
| download | kioku-805f30f2b26d325cd772efc3cb30cb50a8e4c226.tar.gz kioku-805f30f2b26d325cd772efc3cb30cb50a8e4c226.tar.zst kioku-805f30f2b26d325cd772efc3cb30cb50a8e4c226.zip | |
feat(ui): add version display in app footer
Inject package.json version via Vite's define config and display
it in a persistent footer across all pages.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| -rw-r--r-- | src/client/App.tsx | 67 | ||||
| -rw-r--r-- | src/client/vite-env.d.ts | 1 | ||||
| -rw-r--r-- | vite.config.ts | 3 |
3 files changed, 40 insertions, 31 deletions
diff --git a/src/client/App.tsx b/src/client/App.tsx index 69af60f..8da919d 100644 --- a/src/client/App.tsx +++ b/src/client/App.tsx @@ -12,37 +12,42 @@ import { export function App() { return ( - <> + <div className="min-h-screen flex flex-col"> <OfflineBanner /> - <Switch> - <Route path="/"> - <ProtectedRoute> - <HomePage /> - </ProtectedRoute> - </Route> - <Route path="/decks/:deckId/cards"> - <ProtectedRoute> - <DeckCardsPage /> - </ProtectedRoute> - </Route> - <Route path="/decks/:deckId/study"> - <ProtectedRoute> - <StudyPage /> - </ProtectedRoute> - </Route> - <Route path="/decks/:deckId"> - <ProtectedRoute> - <DeckDetailPage /> - </ProtectedRoute> - </Route> - <Route path="/note-types"> - <ProtectedRoute> - <NoteTypesPage /> - </ProtectedRoute> - </Route> - <Route path="/login" component={LoginPage} /> - <Route component={NotFoundPage} /> - </Switch> - </> + <div className="flex-1"> + <Switch> + <Route path="/"> + <ProtectedRoute> + <HomePage /> + </ProtectedRoute> + </Route> + <Route path="/decks/:deckId/cards"> + <ProtectedRoute> + <DeckCardsPage /> + </ProtectedRoute> + </Route> + <Route path="/decks/:deckId/study"> + <ProtectedRoute> + <StudyPage /> + </ProtectedRoute> + </Route> + <Route path="/decks/:deckId"> + <ProtectedRoute> + <DeckDetailPage /> + </ProtectedRoute> + </Route> + <Route path="/note-types"> + <ProtectedRoute> + <NoteTypesPage /> + </ProtectedRoute> + </Route> + <Route path="/login" component={LoginPage} /> + <Route component={NotFoundPage} /> + </Switch> + </div> + <footer className="py-2 text-center text-xs text-muted"> + v{__APP_VERSION__} + </footer> + </div> ); } diff --git a/src/client/vite-env.d.ts b/src/client/vite-env.d.ts new file mode 100644 index 0000000..41fad5b --- /dev/null +++ b/src/client/vite-env.d.ts @@ -0,0 +1 @@ +declare const __APP_VERSION__: string; diff --git a/vite.config.ts b/vite.config.ts index 7eb818e..40730a9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,6 +6,9 @@ import topLevelAwait from "vite-plugin-top-level-await"; import wasm from "vite-plugin-wasm"; export default defineConfig({ + define: { + __APP_VERSION__: JSON.stringify(process.env.npm_package_version), + }, plugins: [ wasm(), topLevelAwait(), |
