-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add fullHeight prop to MainMenu (#218)
- Loading branch information
Showing
1 changed file
with
14 additions
and
3 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
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; |