Merge pull request #220 from nowcommunity/add-isnew-check-to-detailview-delete-button

add check to disable delete button when creating new thing
This commit is contained in:
Eero Antikainen
2024-09-20 12:50:28 +03:00
committed by GitHub
@@ -147,7 +147,7 @@ export const DetailView = <T extends object>({
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignContent: 'center', marginTop: 'auto' }}>
<Box sx={{ display: 'flex' }} gap={3}>
{!isUserPage && <ReturnButton />}
{editRights.delete && (
{editRights.delete && !isNew && (
<Button onClick={onDelete} variant="contained" style={{ width: '8em' }}>
Delete
</Button>