make system panel reflect user prefs

This commit is contained in:
mulan xia
2024-02-01 15:07:54 -05:00
parent f111f54295
commit 3ec9c2442e
6 changed files with 8 additions and 7 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

+2 -2
View File
@@ -63,8 +63,8 @@ const MS_FOR_PERIOD = {
[HistoricalPnlPeriod.Period90d.name]: 90 * timeUnits.day,
};
const DARK_CHART_BACKGROUND_URL = '/Dots-dark.svg';
const LIGHT_CHART_BACKGROUND_URL = '/Dots-light.svg';
const DARK_CHART_BACKGROUND_URL = '/chart-dots-background-dark.svg';
const LIGHT_CHART_BACKGROUND_URL = '/chart-dots-background-light.svg';
type ElementProps = {
onTooltipContext?: (tooltipContext: TooltipContextType<PnlDatum>) => void;
+6 -5
View File
@@ -7,12 +7,13 @@ import { useStringGetter } from '@/hooks';
import {
AppTheme,
type AppThemeSetting,
AppThemeSystemSetting,
AppColorMode,
setAppThemeSetting,
setAppColorMode,
} from '@/state/configs';
import { getAppThemeSetting, getAppColorMode } from '@/state/configsSelectors';
import { getAppTheme, getAppThemeSetting, getAppColorMode } from '@/state/configsSelectors';
import { layoutMixins } from '@/styles/layoutMixins';
import { Themes } from '@/styles/themes';
@@ -33,7 +34,8 @@ export const DisplaySettingsDialog = ({ setIsOpen }: ElementProps) => {
const dispatch = useDispatch();
const stringGetter = useStringGetter();
const currentTheme: AppTheme = useSelector(getAppThemeSetting);
const currentThemeSetting: AppThemeSetting = useSelector(getAppThemeSetting);
const currentTheme: AppTheme = useSelector(getAppTheme);
const currentColorMode: AppColorMode = useSelector(getAppColorMode);
const sectionHeader = (heading: string) => {
@@ -47,7 +49,7 @@ export const DisplaySettingsDialog = ({ setIsOpen }: ElementProps) => {
const themePanels = () => {
return (
<Styled.AppThemeRoot value={currentTheme}>
<Styled.AppThemeRoot value={currentThemeSetting}>
{[
{
themeSetting: AppTheme.Classic,
@@ -66,8 +68,7 @@ export const DisplaySettingsDialog = ({ setIsOpen }: ElementProps) => {
label: STRING_KEYS.LIGHT,
},
].map(({ themeSetting, label }) => {
const theme =
themeSetting === AppThemeSystemSetting.System ? AppTheme.Dark : themeSetting;
const theme = themeSetting === AppThemeSystemSetting.System ? currentTheme : themeSetting;
const backgroundColor = Themes[theme][currentColorMode].layer2;
const gridColor = Themes[theme][currentColorMode].borderDefault;