Skip to content

Commit

Permalink
Danilo's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
zanivan committed May 29, 2024
1 parent a691f09 commit 6658704
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function ChartUserByCountry() {
return (
<Card variant="outlined" sx={{ pb: '8px' }}>
<CardContent>
<Typography variant="subtitle2" component="p">
<Typography component="h2" variant="subtitle2">
Users by country
</Typography>
<Box sx={{ display: 'flex', alignItems: 'center' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function ChartUserByCountry() {
return (
<Card variant="outlined" sx={{ pb: '8px' }}>
<CardContent>
<Typography variant="subtitle2" component="p">
<Typography component="h2" variant="subtitle2">
Users by country
</Typography>
<Box sx={{ display: 'flex', alignItems: 'center' }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default function CustomizedTreeView() {
sx={{ display: 'flex', flexDirection: 'column', gap: '8px' }}
>
<CardContent>
<Typography variant="subtitle2" component="p">
<Typography component="h2" variant="subtitle2">
Product tree
</Typography>
<RichTreeView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default function CustomizedTreeView() {
sx={{ display: 'flex', flexDirection: 'column', gap: '8px' }}
>
<CardContent>
<Typography variant="subtitle2" component="p">
<Typography component="h2" variant="subtitle2">
Product tree
</Typography>
<RichTreeView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import Badge from '@mui/material/Badge';
import IconButton from '@mui/material/IconButton';

function MenuButton({ showBadge = false, ariaLabel, ...props }) {
function MenuButton({ showBadge = false, ...props }) {
return (
<Badge
color="error"
Expand All @@ -13,13 +13,12 @@ function MenuButton({ showBadge = false, ariaLabel, ...props }) {
'& .MuiBadge-badge': { right: 2, top: 2 },
}}
>
<IconButton size="small" aria-label={ariaLabel} {...props} />
<IconButton size="small" {...props} />
</Badge>
);
}

MenuButton.propTypes = {
ariaLabel: PropTypes.string,
showBadge: PropTypes.bool,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ import IconButton, { IconButtonProps } from '@mui/material/IconButton';

interface StyledMenuButtonProps extends IconButtonProps {
showBadge?: boolean;
ariaLabel?: string;
}

export default function MenuButton({
showBadge = false,
ariaLabel,
...props
}: StyledMenuButtonProps) {
return (
Expand All @@ -21,7 +19,7 @@ export default function MenuButton({
'& .MuiBadge-badge': { right: 2, top: 2 },
}}
>
<IconButton size="small" aria-label={ariaLabel} {...props} />
<IconButton size="small" {...props} />
</Badge>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function Navbar({ mode, toggleColorMode }) {
>
<NavbarBreadcrumbs />
<Stack direction="row" gap={1}>
<MenuButton showBadge ariaLabel="Notification menu button">
<MenuButton showBadge aria-label="Open notifications">
<NotificationsRoundedIcon />
</MenuButton>
<OptionsMenu />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function Navbar({ mode, toggleColorMode }: NavBarProps) {
>
<NavbarBreadcrumbs />
<Stack direction="row" gap={1}>
<MenuButton showBadge ariaLabel="Notification menu button">
<MenuButton showBadge aria-label="Open notifications">
<NotificationsRoundedIcon />
</MenuButton>
<OptionsMenu />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function OptionsMenu() {
};
return (
<React.Fragment>
<MenuButton ariaLabel="Options menu button" onClick={handleClick}>
<MenuButton aria-label="Open menu" onClick={handleClick}>
<MoreVertRoundedIcon />
</MenuButton>
<Menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function OptionsMenu() {
};
return (
<React.Fragment>
<MenuButton ariaLabel="Options menu button" onClick={handleClick}>
<MenuButton aria-label="Open menu" onClick={handleClick}>
<MoreVertRoundedIcon />
</MenuButton>
<Menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function PageViewsBarChart() {
return (
<Card variant="outlined" sx={{ width: '100%' }}>
<CardContent>
<Typography variant="subtitle2" component="h2" gutterBottom>
<Typography component="h2" variant="subtitle2" gutterBottom>
Page views and downloads
</Typography>
<BarChart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function PageViewsBarChart() {
return (
<Card variant="outlined" sx={{ width: '100%' }}>
<CardContent>
<Typography variant="subtitle2" component="h2" gutterBottom>
<Typography component="h2" variant="subtitle2" gutterBottom>
Page views and downloads
</Typography>
<BarChart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function PageViewsChart() {
return (
<Card variant="outlined" sx={{ height: 400, width: '100%' }}>
<CardContent>
<Typography variant="subtitle2" component="p" gutterBottom>
<Typography component="h2" variant="subtitle2" gutterBottom>
Sessions
</Typography>
<LineChart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function PageViewsChart() {
return (
<Card variant="outlined" sx={{ height: 400, width: '100%' }}>
<CardContent>
<Typography variant="subtitle2" component="p" gutterBottom>
<Typography component="h2" variant="subtitle2" gutterBottom>
Sessions
</Typography>
<LineChart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import MenuButton from './MenuButton';

function ToggleColorMode({ mode, toggleColorMode }) {
return (
<MenuButton
onClick={toggleColorMode}
size="small"
aria-label="Button to toggle theme"
>
<MenuButton onClick={toggleColorMode} size="small" aria-label="Toggle theme">
{mode === 'dark' ? (
<WbSunnyRoundedIcon fontSize="small" />
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ export default function ToggleColorMode({
toggleColorMode,
}: ToggleColorModeProps) {
return (
<MenuButton
onClick={toggleColorMode}
size="small"
aria-label="Button to toggle theme"
>
<MenuButton onClick={toggleColorMode} size="small" aria-label="Toggle theme">
{mode === 'dark' ? (
<WbSunnyRoundedIcon fontSize="small" />
) : (
Expand Down

0 comments on commit 6658704

Please sign in to comment.