tauri-app: allow editing record-daemon settings
All checks were successful
record-daemon / Build, check and test (push) Successful in 2m28s
All checks were successful
record-daemon / Build, check and test (push) Successful in 2m28s
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
import { ref } from "vue";
|
||||
import GameHistory from "./components/GameHistory.vue";
|
||||
import GameReview from "./components/GameReview.vue";
|
||||
import Settings from "./components/Settings.vue";
|
||||
import type { GameHistoryItem } from "./types/timeline";
|
||||
|
||||
// Current view state
|
||||
const currentView = ref<"history" | "review">("history");
|
||||
const currentView = ref<"history" | "review" | "settings">("history");
|
||||
const selectedGame = ref<GameHistoryItem | null>(null);
|
||||
|
||||
// Navigate to review view
|
||||
@@ -19,12 +20,50 @@ function closeReview() {
|
||||
currentView.value = "history";
|
||||
selectedGame.value = null;
|
||||
}
|
||||
|
||||
// Navigate to settings
|
||||
function openSettings() {
|
||||
currentView.value = "settings";
|
||||
}
|
||||
|
||||
// Navigate back from settings
|
||||
function closeSettings() {
|
||||
currentView.value = "history";
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="app">
|
||||
<GameHistory
|
||||
v-if="currentView === 'history'"
|
||||
<!-- Navigation bar -->
|
||||
<nav v-if="currentView !== 'review'" class="app-nav">
|
||||
<div class="nav-left">
|
||||
<button
|
||||
:class="['nav-tab', { active: currentView === 'history' }]"
|
||||
@click="currentView = 'history'"
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<rect x="3" y="3" width="7" height="7" rx="1" />
|
||||
<rect x="14" y="3" width="7" height="7" rx="1" />
|
||||
<rect x="3" y="14" width="7" height="7" rx="1" />
|
||||
<rect x="14" y="14" width="7" height="7" rx="1" />
|
||||
</svg>
|
||||
Game History
|
||||
</button>
|
||||
<button
|
||||
:class="['nav-tab', { active: currentView === 'settings' }]"
|
||||
@click="openSettings"
|
||||
>
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" />
|
||||
</svg>
|
||||
Settings
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<GameHistory
|
||||
v-if="currentView === 'history'"
|
||||
@open-review="openReview"
|
||||
/>
|
||||
<GameReview
|
||||
@@ -32,6 +71,10 @@ function closeReview() {
|
||||
:game="selectedGame"
|
||||
@back="closeReview"
|
||||
/>
|
||||
<Settings
|
||||
v-else-if="currentView === 'settings'"
|
||||
@back="closeSettings"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -72,4 +115,44 @@ body {
|
||||
min-height: 100vh;
|
||||
background: #0a0a13;
|
||||
}
|
||||
|
||||
/* Navigation bar */
|
||||
.app-nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 24px;
|
||||
height: 48px;
|
||||
background: rgba(255, 255, 255, 0.03);
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.nav-left {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.nav-tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 8px 14px;
|
||||
background: none;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
color: #94a3b8;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
|
||||
.nav-tab:hover {
|
||||
color: #e2e8f0;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.nav-tab.active {
|
||||
color: #f1f5f9;
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user