diff --git a/web-app/src/app/new/page.tsx b/web-app/src/app/new/page.tsx new file mode 100644 index 00000000..25a16426 --- /dev/null +++ b/web-app/src/app/new/page.tsx @@ -0,0 +1,33 @@ +"use client"; + +import CreateModal from "@/components/site/modal/CreateModal"; +import type { NextPage } from "next"; +import "../[id]/app.css"; +import { useApp } from "@/context/AppContext"; +import ConfirmTransaction from "@/components/site/modal/Common/ConfirmTransaction"; + +const Home: NextPage = () => { + const { + handleCreatePublic, + transactionApprovalWaiting, + handleTransactionCancel, + } = useApp(); + return ( +
+ {transactionApprovalWaiting && ( + + )} + +
+ ); +}; + +export default Home; diff --git a/web-app/src/components/base/Modal/index.tsx b/web-app/src/components/base/Modal/index.tsx index 507cb93c..325a5cc2 100644 --- a/web-app/src/components/base/Modal/index.tsx +++ b/web-app/src/components/base/Modal/index.tsx @@ -18,6 +18,7 @@ export interface ModalProps { size?: "fit" | InputSizeType; mobileBackdropClose?: boolean; onClose?(): void; + backdropClose?: boolean; } interface GlobalStyleProps { @@ -42,6 +43,7 @@ const Modal = ({ size = "fit", mobileMaxVh = 70, onClose, + backdropClose = false, }: ModalProps) => { const [portal, setPortal] = useState(null); @@ -116,6 +118,10 @@ const Modal = ({ if (isMobile && !mobileBackdropClose) { return; } + + if (!backdropClose) { + return; + } handleClose(); }; diff --git a/web-app/src/components/layout/site/DiscoveryLayout/index.tsx b/web-app/src/components/layout/site/DiscoveryLayout/index.tsx index acb0caa3..96c6073d 100644 --- a/web-app/src/components/layout/site/DiscoveryLayout/index.tsx +++ b/web-app/src/components/layout/site/DiscoveryLayout/index.tsx @@ -73,6 +73,7 @@ const DiscoveryLayout = ({ children }: DiscoveryLayoutProps) => { )} {transactionApprovalWaiting && ( diff --git a/web-app/src/components/site/modal/Common/ConfirmTransaction/index.tsx b/web-app/src/components/site/modal/Common/ConfirmTransaction/index.tsx index 4a5570c8..691109ab 100644 --- a/web-app/src/components/site/modal/Common/ConfirmTransaction/index.tsx +++ b/web-app/src/components/site/modal/Common/ConfirmTransaction/index.tsx @@ -4,7 +4,11 @@ import Row from "components/layout/base/Grid/Row"; import Header from "components/base/Header"; import Flex from "components/layout/base/Grid/Flex"; -const ConfirmTransaction = ({ handleCancel, ...modalProps }: any) => { +const ConfirmTransaction = ({ + handleCancel, + backdropClose, + ...modalProps +}: any) => { const handleClose = () => { modalProps.onClose?.(); }; @@ -13,6 +17,7 @@ const ConfirmTransaction = ({ handleCancel, ...modalProps }: any) => { {...modalProps} size={"fit"} destroyOnClose + backdropClose={backdropClose} body={ <> diff --git a/web-app/src/components/site/modal/CreateModal/index.tsx b/web-app/src/components/site/modal/CreateModal/index.tsx index b7233003..8e4e70d6 100644 --- a/web-app/src/components/site/modal/CreateModal/index.tsx +++ b/web-app/src/components/site/modal/CreateModal/index.tsx @@ -11,9 +11,14 @@ import React, { useState } from "react"; export interface CreateModalProps extends Omit { onCreate: (title: string) => void; + cancelVisible?: boolean; } -const CreateModal = ({ onCreate, ...modalProps }: CreateModalProps) => { +const CreateModal = ({ + onCreate, + cancelVisible = true, + ...modalProps +}: CreateModalProps) => { const handleClose = () => { modalProps.onClose?.(); }; @@ -62,16 +67,18 @@ const CreateModal = ({ onCreate, ...modalProps }: CreateModalProps) => { header={
Create New Index
} footer={ <> - - - + {cancelVisible && ( + + + + )}