feat: the venue's identity in every app: its colour as the accent of the waiters' phones and every terminal screen, customer display looks on the identity, the signage logo widget falls back to the venue's logo
Settings -> Venue -> accent "The venue's identity" (venue.theme = identity): bootstrap carries the identity's first colour and logos; @xenia/ui applyVenueTheme makes the accent tokens (light and dark, readable foregrounds) from it. A display look's "Colours and logo" can be the venue's identity. Plan 6R.20, F-117. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+13
-3
@@ -6,11 +6,11 @@
|
||||
// retries by itself while the server can't be reached (unattended screens)
|
||||
// Terminal pairing → sign-in → the device's own app, or a "can't run" screen
|
||||
// The screen follows the device, not the URL; only the dev pages have routes.
|
||||
import { lazy, Suspense } from 'react'
|
||||
import { lazy, Suspense, useEffect } from 'react'
|
||||
import { BrowserRouter, Route, Routes } from 'react-router-dom'
|
||||
import { AccessProvider } from '@xenia/access'
|
||||
import { AccessProvider, useAccess } from '@xenia/access'
|
||||
import { createI18n } from '@xenia/i18n'
|
||||
import { Spinner, ToastProvider } from '@xenia/ui'
|
||||
import { applyVenueTheme, Spinner, ToastProvider } from '@xenia/ui'
|
||||
import client from './api/client'
|
||||
import DeviceProvider from './device/DeviceProvider'
|
||||
import { useDevice } from './device/context'
|
||||
@@ -30,12 +30,22 @@ function Root() {
|
||||
return (
|
||||
<AccessProvider client={client} token={sessionKey} i18n={i18n} loading={loading} autoRetryMs={AUTO_RETRY_MS}>
|
||||
<ToastProvider placement="bottom-center">
|
||||
<VenueAccent />
|
||||
<Terminal />
|
||||
</ToastProvider>
|
||||
</AccessProvider>
|
||||
)
|
||||
}
|
||||
|
||||
/** The venue's own colour as the accent of every screen when the venue chose it (6R.20, Settings →
|
||||
* Venue → "The venue's identity"); otherwise the screens keep their own accent. */
|
||||
function VenueAccent() {
|
||||
const venue = useAccess()?.venue
|
||||
const colour = venue?.theme === 'identity' ? venue?.identity?.colour : null
|
||||
useEffect(() => { applyVenueTheme(colour ? 'identity' : null, colour) }, [colour])
|
||||
return null
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<BrowserRouter>
|
||||
|
||||
Reference in New Issue
Block a user