-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: action buttons are now properly aligned
- Loading branch information
1 parent
5e19caf
commit 3be5097
Showing
4 changed files
with
53 additions
and
12 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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { ReactElement, ReactNode } from 'react' | ||
import { makeStyles, Theme, createStyles } from '@material-ui/core/styles' | ||
import { Typography, Grid, IconButton, Tooltip } from '@material-ui/core' | ||
import { Info } from 'react-feather' | ||
import ListItem from '@material-ui/core/ListItem' | ||
|
||
const useStyles = makeStyles((theme: Theme) => | ||
createStyles({ | ||
action: { | ||
marginTop: theme.spacing(0.75), | ||
marginRight: theme.spacing(1), | ||
}, | ||
}), | ||
) | ||
|
||
interface Props { | ||
children: ReactNode | ReactNode[] | ||
} | ||
|
||
export default function ExpandableListItem({ children }: Props): ReactElement | null { | ||
const classes = useStyles() | ||
|
||
if (Array.isArray(children)) { | ||
return ( | ||
<Grid container direction="row"> | ||
{children.map((a, i) => ( | ||
<Grid key={i} className={classes.action}> | ||
{a} | ||
</Grid> | ||
))} | ||
</Grid> | ||
) | ||
} | ||
|
||
return ( | ||
<Grid container direction="row"> | ||
<Grid className={classes.action}>{children}</Grid> | ||
</Grid> | ||
) | ||
} |
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