Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat 🎨 Improve theme setting #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion features/appSettings/components/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ export function AppSettingsContainer({ title, children }: AppSettingsContainerPr
marginH-s4
text90L
$textDefault
marginB-s1
style={{ textTransform: 'uppercase' }}
>
{title}
</Text>
)}
<Card marginH-s2 enableShadow={false}>
<Card marginH-s2 enableShadow={false} marginB-s6>
{children}
<View height={1} bg-$backgroundNeutral />
</Card>
Expand Down
26 changes: 14 additions & 12 deletions features/theme/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,25 @@ export function createTheme({

return (
<AppSettingsContainer title="Theme">
<View row gap-s2 padding-s2>
{Object.entries(availableSchemes).map(([name, themeScheme]) => (
<ThemeSettingsButton
key={name}
name={name as 'light' | 'dark'}
theme={themeScheme}
isActive={scheme === name}
onPress={changeTheme}
/>
))}
</View>
<AppSettingsEntrySwitch
field="ignoreSystemMode"
title="Ignore system mode?"
title="Override system theme?"
value={ignoreSystemMode}
dispatch={dispatch}
/>
{ignoreSystemMode && (
<View row gap-s2 padding-s2>
{Object.entries(availableSchemes).map(([name, themeScheme]) => (
<ThemeSettingsButton
key={name}
name={name as 'light' | 'dark'}
theme={themeScheme}
isActive={scheme === name}
onPress={changeTheme}
/>
))}
</View>
)}
</AppSettingsContainer>
);
}
Expand Down