From dfcedf121ef824598d0f5258219211652f798342 Mon Sep 17 00:00:00 2001 From: Yahav Sofer <65678438+YahavSofer@users.noreply.github.com> Date: Thu, 25 Jan 2024 06:18:06 +0200 Subject: [PATCH] fix: scrollbar color on dark mode (#431) --- src/layout/ThemeContext.tsx | 5 ++++- src/layout/header/ToggleThemeButton.tsx | 7 +++++++ src/locale/en.json | 2 ++ src/locale/he.json | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/layout/ThemeContext.tsx b/src/layout/ThemeContext.tsx index 42854bbd..6e59afd7 100644 --- a/src/layout/ThemeContext.tsx +++ b/src/layout/ThemeContext.tsx @@ -1,6 +1,7 @@ // ThemeContext.js import React, { FC, PropsWithChildren, createContext, useContext, useState } from 'react' import { ThemeProvider as MuiThemeProvider, createTheme } from '@mui/material/styles' +import ScopedCssBaseline from '@mui/material/ScopedCssBaseline' import { ConfigProvider, theme } from 'antd' import heIL from 'antd/es/locale/he_IL' import { useTranslation } from 'react-i18next' @@ -44,7 +45,9 @@ export const ThemeProvider: FC = ({ children }) => { algorithm: isDarkTheme ? darkAlgorithm : defaultAlgorithm, }}> - {children} + + {children} + ) diff --git a/src/layout/header/ToggleThemeButton.tsx b/src/layout/header/ToggleThemeButton.tsx index 8dd4c849..d62bfbb6 100644 --- a/src/layout/header/ToggleThemeButton.tsx +++ b/src/layout/header/ToggleThemeButton.tsx @@ -1,4 +1,5 @@ import React from 'react' +import { useTranslation } from 'react-i18next' import { BulbFilled, BulbOutlined } from '@ant-design/icons' interface ToggleThemeButtonProps { @@ -7,10 +8,16 @@ interface ToggleThemeButtonProps { } const ToggleThemeButton: React.FC = ({ toggleTheme, isDarkTheme }) => { + const { t } = useTranslation() + + const tooltip_title = isDarkTheme ? t('light_mode_tooltip') : t('dark_mode_tooltip') + return (