Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

feat: add tooltip on toggle theme button #45

Merged
merged 1 commit into from
Sep 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions src/layout/header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AppBar, Button, Link, Theme, Toolbar } from "@material-ui/core";
import Box from "@material-ui/core/Box";
import Tooltip from "@material-ui/core/Tooltip";
import useMediaQuery from "@material-ui/core/useMediaQuery";
import Brightness4Icon from "@material-ui/icons/Brightness4";
import Brightness7Icon from "@material-ui/icons/Brightness7";
Expand Down Expand Up @@ -92,17 +93,21 @@ const Header: FC<HeaderProps> = ({ onToggleTheme, theme }) => {
>
Co-créez Archifiltre
</Button>
<Button
color="inherit"
onClick={onToggleTheme}
aria-label="Thème clair/sombre"
<Tooltip
title={theme === "light" ? "Thème sombre" : "Thème clair"}
>
{theme === "light" ? (
<Brightness4Icon />
) : (
<Brightness7Icon />
)}
</Button>
<Button
color="inherit"
onClick={onToggleTheme}
aria-label="Thème clair/sombre"
>
{theme === "light" ? (
<Brightness4Icon />
) : (
<Brightness7Icon />
)}
</Button>
</Tooltip>
</>
)}
</Toolbar>
Expand Down