From 08f41b6bb37f764a0ee6a98e89dcd262a06c8877 Mon Sep 17 00:00:00 2001 From: matej Date: Sun, 28 Sep 2025 14:59:29 +0200 Subject: [PATCH] Cleaned up unused classNames and imported Components --- frontend/src/App.jsx | 3 +- frontend/src/components/PayPalButton.jsx | 2 +- frontend/src/pages/Cancel.jsx | 156 +++++++++++------------ frontend/src/pages/Payment.jsx | 99 +++++++------- frontend/src/pages/Success.jsx | 38 +++--- 5 files changed, 147 insertions(+), 151 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index e510f66..8dc14b6 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,6 +1,6 @@ "use client" import React from 'react'; -import {Grid, GridItem, Button, Box, Container, Image, Flex, Center, SimpleGrid, Text} from "@chakra-ui/react" +import {Grid, Button, Box, Container, Image, Flex, Center, Text} from "@chakra-ui/react" import { LuMoon, LuSun } from "react-icons/lu"; import { useColorMode } from "@/components/ui/color-mode" import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; @@ -25,7 +25,6 @@ function App() {
- } return ( -
+
{paypalError && ( diff --git a/frontend/src/pages/Cancel.jsx b/frontend/src/pages/Cancel.jsx index bffc7f5..d6ecee3 100644 --- a/frontend/src/pages/Cancel.jsx +++ b/frontend/src/pages/Cancel.jsx @@ -3,9 +3,7 @@ import { useSearchParams } from 'react-router-dom'; import { Alert, Text, - Spinner, Center, - VStack, HStack, Button, Accordion, @@ -37,7 +35,7 @@ const Cancel = () => { }; return ( -
+
@@ -48,89 +46,89 @@ const Cancel = () => { - {/*
*/} - {/* */} - {/*
*/} + {/*
*/} + {/* */} + {/*
*/} - {/*

*/} - {/* {getTitle()}*/} - {/*

*/} + {/*

*/} + {/* {getTitle()}*/} + {/*

*/} - {/*

*/} - {/* {getErrorMessage()}*/} - {/*

*/} + {/*

*/} + {/* {getErrorMessage()}*/} + {/*

*/} - {orderId && ( -
- Order ID: - {orderId} -
- - Your order is still pending. You can complete the payment to process your order. - -
- )} + {orderId && ( +
+ Order ID: + {orderId} +
+ + Your order is still pending. You can complete the payment to process your order. + +
+ )} - {paypalToken && ( -
- - PayPal Reference: {paypalToken} - -
- )} + {paypalToken && ( +
+ + PayPal Reference: {paypalToken} + +
+ )} -
- - - - + + + + + + - - -
- - - - If you're experiencing issues with payment: - - - - - -
  • Check your internet connection
  • -
  • Ensure your PayPal account has sufficient funds
  • -
  • Try using a different payment method
  • -
  • Contact our support team if the problem persists
  • -
    -
    -
    -
    - - - Need Help? - - - - Text - - -
    + Back to the Store + + + + + + + + If you're experiencing issues with payment: + + + + + +
  • Check your internet connection
  • +
  • Ensure your PayPal account has sufficient funds
  • +
  • Try using a different payment method
  • +
  • Contact our support team if the problem persists
  • +
    +
    +
    +
    + + + Need Help? + + + + Text + + +
    -
    - Contact Support: {import.meta.env.VITE_REACT_APP_SUPPORT_EMAIL} -
    +
    + Contact Support: {import.meta.env.VITE_REACT_APP_SUPPORT_EMAIL} +
    ); }; diff --git a/frontend/src/pages/Payment.jsx b/frontend/src/pages/Payment.jsx index 4161304..19a0c27 100644 --- a/frontend/src/pages/Payment.jsx +++ b/frontend/src/pages/Payment.jsx @@ -2,7 +2,6 @@ import React, { useState, useEffect } from 'react'; import { Alert, Heading, - DataList, Timeline, Text, Spinner, @@ -12,7 +11,7 @@ import { EmptyState, VStack, HStack } from "@chakra-ui/react" -import { LuShoppingBasket, LuPackageCheck, LuLoaderCircle, LuMail } from "react-icons/lu"; +import { LuShoppingBasket, LuPackageCheck, LuMail } from "react-icons/lu"; import { useSearchParams, useNavigate } from 'react-router-dom'; import OrderSummary from '../components/OrderSummary.jsx'; import PayPalButton from '../components/PayPalButton.jsx'; @@ -170,7 +169,7 @@ const Payment = () => { } return ( -
    +
    Secure Payment with PayPal {order.length === 0 ?
    @@ -266,54 +265,58 @@ const Payment = () => { } + {error && ( + + + + {error} + + We're available via email and usually respond within a few hours. So don't + hesitate to reach out if you need assistance - we're here to help. + + + {import.meta.env.VITE_REACT_APP_SUPPORT_EMAIL} + + + + + )} + {backendStatus && ( + + + + Payment system connected + + We're available via email and usually respond within a few hours. So don't + hesitate to reach out if you need assistance - we're here to help. + + + {import.meta.env.VITE_REACT_APP_SUPPORT_EMAIL} + -
    + + + + )} -
    - {error && ( -
    - - {error} -
    - )} - - {backendStatus && ( - - - - Payment system connected - - We're available via email and usually respond within a few hours. So don't hesitate to reach out if you need assistance - we're here to help. - - - {import.meta.env.VITE_REACT_APP_SUPPORT_EMAIL} - - - - - - )} - - {/* Debug info for development */} - {import.meta.env.VITE_NODE_ENV === 'development' && ( - - - - Debug Info - - - Order ID: {orderData.wc_order_id}
    - Total: ${orderData.total}
    - PayPal Order: {paypalOrderId || 'Not created yet'}
    - Backend: {backendStatus ? '✅ Connected' : '❌ Disconnected'} -
    -
    -
    -
    - )} -
    -
    + {/* Debug info for development */} + {import.meta.env.VITE_NODE_ENV === 'development' && ( + + + + Debug Info + + + Order ID: {orderData.wc_order_id}
    + Total: ${orderData.total}
    + PayPal Order: {paypalOrderId || 'Not created yet'}
    + Backend: {backendStatus ? '✅ Connected' : '❌ Disconnected'} +
    +
    +
    +
    + )}
    ); }; diff --git a/frontend/src/pages/Success.jsx b/frontend/src/pages/Success.jsx index 3cc6b43..6f80792 100644 --- a/frontend/src/pages/Success.jsx +++ b/frontend/src/pages/Success.jsx @@ -76,14 +76,15 @@ const Success = () => { } return ( -
    +
    - + Payment Successful! Thank you for your payment. Your transaction has been completed successfully. - A confirmation email has been sent to your email address with all the transaction details. + A confirmation email has been sent to your email address with all the transaction + details. Redirecting you back to checkout in {countdown} seconds... @@ -131,25 +132,20 @@ const Success = () => { )} - - - + Back to the Store + + + + +
    ); };