diff --git a/preload.js b/preload.js index df422ebec..5a46a4120 100644 --- a/preload.js +++ b/preload.js @@ -157,8 +157,8 @@ ipc.on('get-theme-setting', () => { window.getSettingValue = (settingID, comparisonValue = null) => { // Comparison value allows you to pull boolean values from any type. - // Eg. window.getSettingValue('theme', 'light') - // returns 'false' when the value is 'dark'. + // Eg. window.getSettingValue('theme', 'classic-dark') + // returns 'false' when the value is 'classic-light'. // We need to get specific settings from the main process if (settingID === 'media-permissions') { diff --git a/stylesheets/_session_signin.scss b/stylesheets/_session_signin.scss index f173a0805..0b0de2daf 100644 --- a/stylesheets/_session_signin.scss +++ b/stylesheets/_session_signin.scss @@ -3,6 +3,7 @@ width: 100%; height: 100%; background-color: var(--background-primary-color); + color: var(--text-primary-color); } &-content { &-accent { diff --git a/ts/components/conversation/SessionEmojiPanel.tsx b/ts/components/conversation/SessionEmojiPanel.tsx index e06cc55e6..e3dffaf1b 100644 --- a/ts/components/conversation/SessionEmojiPanel.tsx +++ b/ts/components/conversation/SessionEmojiPanel.tsx @@ -114,15 +114,15 @@ export const SessionEmojiPanel = forwardRef((props: Props setPanelBackgroundRGB(hexColorToRGB(THEMES.OCEAN_LIGHT.COLOR7!)); setPanelTextRGB(hexColorToRGB(THEMES.OCEAN_LIGHT.COLOR1)); break; - case 'classic-dark': - setPanelBackgroundRGB(hexColorToRGB(THEMES.CLASSIC_DARK.COLOR1)); - setPanelTextRGB(hexColorToRGB(THEMES.CLASSIC_DARK.COLOR6)); - break; case 'classic-light': - default: setPanelBackgroundRGB(hexColorToRGB(THEMES.CLASSIC_LIGHT.COLOR6)); setPanelTextRGB(hexColorToRGB(THEMES.CLASSIC_LIGHT.COLOR0)); break; + case 'classic-dark': + default: + setPanelBackgroundRGB(hexColorToRGB(THEMES.CLASSIC_DARK.COLOR1)); + setPanelTextRGB(hexColorToRGB(THEMES.CLASSIC_DARK.COLOR6)); + break; } }, [theme]); diff --git a/ts/components/registration/SessionRegistrationView.tsx b/ts/components/registration/SessionRegistrationView.tsx index c3b17e913..0e1e24b4b 100644 --- a/ts/components/registration/SessionRegistrationView.tsx +++ b/ts/components/registration/SessionRegistrationView.tsx @@ -13,9 +13,9 @@ export const SessionRegistrationView = () => { void setSignInByLinking(false); }, []); return ( -
-
- + +
+
{ - +
-
+ ); }; diff --git a/ts/mains/main_renderer.tsx b/ts/mains/main_renderer.tsx index 26a45542f..4c3ca8df4 100644 --- a/ts/mains/main_renderer.tsx +++ b/ts/mains/main_renderer.tsx @@ -21,6 +21,7 @@ import { OpenGroupData } from '../data/opengroups'; import { loadKnownBlindedKeys } from '../session/apis/open_group_api/sogsv3/knownBlindedkeys'; import nativeEmojiData from '@emoji-mart/data'; import { initialiseEmojiData } from '../util/emoji'; +import { switchPrimaryColorTo } from '../themes/switchPrimaryColor'; // tslint:disable: max-classes-per-file // Globally disable drag and drop @@ -100,7 +101,7 @@ function mapOldThemeToNew(theme: string) { case 'android': case 'ios': case '': - return 'classic-light'; + return 'classic-dark'; default: return theme; } @@ -130,7 +131,7 @@ Storage.onready(async () => { setPrimaryColorSetting: async (value: any) => { await Storage.put('primary-color-setting', value); }, - getThemeSetting: () => Storage.get('theme-setting', 'classic-light'), + getThemeSetting: () => Storage.get('theme-setting', 'classic-dark'), setThemeSetting: async (value: any) => { await Storage.put('theme-setting', value); }, @@ -268,6 +269,8 @@ async function start() { await connect(); openInbox(); } else { + const primaryColor = window.Events.getPrimaryColorSetting(); + await switchPrimaryColorTo(primaryColor); openStandAlone(); } diff --git a/ts/state/ducks/theme.tsx b/ts/state/ducks/theme.tsx index 54edce7ef..389bc44a1 100644 --- a/ts/state/ducks/theme.tsx +++ b/ts/state/ducks/theme.tsx @@ -9,7 +9,7 @@ export const applyTheme = (theme: ThemeStateType) => { }; }; -export const initialThemeState: ThemeStateType = 'classic-light'; +export const initialThemeState: ThemeStateType = 'classic-dark'; export const reducer = ( state: any = initialThemeState, diff --git a/ts/themes/SessionTheme.tsx b/ts/themes/SessionTheme.tsx index 9806360cc..725baca17 100644 --- a/ts/themes/SessionTheme.tsx +++ b/ts/themes/SessionTheme.tsx @@ -1,14 +1,14 @@ import React from 'react'; import { createGlobalStyle } from 'styled-components'; -import { classicLight } from './'; +import { classicDark } from './'; import { declareCSSVariables, THEME_GLOBALS } from './globals'; // Defaults to Classic Dark theme export const SessionGlobalStyles = createGlobalStyle` html { ${declareCSSVariables(THEME_GLOBALS)} - ${declareCSSVariables(classicLight)} + ${declareCSSVariables(classicDark)} }; `; diff --git a/ts/themes/switchPrimaryColor.tsx b/ts/themes/switchPrimaryColor.tsx index 5f74004c9..b26de350c 100644 --- a/ts/themes/switchPrimaryColor.tsx +++ b/ts/themes/switchPrimaryColor.tsx @@ -8,10 +8,7 @@ export function findPrimaryColorId(hexCode: string): PrimaryColorStateType | und return find(primaryColors, { color: hexCode })?.id; } -export async function switchPrimaryColorTo( - color: PrimaryColorStateType, - dispatch: Dispatch | null -) { +export async function switchPrimaryColorTo(color: PrimaryColorStateType, dispatch?: Dispatch) { await window.Events.setPrimaryColorSetting(color); document.documentElement.style.setProperty(