Skip to content

Commit

Permalink
feat: add fullHeight prop to MainMenu (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia authored Feb 6, 2023
1 parent a7b0e5f commit f343e66
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/MainMenu/MainMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import List from '@mui/material/List';

import React, { FC } from 'react';
import React from 'react';

export interface MainMenuProps {
id?: string;
children?: React.ReactElement | React.ReactElement[];
/** whether container is full height
* this allows possible footer elements */
fullHeight?: boolean;
}

export const MainMenu: FC<MainMenuProps> = ({ id, children }) => {
return <List id={id}>{children}</List>;
export const MainMenu = ({
id,
children,
fullHeight,
}: MainMenuProps): JSX.Element => {
return (
<List id={id} sx={{ height: fullHeight ? '100%' : undefined }}>
{children}
</List>
);
};

export default MainMenu;

0 comments on commit f343e66

Please sign in to comment.