-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1e8b97
commit 2b396c8
Showing
12 changed files
with
64 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{ | ||
"previousChallenge": "Previous challenge", | ||
"nextChallenge": "Next challenge" | ||
"nextChallenge": "Next challenge", | ||
"lightThemeMode": "Light theme mode on", | ||
"darkThemeMode": "Dark theme mode on", | ||
"simpleReadModeOn": "Simple read mode on", | ||
"simpleReadModeOff": "Simple read mode off" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{ | ||
"previousChallenge": "Desafío anterior", | ||
"nextChallenge": "Desafío siguiente" | ||
"nextChallenge": "Desafío siguiente", | ||
"lightThemeMode": "Activar modo claro", | ||
"darkThemeMode": "Activar modo oscuro", | ||
"simpleReadModeOn": "Activar modo de lectura simple", | ||
"simpleReadModeOff": "Desactivar modo de lectura simple" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
{ | ||
"previousChallenge": "Desafio anterior", | ||
"nextChallenge": "Próximo desafio" | ||
"nextChallenge": "Próximo desafio", | ||
"lightThemeMode": "Ativar tema claro", | ||
"darkThemeMode": "Ativar tema escuro", | ||
"simpleReadModeOn": "Ativar o modo de leitura simple", | ||
"simpleReadModeOff": "Desativar o modo de leitura simples" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
import { Tooltip } from "@mui/material"; | ||
import { DarkMode, LightMode } from "@mui/icons-material"; | ||
import { PBSwitch } from "../PBSwitch"; | ||
import { PBSwitch, pbIconStyle } from "../PBSwitch"; | ||
import { useTranslation } from "react-i18next" | ||
import { useThemeContext } from "../../theme/ThemeContext"; | ||
|
||
export const DarkModeSwitch = () => { | ||
const { darkModeEnabled, setDarkModeEnabled} = useThemeContext() | ||
|
||
const iconSx = { | ||
backgroundColor: 'white', | ||
borderRadius: 10, | ||
padding: '3px', | ||
color: 'gray' | ||
} | ||
const { theme, darkModeEnabled, setDarkModeEnabled} = useThemeContext() | ||
const { t } = useTranslation("others") | ||
|
||
const handleToggle = () => { | ||
setDarkModeEnabled(!darkModeEnabled) | ||
} | ||
|
||
return <PBSwitch | ||
checked={darkModeEnabled} | ||
icon={<LightMode sx={iconSx} />} | ||
checkedIcon={<DarkMode sx={iconSx} />} | ||
onChange={handleToggle} | ||
/> | ||
|
||
return <Tooltip title={darkModeEnabled ? t(`lightThemeMode`) : t(`darkThemeMode`) }> | ||
<PBSwitch | ||
checked={darkModeEnabled} | ||
icon={<LightMode sx={pbIconStyle(theme)}/>} | ||
checkedIcon={<DarkMode sx={pbIconStyle(theme)}/>} | ||
onChange={handleToggle}/> | ||
</Tooltip> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
import { Icon } from "@mui/material"; | ||
import { PBSwitch } from "../PBSwitch"; | ||
import { Icon, Tooltip } from "@mui/material"; | ||
import { PBSwitch, pbIconStyle } from "../PBSwitch"; | ||
import { useTranslation } from "react-i18next" | ||
import { useThemeContext } from "../../theme/ThemeContext"; | ||
|
||
export const SimpleReadSwitch = () => { | ||
const { simpleReadModeEnabled, setSimpleReadModeEnabled} = useThemeContext() | ||
|
||
const iconSx = { | ||
backgroundColor: 'white', | ||
borderRadius: 10, | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
color: 'gray' | ||
} | ||
const { theme, simpleReadModeEnabled, setSimpleReadModeEnabled} = useThemeContext() | ||
const { t } = useTranslation("others") | ||
|
||
const handleToggle = () => { | ||
setSimpleReadModeEnabled(!simpleReadModeEnabled) | ||
} | ||
|
||
return <PBSwitch | ||
checked={simpleReadModeEnabled} | ||
icon={<Icon sx={iconSx}>a</Icon>} | ||
checkedIcon={<Icon sx={iconSx}>A</Icon>} | ||
onChange={handleToggle} | ||
/> | ||
return <Tooltip title={simpleReadModeEnabled ? t(`simpleReadModeOff`) : t(`simpleReadModeOn`)}> | ||
<PBSwitch | ||
checked={simpleReadModeEnabled} | ||
icon={<Icon sx={pbIconStyle(theme)}>a</Icon>} | ||
checkedIcon={<Icon sx={pbIconStyle(theme)}>A</Icon>} | ||
onChange={handleToggle}/> | ||
</Tooltip> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters