-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use another component from the MUI library
- Loading branch information
Showing
5 changed files
with
36 additions
and
29 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
42 changes: 21 additions & 21 deletions
42
application/frontend/src/components/NavButton/NavButton.styled.ts
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,23 +1,23 @@ | ||
import styled from "styled-components" | ||
import Chip from "@mui/material/Chip" | ||
import { emphasize, styled } from "@mui/material/styles" | ||
|
||
import { Link } from "react-router-dom" | ||
|
||
export const StyledButton = styled(Link)` | ||
display: inline-flex; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: rgba(0, 0, 0, 0.08); | ||
gap: 4px; | ||
border-radius: 50px; | ||
padding: 4px 12px 4px 8px; | ||
text-decoration: none; | ||
color: ${(props) => props.theme.palette.text.primary}; | ||
transition: | ||
background-color 0.3s ease, | ||
color 0.3s ease; | ||
&:hover { | ||
background-color: rgba(0, 0, 0, 0.12); | ||
color: ${(props) => props.theme.palette.text.secondary}; | ||
export const StyledBreadcrumb = styled(Chip)(({ theme }) => { | ||
const backgroundColor = | ||
theme.palette.mode === "light" ? theme.palette.grey[100] : theme.palette.grey[800] | ||
return { | ||
backgroundColor, | ||
height: theme.spacing(3), | ||
color: theme.palette.text.primary, | ||
fontWeight: theme.typography.fontWeightRegular, | ||
display: "inline-flex", | ||
whiteSpace: "nowrap", | ||
maxWidth: "fit-content", | ||
"&:hover, &:focus": { | ||
backgroundColor: emphasize(backgroundColor, 0.06), | ||
}, | ||
"&:active": { | ||
boxShadow: theme.shadows[1], | ||
backgroundColor: emphasize(backgroundColor, 0.12), | ||
}, | ||
} | ||
` | ||
}) as typeof Chip |
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,14 +1,15 @@ | ||
import React from "react" | ||
import * as React from "react" | ||
|
||
import { StyledButton } from "./NavButton.styled" | ||
import { StyledBreadcrumb } from "./NavButton.styled" | ||
|
||
interface NavButtonProps { | ||
to: string | ||
children: React.ReactNode | ||
icon?: React.ReactNode | ||
} | ||
|
||
export const NavButton: React.FC<NavButtonProps> = ({ to, children }) => { | ||
return <StyledButton to={to}>{children}</StyledButton> | ||
export const NavButton: React.FC<NavButtonProps> = ({ to, children, icon }) => { | ||
return <StyledBreadcrumb component="a" href={to} label={children} icon={icon} /> | ||
} | ||
|
||
export default NavButton |
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