-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat: high contrast feature #85197
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
Merged
Merged
feat: high contrast feature #85197
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
d07653d
feat: high contrast feature
truph01 17bf415
fix: lint
truph01 9ae478c
fix: remove redundant file
truph01 ccaa0a5
Merge branch 'Expensify:main' into feat/79228
truph01 66acabc
fix: update textLight color
truph01 2a8c795
fix: update bordersBold for composer
truph01 caecbb6
fix: apply AI suggestions
truph01 12694f9
fix: apply AI suggestion in useThemePreference.ts
truph01 81506c8
fix: remove useMemo
truph01 385d2c5
fix: apply AI suggestion and add test
truph01 23978e2
fix: prettier
truph01 4892937
Merge branch 'Expensify:main' into feat/79228
truph01 08e66b5
fix: update iconColorfulBackground for contrast themes
truph01 b144c7f
Merge branch 'Expensify:main' into feat/79228
truph01 008dc72
fix: remove updateThemeInPlace
truph01 3d007ad
Merge branch 'Expensify:main' into feat/79228
truph01 786bfba
fix: search route border color
truph01 373cc9c
fix: ThemePage UI
truph01 ee42377
fix: conflicts
truph01 69241a9
fix: conflicts
truph01 8a64f78
fix: update buttonSuccessText and textLight in dark contrast
truph01 454713d
Merge branch 'Expensify:main' into feat/79228
truph01 660d148
fix: update textSupporting: colors.productDark800
truph01 91bd7c0
Merge branch 'Expensify:main' into feat/79228
truph01 fe222c9
fix: update getEmojiReactionBubbleStyle background color
truph01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,24 @@ | ||
| import {useMemo} from 'react'; | ||
| import {useColorScheme} from 'react-native'; | ||
| import type {ThemePreferenceWithoutSystem} from '@styles/theme/types'; | ||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import useOnyx from './useOnyx'; | ||
|
|
||
| function useThemePreference() { | ||
| function useThemePreference(): ThemePreferenceWithoutSystem { | ||
| const [preferredThemeFromStorage] = useOnyx(ONYXKEYS.PREFERRED_THEME); | ||
| const systemTheme = useColorScheme(); | ||
|
|
||
| const themePreference = useMemo(() => { | ||
| const theme = preferredThemeFromStorage ?? CONST.THEME.DEFAULT; | ||
| const theme = preferredThemeFromStorage ?? CONST.THEME.DEFAULT; | ||
|
|
||
| // If the user chooses to use the device theme settings, set the theme preference to the system theme | ||
| return theme === CONST.THEME.SYSTEM ? ((systemTheme ?? CONST.THEME.FALLBACK) as 'light' | 'dark') : theme; | ||
| }, [preferredThemeFromStorage, systemTheme]); | ||
| if (theme === CONST.THEME.SYSTEM) { | ||
| return systemTheme === 'dark' ? CONST.THEME.DARK : CONST.THEME.LIGHT; | ||
| } | ||
|
|
||
| return themePreference; | ||
| if (theme === CONST.THEME.SYSTEM_CONTRAST) { | ||
| return systemTheme === 'dark' ? CONST.THEME.DARK_CONTRAST : CONST.THEME.LIGHT_CONTRAST; | ||
| } | ||
|
|
||
| return theme as ThemePreferenceWithoutSystem; | ||
| } | ||
|
|
||
| export default useThemePreference; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.