-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31636 from margelo/@chrispader/dark-sign-in-page
`SignInPage` always dark mode
- Loading branch information
Showing
7 changed files
with
67 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import CONST from '@src/CONST'; | ||
import darkTheme from './default'; | ||
import lightTheme from './light'; | ||
import {ThemeColors, ThemePreferenceWithoutSystem} from './types'; | ||
|
||
const Themes = { | ||
[CONST.THEME.LIGHT]: lightTheme, | ||
[CONST.THEME.DARK]: darkTheme, | ||
} satisfies Record<ThemePreferenceWithoutSystem, ThemeColors>; | ||
|
||
export default Themes; |
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {ThemePreferenceWithoutSystem} from './types'; | ||
import useThemePreference from './useThemePreference'; | ||
|
||
const useThemePreferenceWithStaticOverride = (staticThemePreference: ThemePreferenceWithoutSystem | undefined) => { | ||
const dynamicThemePreference = useThemePreference(); | ||
|
||
// If the "theme" prop is provided, we'll want to use a hardcoded/static theme instead of the currently selected dynamic theme | ||
// This is used for example on the "SignInPage", because it should always display in dark mode. | ||
const themePreference = staticThemePreference ?? dynamicThemePreference; | ||
|
||
return themePreference; | ||
}; | ||
|
||
export default useThemePreferenceWithStaticOverride; |