Migrate Traefik Proxy dashboard UI to React
This commit is contained in:
parent
4790e4910f
commit
f16fff577a
324 changed files with 28303 additions and 19567 deletions
29
webui/src/components/ThemeSwitcher.tsx
Normal file
29
webui/src/components/ThemeSwitcher.tsx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import { AccessibleIcon, Button } from '@traefiklabs/faency'
|
||||
import { FiMoon, FiSun } from 'react-icons/fi'
|
||||
|
||||
import { AutoThemeIcon } from 'components/icons/AutoThemeIcon'
|
||||
import { useTheme } from 'hooks/use-theme'
|
||||
|
||||
export default function ThemeSwitcher() {
|
||||
const { selectedTheme, setTheme } = useTheme()
|
||||
|
||||
return (
|
||||
<Button
|
||||
ghost
|
||||
css={{ px: '$2', color: '$buttonSecondaryText' }}
|
||||
onClick={setTheme}
|
||||
type="button"
|
||||
data-testid="theme-switcher"
|
||||
>
|
||||
<AccessibleIcon label="toggle theme">
|
||||
{selectedTheme === 'dark' ? (
|
||||
<FiMoon size={20} />
|
||||
) : selectedTheme === 'light' ? (
|
||||
<FiSun size={20} />
|
||||
) : (
|
||||
<AutoThemeIcon />
|
||||
)}
|
||||
</AccessibleIcon>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue