manager_dashboard: - DashboardPage: WorkdaySummaryModal integration (view / close-day flows); revenue chart upgrades - WorkdaySummaryModal: new component — shows full shift/revenue summary before closing the day - StaffTab: full rewrite — zone-assignment modal, reset-PIN modal, actions dropdown, richer staff card - ProductsTab: digital-menu fields surfaced in product form - PrintFontsTab: expanded font-size/weight controls per printer channel - TablesConfigTab / TablesPage / tableColourStore: color picker and zone fields for tables - FilterBar: unified filter component with date-range, printer, and category selectors - CategoryPerformance / ProductPerformance / TableAnalytics: donut/bar charts, thermal+browser print modals, richer breakdown tables - PrinterHistory: redesigned with per-printer drill-down and summary blocks - TrafficAnalytics / WorkDaySummary / RevenueTrends / ShiftsOverview / StaffLeaderboard: polish pass - tokens.js: design token updates waiter_pwa: - TableCard: show table color indicator from zone/colour config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
96 lines
2.3 KiB
JavaScript
96 lines
2.3 KiB
JavaScript
import { create } from 'zustand'
|
|
import { persist } from 'zustand/middleware'
|
|
|
|
// Must stay in sync with waiter_pwa/src/store/tableColourStore.js DEFAULT_COLOURS.
|
|
// The PWA uses these as its hardcoded fallback; the manager uses them for "reset to defaults".
|
|
|
|
export const DEFAULT_COLOURS = {
|
|
light: {
|
|
free: {
|
|
cardBg: '#dde5ef',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#3d5270',
|
|
badgeText: '#3d5270',
|
|
},
|
|
mine: {
|
|
cardBg: '#e8610a',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#ffffff',
|
|
badgeText: '#e8610a',
|
|
},
|
|
open: {
|
|
cardBg: '#FF8F60',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#ffffff',
|
|
badgeText: '#FF8F60',
|
|
},
|
|
partially_paid: {
|
|
cardBg: '#FFDC67',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#ffffff',
|
|
badgeText: '#d4a800',
|
|
},
|
|
paid: {
|
|
cardBg: '#81D264',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#ffffff',
|
|
badgeText: '#81D264',
|
|
},
|
|
},
|
|
dark: {
|
|
free: {
|
|
cardBg: '#243044',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#94b8d4',
|
|
badgeText: '#94b8d4',
|
|
},
|
|
mine: {
|
|
cardBg: '#e8610a',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#ffffff',
|
|
badgeText: '#e8610a',
|
|
},
|
|
open: {
|
|
cardBg: '#FF8F60',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#ffffff',
|
|
badgeText: '#FF8F60',
|
|
},
|
|
partially_paid: {
|
|
cardBg: '#FFDC67',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#ffffff',
|
|
badgeText: '#d4a800',
|
|
},
|
|
paid: {
|
|
cardBg: '#81D264',
|
|
badgeBg: 'rgba(255,255,255,0.92)',
|
|
nameText: '#ffffff',
|
|
badgeText: '#81D264',
|
|
},
|
|
},
|
|
}
|
|
|
|
const useTableColourStore = create(persist(
|
|
(set) => ({
|
|
colours: DEFAULT_COLOURS,
|
|
setColour: (mode, status, slot, value) =>
|
|
set(s => ({
|
|
colours: {
|
|
...s.colours,
|
|
[mode]: {
|
|
...s.colours[mode],
|
|
[status]: {
|
|
...s.colours[mode][status],
|
|
[slot]: value,
|
|
},
|
|
},
|
|
},
|
|
})),
|
|
resetAll: () => set({ colours: DEFAULT_COLOURS }),
|
|
}),
|
|
{ name: 'pos-table-colours' }
|
|
))
|
|
|
|
export default useTableColourStore
|