Skip to content

Commit

Permalink
fix: change classname to props
Browse files Browse the repository at this point in the history
  • Loading branch information
louisewang1 committed Jul 7, 2022
1 parent b0ddf3d commit 45cb4d0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
MenuItem,
Typography,
Button,
PropTypes,
} from '@material-ui/core';
import { redirect, Context } from '@graasp/utils';
import ExploreIcon from '../icons/ExploreIcon';
Expand Down Expand Up @@ -89,17 +88,22 @@ interface NavigationProps {
id?: string;
currentValue: Context;
hostMap: HostMap;
color: PropTypes.Color;
buttonStyle?: string;
triangleStyle?: string;
}

const Navigation: React.FC<NavigationProps> = ({
currentValue,
hostMap = {},
id,
color = 'secondary',
buttonStyle,
triangleStyle,
}) => {
const classes = useStyles();

const button = buttonStyle || classes.button;
const triangle = triangleStyle || classes.triangle;

const [anchorEl, setAnchorEl] = React.useState<Element | null>(null);

const handleClick: MouseEventHandler = (event): void => {
Expand Down Expand Up @@ -127,14 +131,13 @@ const Navigation: React.FC<NavigationProps> = ({
aria-controls='navigation-menu'
aria-haspopup='true'
onClick={handleClick}
className={classes.button}
className={button}
variant='outlined'
color={color}
>
<Typography variant='h6' color='inherit'>
{currentValue}
</Typography>
<div className={classes.triangle} />
<div className={triangle} />
</Button>
<Menu
id='navigation-menu'
Expand Down

0 comments on commit 45cb4d0

Please sign in to comment.