Remove delete icon when no note is present.

This commit is contained in:
Paulo Gustavo Veiga 2022-10-07 20:36:04 -07:00
parent 58d8ab0708
commit c9c2194a57

View File

@ -13,6 +13,13 @@ const SaveAndDelete = (props: {
}) => { }) => {
return ( return (
<Box component="span"> <Box component="span">
<Button color="primary" variant="outlined" onClick={props.submitHandler} sx={{ mr: 1 }}>
{$msg('ACCEPT')}
</Button>
<Button color="primary" variant="contained" onClick={props.closeModal}>
{$msg('CANCEL')}
</Button>
{props.model.getValue() && props.model.getValue().trim() !== '' && (
<IconButton <IconButton
onClick={() => { onClick={() => {
props.closeModal(); props.closeModal();
@ -21,12 +28,7 @@ const SaveAndDelete = (props: {
> >
<DeleteOutlineOutlinedIcon /> <DeleteOutlineOutlinedIcon />
</IconButton> </IconButton>
<Button color="primary" variant="outlined" onClick={props.submitHandler} sx={{ mr: 1 }}> )}
{$msg('ACCEPT')}
</Button>
<Button color="primary" variant="contained" onClick={props.closeModal}>
{$msg('CANCEL')}
</Button>
</Box> </Box>
); );
}; };