PromucFlow_constructor/app/client/src/selectors/themeSelectors.tsx
arunvjn 4fcfe07c67
fix: snippets UI (#7173)
Changes to snippets tab color and removed play icon on snippet.
2021-09-07 05:21:07 +00:00

27 lines
927 B
TypeScript

import { AppState } from "reducers";
import { dark, light, Theme, theme } from "constants/DefaultTheme";
export enum ThemeMode {
LIGHT = "LIGHT",
DARK = "DARK",
}
export const lightTheme = { ...theme, colors: { ...theme.colors, ...light } };
const darkTheme = { ...theme, colors: { ...theme.colors, ...dark } };
// Only for usage with ThemeProvider
export const getThemeDetails = (state: AppState, themeMode: ThemeMode): Theme =>
themeMode === ThemeMode.LIGHT ? lightTheme : darkTheme;
// Use to get the current theme of the app set via the theme switcher
export const getCurrentThemeDetails = (state: AppState): Theme =>
state.ui.theme.theme;
// Use to get the current theme mode of the app set via the theme switcher
export const getCurrentThemeMode = (state: AppState) => state.ui.theme.mode;
export const getAppCardColorPalette = (state: AppState) => {
return state.ui.theme.theme.colors.appCardColors;
};