Skip to content

Commit

Permalink
Merge pull request #330 from USEPA/feature/update-navigation-warning-…
Browse files Browse the repository at this point in the history
…confirmation-dialog

Feature/update navigation warning confirmation dialog
  • Loading branch information
courtneymyers authored Jun 21, 2023
2 parents 6c3a81c + 958c257 commit d4a2671
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions app/client/src/components/userDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export function UserDashboard(props: { email: string }) {
const onHelpdeskPage = pathname === "/helpdesk";
const onApplicationFormPage = pathname.startsWith("/rebate");
const onPaymentRequestFormPage = pathname.startsWith("/payment-request");
const onCloseOutFormPage = pathname.startsWith("/close-out");

const applicationFormOpen = csbData
? csbData.submissionPeriodOpen.application
Expand Down Expand Up @@ -123,6 +124,7 @@ export function UserDashboard(props: { email: string }) {
</nav>

<nav>
{/* --- Your Rebate Forms --- */}
{onAllRebatesPage ? (
<button
className="margin-bottom-1 usa-button font-sans-2xs"
Expand All @@ -139,7 +141,11 @@ export function UserDashboard(props: { email: string }) {
to="/"
className="margin-bottom-1 usa-button font-sans-2xs"
onClick={(ev) => {
if (onApplicationFormPage || onPaymentRequestFormPage) {
if (
onApplicationFormPage ||
onPaymentRequestFormPage ||
onCloseOutFormPage
) {
ev.preventDefault();
displayDialog({
dismissable: true,
Expand All @@ -166,8 +172,10 @@ export function UserDashboard(props: { email: string }) {
</Link>
)}

{/* --- New Application --- */}
{onApplicationFormPage ||
onPaymentRequestFormPage ||
onCloseOutFormPage ||
!applicationFormOpen ? (
<button
className="margin-bottom-1 usa-button font-sans-2xs"
Expand All @@ -192,6 +200,7 @@ export function UserDashboard(props: { email: string }) {
</Link>
)}

{/* --- Helpdesk --- */}
{helpdeskAccess === "success" && (
<>
{onHelpdeskPage ? (
Expand All @@ -206,7 +215,11 @@ export function UserDashboard(props: { email: string }) {
to="/helpdesk"
className="margin-bottom-1 usa-button font-sans-2xs"
onClick={(ev) => {
if (onApplicationFormPage || onPaymentRequestFormPage) {
if (
onApplicationFormPage ||
onPaymentRequestFormPage ||
onCloseOutFormPage
) {
ev.preventDefault();
displayDialog({
dismissable: true,
Expand Down

0 comments on commit d4a2671

Please sign in to comment.