Skip to content

Commit 5308eaf

Browse files
authored
Merge pull request #33 from atlp-rwanda/fix-Stripe-Payment
Fix stripe payment
2 parents 6deee64 + 666d227 commit 5308eaf

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

src/components/common/header/Header.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const Header: React.FC<ISerachProps> = ({ searchQuery, setSearchQuery }) => {
181181
)}
182182
<Stack className="flex flex-col">
183183
<span className="hidden lg:block select-none font-semibold text-[12px]">
184-
{userInfo.name.split(" ")[0]}
184+
{userInfo.name?.split(" ")[0]}
185185
</span>
186186
</Stack>
187187
{dropdownOpen && <ProfileDropdown userInfo={userInfo} />}

src/pages/paymentPage.tsx

+20-1
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,24 @@ const SuccessfulPayment = () => {
174174
);
175175
};
176176

177+
const CancelledPayment = () => (
178+
<section className="flex items-center justify-center py-32 bg-gray-100 md:m-0 px-4 ">
179+
<div className="bg-white p-6 rounded shadow-md text-center">
180+
<h1 className="text-2xl font-medium text-red-500">
181+
❌ Payment Was Cancelled
182+
</h1>
183+
<p className="mt-4">
184+
Checkout Details about your carts If you wish to adjust !
185+
</p>
186+
<p className="mt-2">Thank you for shopping with us.</p>
187+
188+
<Link to="/carts">
189+
<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">
190+
Checkout your Carts
191+
</button>
192+
</Link>
193+
</div>
194+
</section>
195+
);
177196
export default Payment;
178-
export { SuccessfulPayment };
197+
export { SuccessfulPayment, CancelledPayment };

src/routes/AppRoutes.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ import BuyerOrders from "../pages/BuyerOrders";
3333
import SignupVerification from "../pages/SignupVerification";
3434
import SmoothScroll from "../utils/SmoothScroll";
3535
import NotFound from "../pages/NotFound";
36-
import Payment, { SuccessfulPayment } from "../pages/paymentPage";
3736
import { LogoutProvider } from "../components/dashboard/admin/LogoutContext";
37+
import Payment, {
38+
CancelledPayment,
39+
SuccessfulPayment,
40+
} from "../pages/paymentPage";
3841

3942
const AppRoutes = () => {
4043
const navigate = useNavigate();
@@ -69,7 +72,7 @@ const AppRoutes = () => {
6972
<Route path="/orders" element={<BuyerOrders />} />
7073
<Route path="/payment" element={<Payment />} />
7174
<Route path="/payment/success" element={<SuccessfulPayment />} />
72-
<Route path="/payment/canceled" element={<Payment />} />
75+
<Route path="/payment/canceled" element={<CancelledPayment />} />
7376
</Route>
7477
<Route path="chat" element={<ChatPage />} />
7578
<Route path="/password-reset-link" element={<GetLinkPage />} />
@@ -111,7 +114,7 @@ const AppRoutes = () => {
111114
<Route path="/*" element={<NotFound />} />
112115
</Routes>
113116
</LogoutProvider>
114-
</SmoothScroll>
117+
</SmoothScroll>
115118
);
116119
};
117120
export default AppRoutes;

0 commit comments

Comments
 (0)