Pull request: fix missing icons on login page
Updates #5620
Squashed commit of the following:
commit 61969c83c3dd6bd6688f0aabc9d6160b53701866
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:50:47 2023 +0300
AG-20691 fix theme select on login page
commit c87b6c37284021f33f440dcd31be5b653e8e689d
Merge: aa744756 89bf3721
Author: Ildar Kamalov <ik@adguard.com>
Date: Mon Apr 10 14:21:01 2023 +0300
Merge branch 'master' into AG-20691
commit aa744756d18d9ed3bc7f60108235d8403e7cb5e0
Author: Ildar Kamalov <ik@adguard.com>
Date: Fri Apr 7 15:53:38 2023 +0300
AG-20691 fix missing icons on login page
This commit is contained in:
@@ -33,14 +33,18 @@ const Footer = () => {
|
||||
const { t } = useTranslation();
|
||||
const dispatch = useDispatch();
|
||||
|
||||
const currentTheme = useSelector((state) => (state.dashboard ? state.dashboard.theme : 'auto'));
|
||||
const profileName = useSelector((state) => (state.dashboard ? state.dashboard.name : ''));
|
||||
const currentTheme = useSelector((state) => (
|
||||
state.dashboard ? state.dashboard.theme : THEMES.auto
|
||||
));
|
||||
const profileName = useSelector((state) => (
|
||||
state.dashboard ? state.dashboard.name : ''
|
||||
));
|
||||
const isLoggedIn = profileName !== '';
|
||||
const [currentThemeLocal, setCurrentThemeLocal] = useState('auto');
|
||||
const [currentThemeLocal, setCurrentThemeLocal] = useState(THEMES.auto);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLoggedIn) {
|
||||
setUITheme(window.matchMedia('(prefers-color-scheme: dark)').matches ? THEMES.dark : THEMES.light);
|
||||
setUITheme(currentThemeLocal);
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user