From e965f622c5e74796e0e3887b1b7388be47cfb837 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Thu, 15 Aug 2019 12:39:14 +1000 Subject: [PATCH] Add confirm delete dialog --- .../components/Shared/DetailsEditNavbar.tsx | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/ui/v2/src/components/Shared/DetailsEditNavbar.tsx b/ui/v2/src/components/Shared/DetailsEditNavbar.tsx index 0e3eea5b8..2bedc0d48 100644 --- a/ui/v2/src/components/Shared/DetailsEditNavbar.tsx +++ b/ui/v2/src/components/Shared/DetailsEditNavbar.tsx @@ -1,4 +1,5 @@ import { + Alert, Button, FileInput, Menu, @@ -8,7 +9,7 @@ import { Popover, } from "@blueprintjs/core"; import _ from "lodash"; -import React, { FunctionComponent } from "react"; +import React, { FunctionComponent, useState } from "react"; import { Link } from "react-router-dom"; import * as GQL from "../../core/generated-graphql"; import { NavigationUtils } from "../../utils/navigation"; @@ -28,6 +29,8 @@ interface IProps { } export const DetailsEditNavbar: FunctionComponent = (props: IProps) => { + const [isDeleteAlertOpen, setIsDeleteAlertOpen] = useState(false); + function renderEditButton() { if (props.isNew) { return; } return ( @@ -46,7 +49,7 @@ export const DetailsEditNavbar: FunctionComponent = (props: IProps) => { function renderDeleteButton() { if (props.isNew || props.isEditing) { return; } - return