add prettier for auto formatting (#231)
* [Prettier] Add "prettier" Makes the formatting of the code consistent. By using the eslint-plugin-prettier formatting issues will be highlighted as a lint error. These errors will be auto fixed by running "lint --fix" (which can be done automatically on file save) * [Prettier] Add "prettier" - Fix formatting
This commit is contained in:
@@ -33,7 +33,7 @@ const Link = styled(RRDLink)({
|
||||
});
|
||||
|
||||
interface IProps {
|
||||
navBarItems: Array<NavbarItem>
|
||||
navBarItems: Array<NavbarItem>;
|
||||
}
|
||||
|
||||
export default function MobileBottomBar({ navBarItems }: IProps) {
|
||||
@@ -41,43 +41,48 @@ export default function MobileBottomBar({ navBarItems }: IProps) {
|
||||
const theme = useTheme();
|
||||
|
||||
const iconFor = (path: string, IconComponent: any, SelectedIconComponent: any) => {
|
||||
if (location.pathname === path) return <SelectedIconComponent sx={{ color: 'primary.main' }} fontSize="medium" />;
|
||||
return <IconComponent sx={{ color: (theme.palette.mode === 'dark') ? 'grey.A400' : 'grey.600' }} fontSize="medium" />;
|
||||
if (location.pathname === path)
|
||||
return <SelectedIconComponent sx={{ color: 'primary.main' }} fontSize="medium" />;
|
||||
return (
|
||||
<IconComponent
|
||||
sx={{ color: theme.palette.mode === 'dark' ? 'grey.A400' : 'grey.600' }}
|
||||
fontSize="medium"
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<BottomNavContainer>
|
||||
{
|
||||
navBarItems.map((
|
||||
{
|
||||
path, title, IconComponent, SelectedIconComponent,
|
||||
}: NavbarItem,
|
||||
) => (
|
||||
{navBarItems.map(
|
||||
({ path, title, IconComponent, SelectedIconComponent }: NavbarItem) => (
|
||||
<Link to={path} key={path}>
|
||||
<ListItem disableRipple button sx={{ justifyContent: 'center', padding: '8px' }} key={title}>
|
||||
<Box
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
alignItems="center"
|
||||
>
|
||||
<ListItem
|
||||
disableRipple
|
||||
button
|
||||
sx={{ justifyContent: 'center', padding: '8px' }}
|
||||
key={title}
|
||||
>
|
||||
<Box display="flex" flexDirection="column" alignItems="center">
|
||||
{iconFor(path, IconComponent, SelectedIconComponent)}
|
||||
<Box sx={{
|
||||
fontSize: '0.65rem',
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
color: location.pathname === path
|
||||
? 'primary.main'
|
||||
: ((theme.palette.mode === 'dark')
|
||||
? 'grey.A400'
|
||||
: 'grey.600'),
|
||||
}}
|
||||
<Box
|
||||
sx={{
|
||||
fontSize: '0.65rem',
|
||||
color:
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
location.pathname === path
|
||||
? 'primary.main'
|
||||
: theme.palette.mode === 'dark'
|
||||
? 'grey.A400'
|
||||
: 'grey.600',
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</Box>
|
||||
</Box>
|
||||
</ListItem>
|
||||
</Link>
|
||||
))
|
||||
}
|
||||
),
|
||||
)}
|
||||
</BottomNavContainer>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user