Child selector to own class and minor changes
This commit is contained in:
parent
e22a5681dd
commit
4ec49c4966
2 changed files with 28 additions and 27 deletions
|
|
@ -12,40 +12,43 @@ import { ReactComponent as CloseIcon } from 'src/styling/icons/action/close/zodi
|
||||||
import { spacer } from 'src/styling/variables'
|
import { spacer } from 'src/styling/variables'
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
const useStyles = makeStyles({
|
||||||
dialogContent: {
|
content: {
|
||||||
width: 434,
|
width: 434,
|
||||||
padding: spacer * 2,
|
padding: spacer * 2,
|
||||||
paddingRight: spacer * 3.5
|
paddingRight: spacer * 3.5
|
||||||
},
|
},
|
||||||
dialogTitle: {
|
titleSection: {
|
||||||
padding: spacer * 2,
|
padding: spacer * 2,
|
||||||
paddingRight: spacer * 1.5,
|
paddingRight: spacer * 1.5,
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
'justify-content': 'space-between',
|
justifyContent: 'space-between',
|
||||||
'& > h4': {
|
margin: 0
|
||||||
margin: 0
|
|
||||||
},
|
|
||||||
'& > button': {
|
|
||||||
padding: 0,
|
|
||||||
marginTop: -(spacer / 2)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
dialogActions: {
|
actions: {
|
||||||
padding: spacer * 4,
|
padding: spacer * 4,
|
||||||
paddingTop: spacer * 2
|
paddingTop: spacer * 2
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
margin: 0
|
||||||
|
},
|
||||||
|
closeButton: {
|
||||||
|
padding: 0,
|
||||||
|
marginTop: -(spacer / 2)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
export const DialogTitle = ({ children, close }) => {
|
export const DialogTitle = ({ children, close }) => {
|
||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
return (
|
return (
|
||||||
<div className={classes.dialogTitle}>
|
<div className={classes.titleSection}>
|
||||||
{children}
|
{children}
|
||||||
{
|
<IconButton
|
||||||
<IconButton size={16} aria-label="close" onClick={close}>
|
size={16}
|
||||||
<CloseIcon />
|
aria-label="close"
|
||||||
</IconButton>
|
onClick={close}
|
||||||
}
|
className={classes.closeButton}>
|
||||||
|
<CloseIcon />
|
||||||
|
</IconButton>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -63,12 +66,12 @@ export const DeleteDialog = ({
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} aria-labelledby="form-dialog-title">
|
<Dialog open={open} aria-labelledby="form-dialog-title">
|
||||||
<DialogTitle close={() => setDeleteDialog(false)}>
|
<DialogTitle close={() => setDeleteDialog(false)}>
|
||||||
<H4>{title}</H4>
|
<H4 className={classes.title}>{title}</H4>
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent className={classes.dialogContent}>
|
<DialogContent className={classes.content}>
|
||||||
{confirmationMessage && <P>{confirmationMessage}</P>}
|
{confirmationMessage && <P>{confirmationMessage}</P>}
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions className={classes.dialogActions}>
|
<DialogActions className={classes.actions}>
|
||||||
<Button onClick={onConfirmed}>Confirm</Button>
|
<Button onClick={onConfirmed}>Confirm</Button>
|
||||||
</DialogActions>
|
</DialogActions>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
|
||||||
|
|
@ -89,13 +89,11 @@ const ActionCol = ({ disabled, editing }) => {
|
||||||
}}>
|
}}>
|
||||||
{disabled ? <DisabledDeleteIcon /> : <DeleteIcon />}
|
{disabled ? <DisabledDeleteIcon /> : <DeleteIcon />}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
{
|
<DeleteDialog
|
||||||
<DeleteDialog
|
open={deleteDialog}
|
||||||
open={deleteDialog}
|
setDeleteDialog={setDeleteDialog}
|
||||||
setDeleteDialog={setDeleteDialog}
|
onConfirmed={onConfirmed}
|
||||||
onConfirmed={onConfirmed}
|
/>
|
||||||
/>
|
|
||||||
}
|
|
||||||
</Td>
|
</Td>
|
||||||
)}
|
)}
|
||||||
{!editing && enableToggle && (
|
{!editing && enableToggle && (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue