Skip to content

Commit

Permalink
Merge pull request #33 from atlp-rwanda/fix-Stripe-Payment
Browse files Browse the repository at this point in the history
Fix stripe payment
  • Loading branch information
teerenzo authored Jul 30, 2024
2 parents 6deee64 + 666d227 commit 5308eaf
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/common/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const Header: React.FC<ISerachProps> = ({ searchQuery, setSearchQuery }) => {
)}
<Stack className="flex flex-col">
<span className="hidden lg:block select-none font-semibold text-[12px]">
{userInfo.name.split(" ")[0]}
{userInfo.name?.split(" ")[0]}
</span>
</Stack>
{dropdownOpen && <ProfileDropdown userInfo={userInfo} />}
Expand Down
21 changes: 20 additions & 1 deletion src/pages/paymentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,24 @@ const SuccessfulPayment = () => {
);
};

const CancelledPayment = () => (
<section className="flex items-center justify-center py-32 bg-gray-100 md:m-0 px-4 ">
<div className="bg-white p-6 rounded shadow-md text-center">
<h1 className="text-2xl font-medium text-red-500">
❌ Payment Was Cancelled
</h1>
<p className="mt-4">
Checkout Details about your carts If you wish to adjust !
</p>
<p className="mt-2">Thank you for shopping with us.</p>

<Link to="/carts">
<button className="mt-4 inline-block px-4 py-2 text-white bg-red-500 rounded transition-colors duration-300 cursor-pointer hover:bg-green-600">
Checkout your Carts
</button>
</Link>
</div>
</section>
);
export default Payment;
export { SuccessfulPayment };
export { SuccessfulPayment, CancelledPayment };
9 changes: 6 additions & 3 deletions src/routes/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ import BuyerOrders from "../pages/BuyerOrders";
import SignupVerification from "../pages/SignupVerification";
import SmoothScroll from "../utils/SmoothScroll";
import NotFound from "../pages/NotFound";
import Payment, { SuccessfulPayment } from "../pages/paymentPage";
import { LogoutProvider } from "../components/dashboard/admin/LogoutContext";
import Payment, {
CancelledPayment,
SuccessfulPayment,
} from "../pages/paymentPage";

const AppRoutes = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -69,7 +72,7 @@ const AppRoutes = () => {
<Route path="/orders" element={<BuyerOrders />} />
<Route path="/payment" element={<Payment />} />
<Route path="/payment/success" element={<SuccessfulPayment />} />
<Route path="/payment/canceled" element={<Payment />} />
<Route path="/payment/canceled" element={<CancelledPayment />} />
</Route>
<Route path="chat" element={<ChatPage />} />
<Route path="/password-reset-link" element={<GetLinkPage />} />
Expand Down Expand Up @@ -111,7 +114,7 @@ const AppRoutes = () => {
<Route path="/*" element={<NotFound />} />
</Routes>
</LogoutProvider>
</SmoothScroll>
</SmoothScroll>
);
};
export default AppRoutes;

0 comments on commit 5308eaf

Please sign in to comment.