Skip to content

Commit

Permalink
feat(native-app): disable dark mode (#15469)
Browse files Browse the repository at this point in the history
* feat: disable dark mode

* feat: remove accessibility group and move locale to bottom group

* fix: remove appearance mode

* fix: keep defaultPreference to automatic in case we want to implement dark mode again later

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
thoreyjona and kodiakhq[bot] authored Jul 11, 2024
1 parent 2914148 commit 5605cd7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 72 deletions.
82 changes: 13 additions & 69 deletions apps/native/app/src/screens/settings/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ export const SettingsScreen: NavigationFunctionComponent = ({
locale,
setLocale,
hasAcceptedBiometrics,
appearanceMode,
setAppearanceMode,
useBiometrics,
setUseBiometrics,
appLockTimeout,
Expand Down Expand Up @@ -388,73 +386,7 @@ export const SettingsScreen: NavigationFunctionComponent = ({
}
/>
</TableViewGroup>
<TableViewGroup
header={intl.formatMessage({
id: 'settings.accessibilityLayout.groupTitle',
})}
>
<TableViewCell
title={intl.formatMessage({
id: 'settings.accessibilityLayout.sytemDarkMode',
})}
accessory={
<Switch
onValueChange={(value) => {
setAppearanceMode(value ? 'automatic' : 'light')
}}
value={appearanceMode === 'automatic'}
thumbColor={Platform.select({ android: theme.color.dark100 })}
trackColor={{
false: theme.color.dark200,
true: theme.color.blue400,
}}
/>
}
/>
<Pressable
onPress={() => {
clearTimeout(efficient.ts)
efficient.count = (efficient.count ?? 0) + 1
if (efficient.count === 11) {
setAppearanceMode('efficient')
}
efficient.ts = setTimeout(() => {
efficient.count = 0
}, 500)
}}
>
<TableViewCell
title={intl.formatMessage({
id: 'settings.accessibilityLayout.darkMode',
})}
accessory={
<Switch
onValueChange={(value) =>
setAppearanceMode(value ? 'dark' : 'light')
}
value={appearanceMode === 'dark'}
thumbColor={Platform.select({ android: theme.color.dark100 })}
trackColor={{
false: theme.color.dark200,
true: theme.color.blue400,
}}
/>
}
/>
</Pressable>
<PressableHighlight onPress={onLanguagePress}>
<TableViewCell
title={intl.formatMessage({
id: 'settings.accessibilityLayout.language',
})}
accessory={
<TableViewAccessory>
{locale === 'is-IS' ? 'Íslenska' : 'English'}
</TableViewAccessory>
}
/>
</PressableHighlight>
</TableViewGroup>

<TableViewGroup
header={intl.formatMessage({
id: 'settings.security.groupTitle',
Expand Down Expand Up @@ -661,6 +593,18 @@ export const SettingsScreen: NavigationFunctionComponent = ({
<TableViewGroup
header={intl.formatMessage({ id: 'settings.about.groupTitle' })}
>
<PressableHighlight onPress={onLanguagePress}>
<TableViewCell
title={intl.formatMessage({
id: 'settings.accessibilityLayout.language',
})}
accessory={
<TableViewAccessory>
{locale === 'is-IS' ? 'Íslenska' : 'English'}
</TableViewAccessory>
}
/>
</PressableHighlight>
<TableViewCell
title={intl.formatMessage({ id: 'settings.about.versionLabel' })}
subtitle={`${DeviceInfo.getVersion()} build ${DeviceInfo.getBuildNumber()}`}
Expand Down
9 changes: 6 additions & 3 deletions apps/native/app/src/utils/get-theme-with-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ export function getThemeWithPreferences(
) {
// get color scheme from system if "automatic"
// otherwise from appearanceMode
const colorScheme = (
appearanceMode === 'automatic' ? systemScheme : appearanceMode
) as ThemeMode
// const colorScheme = (
// appearanceMode === 'automatic' ? systemScheme : appearanceMode
// ) as ThemeMode

// Force light mode for now until we have a proper dark mode
const colorScheme = 'light' as ThemeMode

// find correct shades key
const themeKey =
Expand Down

0 comments on commit 5605cd7

Please sign in to comment.