Skip to content

Commit e4d2e7b

Browse files
MelvinBotsituchan
andcommitted
Replace magic string contrast check with explicit theme constants
Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
1 parent f701508 commit e4d2e7b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/pages/signin/SignInPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,8 @@ function SignInPageWrapper({ref}: SignInPageProps) {
360360
function WithTheme(Component: React.ComponentType<SignInPageProps>) {
361361
function ThemedComponent({ref}: SignInPageProps) {
362362
const [preferredTheme] = useOnyx(ONYXKEYS.PREFERRED_THEME);
363-
const signInTheme = preferredTheme?.endsWith('-contrast') ? CONST.THEME.DARK_CONTRAST : CONST.THEME.DARK;
363+
const contrastThemes: string[] = [CONST.THEME.DARK_CONTRAST, CONST.THEME.LIGHT_CONTRAST, CONST.THEME.SYSTEM_CONTRAST];
364+
const signInTheme = contrastThemes.includes(preferredTheme ?? '') ? CONST.THEME.DARK_CONTRAST : CONST.THEME.DARK;
364365

365366
return (
366367
<ThemeProvider theme={signInTheme}>

0 commit comments

Comments
 (0)