Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation button added on payment success page #1616

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion app/javascript/src/components/payments/Success/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React, { useEffect, useState } from "react";

import { LeftArrowIcon } from "miruIcons";
import { useNavigate, useParams } from "react-router-dom";
import { Button } from "StyledComponents";

import invoicesApi from "apis/invoices";
import Loader from "common/Loader";
Expand Down Expand Up @@ -28,6 +30,10 @@ const Success = () => {
}
};

const redirectToHomePage = () => {
navigate("/invoices");
};

useEffect(() => {
fetchPaymentSuccess();
}, []);
Expand Down Expand Up @@ -60,14 +66,21 @@ const Success = () => {
</svg>
</div>
<div className="py-16">
<div className="text-center">
<div className="flex flex-col items-center">
<p className="tracking-wide text-sm font-semibold uppercase text-indigo-600">{`Invoice ${invoice?.invoice_number}`}</p>
<h1 className="tracking-tight mt-2 text-4xl font-extrabold text-gray-900 sm:text-5xl">
Payment was successful. 🎉
</h1>
<p className="mt-2 text-base text-gray-500">
We have received your payment.
</p>
<Button
className="mt-8 flex items-center justify-between text-lg font-semibold"
onClick={redirectToHomePage}
>
<LeftArrowIcon className="mr-1" />
Go To Home Page
</Button>
</div>
</div>
</main>
Expand Down
Loading