mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
14 lines
482 B
TypeScript
14 lines
482 B
TypeScript
import { Dispatch } from 'redux';
|
|
import { applyPrimaryColor } from '../state/ducks/primaryColor';
|
|
import { COLORS, PrimaryColorStateType } from './colors';
|
|
|
|
export async function switchPrimaryColor(color: PrimaryColorStateType, dispatch: Dispatch | null) {
|
|
await window.Events.setPrimaryColorSetting(color);
|
|
|
|
document.documentElement.style.setProperty(
|
|
'--primary-color',
|
|
(COLORS.PRIMARY as any)[`${color.toUpperCase()}`]
|
|
);
|
|
dispatch?.(applyPrimaryColor(color));
|
|
}
|