mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
ui: theme picker in Settings, and ship the component gallery
The gallery at /theme-sample is now a normal route rather than a development one, and Settings links to it, so a user can see what a theme actually looks like before committing to it. Every new component belongs in the gallery: it is how the design gets reviewed, and how a component that only looks wrong in one of the four themes gets caught. Settings gains a Theme section with the new ThemePicker, which explains what each theme is for - notably that night mode filters videos, documents and maps to red as well, not just the interface. Theme names and picker options move to themes/names.ts so the component library can read them without importing components/Theme.tsx, which still pulls in Semantic UI. Theme.tsx re-exports them, so existing call sites are unchanged. The navigation bar's compact picker now reads the same list, so the two cannot drift apart. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
1bf8ea3da8
commit
ea50ee2f16
10 changed files with 290 additions and 52 deletions
|
|
@ -29,6 +29,26 @@ import {toast} from "react-semantic-toasts-2";
|
|||
import Grid from "semantic-ui-react/dist/commonjs/collections/Grid";
|
||||
import {ConfigsTable} from "./Configs";
|
||||
import {semanticUIColorMap} from "../Vars";
|
||||
import {Link} from "react-router";
|
||||
import {ThemePicker} from "../ui";
|
||||
|
||||
function ThemeSegment() {
|
||||
return <Segment>
|
||||
<Header as='h2'>Theme</Header>
|
||||
<p>Choose how WROLPi looks. The choice is saved in this browser, so each device can
|
||||
differ.</p>
|
||||
|
||||
<ThemePicker/>
|
||||
|
||||
<Divider/>
|
||||
|
||||
<Header as='h3'>Preview</Header>
|
||||
<p>See every part of the interface in the theme you picked.</p>
|
||||
<Link to='/theme-sample'>
|
||||
<Button><Icon name='eye'/> View the components</Button>
|
||||
</Link>
|
||||
</Segment>;
|
||||
}
|
||||
|
||||
export function ShutdownButton() {
|
||||
const dockerized = useDockerized();
|
||||
|
|
@ -914,6 +934,8 @@ export function SettingsPage() {
|
|||
{body}
|
||||
</Segment>
|
||||
|
||||
<ThemeSegment/>
|
||||
|
||||
{configsSegment}
|
||||
|
||||
<UpgradeSegment/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue