pull/1151/merge
Asraye 2025-09-14 17:33:19 +00:00 committed by GitHub
commit ae7959b5b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 3 deletions

View File

@ -22,20 +22,24 @@ export const ShimThemeBaseSelector = observer(() => {
<ThemeBaseSelector <ThemeBaseSelector
value={theme.isModified() ? undefined : theme.getBase()} value={theme.isModified() ? undefined : theme.getBase()}
setValue={(base) => { setValue={(base) => {
const customVars = { ...theme.getCustomVariables() };
theme.setBase(base); theme.setBase(base);
theme.reset(); Object.entries(customVars).forEach(([key, value]) => {
theme.setVariable(key, value);
});
}} }}
/> />
); );
}); });
export default function ThemeSelection() { export default observer(function ThemeSelection() {
const theme = useApplicationState().settings.theme; const theme = useApplicationState().settings.theme;
return ( return (
<> <>
{/** Allow users to change base theme */} {/** Allow users to change base theme */}
<ShimThemeBaseSelector /> <ShimThemeBaseSelector />
{/** Provide a link to the theme shop */} {/** Provide a link to the theme shop */}
<Link to="/discover/themes" replace> <Link to="/discover/themes" replace>
<CategoryButton <CategoryButton
@ -47,10 +51,12 @@ export default function ThemeSelection() {
<Text id="app.settings.pages.appearance.discover.title" /> <Text id="app.settings.pages.appearance.discover.title" />
</CategoryButton> </CategoryButton>
</Link> </Link>
<hr /> <hr />
<h3> <h3>
<Text id="app.settings.pages.appearance.accent_selector" /> <Text id="app.settings.pages.appearance.accent_selector" />
</h3> </h3>
<ObservedInputElement <ObservedInputElement
type="colour" type="colour"
value={theme.getVariable("accent")} value={theme.getVariable("accent")}
@ -61,4 +67,4 @@ export default function ThemeSelection() {
/> />
</> </>
); );
} });