Skip to content

Commit

Permalink
Merge pull request #1535 from bcgov/1512
Browse files Browse the repository at this point in the history
fix: return modal displays note only if its public-cloud
  • Loading branch information
calbertan authored Dec 7, 2023
2 parents a0fc9c2 + 28f699e commit ad73f5f
Showing 1 changed file with 31 additions and 26 deletions.
57 changes: 31 additions & 26 deletions components/modal/Return.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
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);
router.push(redirectUrl);
router.refresh();
};

const isPublic = pathname.includes('public-cloud') ? true : false;

return (
<Transition.Root show={open} as={Fragment}>
<Dialog as="div" className="relative z-10" initialFocus={cancelButtonRef} onClose={() => {}}>
Expand Down Expand Up @@ -56,32 +59,34 @@ export default function Modal({ open, setOpen, redirectUrl }: { open: boolean; s
Alternatively, you can also track the status of your requests from the Registry App Dashboard
</p>
</div>
<div className="bg-blue-50 mt-4 p-4 rounded-md flex">
<div className="border-2 border-blue-700 relative w-1 h-1 bg-inherit rounded-full flex justify-center items-center text-center p-2 m-2 mr-4">
<span className="font-bold text-blue-700 font-sans text-xs">i</span>
</div>
<div>
<p className="font-bcsans text-sm text-blue-700 font-semibold mt-2">Note:</p>
<p className="font-bcsans text-sm text-blue-700 mt-1">
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
<span> </span>
<a href="mailto:cloud.pathfinder@gov.bc.ca" className="underline">
cloud.pathfinder@gov.bc.ca
</a>
.
</p>
<p className="font-bcsans text-sm text-blue-700 mt-4">
In order to request a project deletion, please email us at
<span> </span>
<a href="mailto:cloud.pathfinder@gov.bc.ca" className="underline">
cloud.pathfinder@gov.bc.ca
</a>
.
</p>
{isPublic && (
<div className="bg-blue-50 mt-4 p-4 rounded-md flex">
<div className="border-2 border-blue-700 relative w-1 h-1 bg-inherit rounded-full flex justify-center items-center text-center p-2 m-2 mr-4">
<span className="font-bold text-blue-700 font-sans text-xs">i</span>
</div>
<div>
<p className="font-bcsans text-sm text-blue-700 font-semibold mt-2">Note:</p>
<p className="font-bcsans text-sm text-blue-700 mt-1">
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
<span> </span>
<a href="mailto:cloud.pathfinder@gov.bc.ca" className="underline">
cloud.pathfinder@gov.bc.ca
</a>
.
</p>
<p className="font-bcsans text-sm text-blue-700 mt-4">
In order to request a project deletion, please email us at
<span> </span>
<a href="mailto:cloud.pathfinder@gov.bc.ca" className="underline">
cloud.pathfinder@gov.bc.ca
</a>
.
</p>
</div>
</div>
</div>
)}
</div>
</div>
<div className="mt-5 sm:mt-6">
Expand Down

0 comments on commit ad73f5f

Please sign in to comment.