diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index 2448b80f..14bd92e7 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -651,6 +651,9 @@ "cache_cleared": "DNS cache successfully cleared", "clear_cache": "Clear cache", "make_static": "Make static", + "theme_auto_desc": "Auto (based on the color scheme of your device)", + "theme_dark_desc": "Dark theme", + "theme_light_desc": "Light theme", "disable_for_seconds": "For {{count}} second", "disable_for_seconds_plural": "For {{count}} seconds", "disable_for_minutes": "For {{count}} minute", diff --git a/client/src/components/Settings/Settings.css b/client/src/components/Settings/Settings.css index ba6d2462..0db0fb65 100644 --- a/client/src/components/Settings/Settings.css +++ b/client/src/components/Settings/Settings.css @@ -22,6 +22,14 @@ margin-bottom: 25px; } +.form__group--inner .form__group--checkbox { + margin-bottom: 12px; +} + +.form__group--inner .form__group--checkbox:last-child { + margin-bottom: 0; +} + .form__inline { display: flex; justify-content: flex-start; diff --git a/client/src/components/Toasts/Toast.css b/client/src/components/Toasts/Toast.css index 7b4d3bcc..8677aab6 100644 --- a/client/src/components/Toasts/Toast.css +++ b/client/src/components/Toasts/Toast.css @@ -54,6 +54,11 @@ cursor: pointer; } +.toast__dismiss:hover, +.toast__dismiss:focus { + outline: none; +} + .toast-enter { opacity: 0.01; } diff --git a/client/src/components/ui/Footer.css b/client/src/components/ui/Footer.css index fd0dca2b..428fe97a 100644 --- a/client/src/components/ui/Footer.css +++ b/client/src/components/ui/Footer.css @@ -71,3 +71,38 @@ margin: 0 20px 0 0; } } + +.btn-secondary.footer__theme-button, +[data-theme="dark"] .btn-secondary.footer__theme-button { + height: 38px; + border-color: var(--ctrl-select-bgcolor); +} + +.footer__theme-icon { + display: inline-block; + vertical-align: middle; + width: 24px; + height: 24px; + color: var(--gray-ac); +} + +[data-theme="dark"] .footer__theme-icon { + color: var(--mcolor); +} + +.footer__theme-icon--active, +[data-theme="dark"] .footer__theme-icon--active { + color: var(--btn-success-bgcolor); +} + +.footer__themes { + margin: 0 auto 24px; + text-align: center; +} + +@media screen and (min-width: 768px) { + .footer__themes { + margin: 0; + text-align: left; + } +} diff --git a/client/src/components/ui/Footer.js b/client/src/components/ui/Footer.js index 3ac6aa61..014c8fd1 100644 --- a/client/src/components/ui/Footer.js +++ b/client/src/components/ui/Footer.js @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { useDispatch, useSelector } from 'react-redux'; -import classNames from 'classnames'; +import cn from 'classnames'; import { REPOSITORY, PRIVACY_POLICY_LINK, THEMES } from '../../helpers/constants'; import { LANGUAGES } from '../../helpers/twosky'; @@ -55,15 +55,13 @@ const Footer = () => { setHtmlLangAttr(value); }; - const onThemeChanged = (event) => { - const { value } = event.target; - dispatch(changeTheme(value)); - }; - - const onThemeChangedLocal = (event) => { - const { value } = event.target; - setUITheme(value); - setCurrentThemeLocal(value); + const onThemeChange = (value) => { + if (isLoggedIn) { + dispatch(changeTheme(value)); + } else { + setUITheme(value); + setCurrentThemeLocal(value); + } }; const renderCopyright = () =>