From 28f699e96d6653d9a15031de5976903738cddd46 Mon Sep 17 00:00:00 2001
From: calbertan <02c.albert@gmail.com>
Date: Thu, 7 Dec 2023 13:23:03 -0800
Subject: [PATCH] fix: return modal displays note only if its public-cloud
---
components/modal/Return.tsx | 57 ++++++++++++++++++++-----------------
1 file changed, 31 insertions(+), 26 deletions(-)
diff --git a/components/modal/Return.tsx b/components/modal/Return.tsx
index 8b93a71af..391954b19 100644
--- a/components/modal/Return.tsx
+++ b/components/modal/Return.tsx
@@ -1,10 +1,11 @@
import { Fragment, useRef, useState } from 'react';
import { Dialog, Transition } from '@headlessui/react';
-import { useRouter } from 'next/navigation';
+import { usePathname, useRouter } from 'next/navigation';
export default function Modal({ open, setOpen, redirectUrl }: { open: boolean; setOpen: any; redirectUrl: string }) {
const cancelButtonRef = useRef(null);
const router = useRouter();
+ const pathname = usePathname();
const handleReturn = () => {
setOpen(false);
@@ -12,6 +13,8 @@ export default function Modal({ open, setOpen, redirectUrl }: { open: boolean; s
router.refresh();
};
+ const isPublic = pathname.includes('public-cloud') ? true : false;
+
return (
Note:
-- The approval of new project set creation request is subject to having a signed Memorandum of - Understanding (MoU) with the Public Cloud Team. If you do not have a MoU in place, please - email us at - - - cloud.pathfinder@gov.bc.ca - - . -
-- In order to request a project deletion, please email us at - - - cloud.pathfinder@gov.bc.ca - - . -
+ {isPublic && ( +Note:
++ The approval of new project set creation request is subject to having a signed Memorandum of + Understanding (MoU) with the Public Cloud Team. If you do not have a MoU in place, please + email us at + + + cloud.pathfinder@gov.bc.ca + + . +
++ In order to request a project deletion, please email us at + + + cloud.pathfinder@gov.bc.ca + + . +
+