Skip to content

Commit

Permalink
Change Button component in small screens sidebar to a tag
Browse files Browse the repository at this point in the history
Change `Button` component in small screens sidebar to `a` tag to avoid
the an unnecessary nested ripple effect that `Button` component causes
because it is inside `MenuItem` component which has a ripple effect.

Give the `a` tag `classes.unstyledLink` class to overwrite its default styles.

Remove `.sidebarLink` class from `navbar` styles file because the only
component that uses this class has been changed.
  • Loading branch information
AbdulrhmanGoni committed May 6, 2024
1 parent dae33ae commit fe67232
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions components/navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ export default function Navbar({
</ListItem>
{menu.map((item) => (
<MenuItem key={item.name}>
<Button
<a
href={item.href}
target={item.target}
className={classes.sidebarLink}
className={classes.unstyledLink}
>
{item.name}
</Button>
</a>
</MenuItem>
))}
<MenuItem>
Expand Down
5 changes: 0 additions & 5 deletions components/navbar/style.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@
height: 1em;
}

.sidebarLink {
padding: 0px !important;
min-width: auto !important;
}

.unstyledLink {
color: #fff;
text-decoration: none;
Expand Down

0 comments on commit fe67232

Please sign in to comment.