diff --git a/ui/src/components/AccountDisclosure.jsx b/ui/src/components/AccountDisclosure.jsx index f409641..dd75948 100644 --- a/ui/src/components/AccountDisclosure.jsx +++ b/ui/src/components/AccountDisclosure.jsx @@ -2,68 +2,58 @@ import Card from "react-bootstrap/Card"; const AccountDisclosure = () => { return ( - - - - - - Account Disclosures - -
-
- Investment and Insurance Products are: -
-
    -
  • - Not Insured by the MFIC (Martian Financial Institutions - Commission) or Any Martian Government Agency -
  • -
  • - Not a Deposit or Other Obligation of, or Guaranteed by, the Bank - or Any Bank Affiliate -
  • -
  • - Subject to Investment Risks, Including Possible Loss of the - Principal Amount Invested -
  • -
- - Investment products and services are offered through Martian Bank - Advisors. Martian Bank Advisors is a trade name used by Martian - Clearing Services, LLC (MCSC) and Martian Bank Advisors Financial - Network, LLC, Members MPIC (Martian Planetary Investment - Commission), separate registered broker-dealers and non-bank - affiliates of Martian Bank Corporation. - -
- - Deposit products offered by Martian Bank, M.A. Member MFDIC - (Martian Financial Deposit Insurance Corporation). - -
- Equal Planetary Habitat Lender -
- - At Martian Bank, we are committed to promoting sustainability and - supporting environmental initiatives across our operations. Join - us in our mission to build a greener and more sustainable future - for all Martian inhabitants. - -
- - For inquiries regarding our products and services or to learn more - about our commitment to environmental sustainability, please visit - our website or contact our customer support team. - -
-
- © 2023 Martian Bank. All rights reserved. -
-
+ + + Account Disclosures +
+
+ Investment and Insurance Products are: +
+
    +
  • + Not Insured by the MFIC (Martian Financial Institutions + Commission) or Any Martian Government Agency +
  • +
  • + Not a Deposit or Other Obligation of, or Guaranteed by, the Bank + or Any Bank Affiliate +
  • +
  • + Subject to Investment Risks, Including Possible Loss of the + Principal Amount Invested +
  • +
+ + Investment products and services are offered through Martian Bank + Advisors. Martian Bank Advisors is a trade name used by Martian + Clearing Services, LLC (MCSC) and Martian Bank Advisors Financial + Network, LLC, Members MPIC (Martian Planetary Investment + Commission), separate registered broker-dealers and non-bank + affiliates of Martian Bank Corporation. + +
+ + Deposit products offered by Martian Bank, M.A. Member MFDIC + (Martian Financial Deposit Insurance Corporation). + +
+ Equal Planetary Habitat Lender +
+ + At Martian Bank, we are committed to promoting sustainability and + supporting environmental initiatives across our operations. Join + us in our mission to build a greener and more sustainable future + for all Martian inhabitants. + +
+ + For inquiries regarding our products and services or to learn more + about our commitment to environmental sustainability, please visit + our website or contact our customer support team. + +
+
+ © 2023 Martian Bank. All rights reserved.
); diff --git a/ui/src/components/Footer.jsx b/ui/src/components/Footer.jsx index 244fcc6..b1a8e48 100644 --- a/ui/src/components/Footer.jsx +++ b/ui/src/components/Footer.jsx @@ -9,54 +9,42 @@ import "../index.css"; const Footer = () => { return ( -
- +
+ - + - - - - Account Disclosures - -
-
- Investment and Insurance Products are: - 1. Not Insured by the MFIC (Martian Financial Institutions - Commission) or Any Martian Government Agency 2. Not a Deposit - or Other Obligation of, or Guaranteed by, the Bank or 3. Any - Bank Affiliate Subject to Investment Risks, Including Possible - Loss of the Principal Amount Invested - - Investment products and services are offered through Martian - Bank Advisors. Martian Bank Advisors is a trade name used by - Martian Clearing Services, LLC (MCSC) and Martian Bank - Advisors Financial Network, LLC, Members MPIC (Martian - Planetary Investment Commission), separate registered - broker-dealers and non-bank affiliates of Martian Bank - Corporation. - -
- - Deposit products offered by Martian Bank, M.A. Member MFDIC - (Martian Financial Deposit Insurance Corporation). - -
- Equal Planetary Habitat Lender -
- - MFICO is a registered trademark of Martian Isaac Corporation - in Mars and other celestial bodies. - -
+ + Account Disclosures +
+
+ Investment and Insurance Products are: +
    +
  • Not Insured by the MFIC (Martian Financial Institutions Commission) or Any Martian Government Agency
  • +
  • Not a Deposit or Other Obligation of, or Guaranteed by, the Bank
  • +
  • Any Bank Affiliate Subject to Investment Risks, Including Possible Loss of the Principal Amount Invested
  • +
+ + Investment products and services are offered through Martian + Bank Advisors. Martian Bank Advisors is a trade name used by + Martian Clearing Services, LLC (MCSC) and Martian Bank + Advisors Financial Network, LLC, Members MPIC (Martian + Planetary Investment Commission), separate registered + broker-dealers and non-bank affiliates of Martian Bank + Corporation. + +
+ + Deposit products offered by Martian Bank, M.A. Member MFDIC + (Martian Financial Deposit Insurance Corporation). + +
+ Equal Planetary Habitat Lender +
+ + MFICO is a registered trademark of Martian Isaac Corporation + in Mars and other celestial bodies. +
@@ -67,3 +55,4 @@ const Footer = () => { }; export default Footer; + diff --git a/ui/src/components/FormContainer.jsx b/ui/src/components/FormContainer.jsx index d357009..f27b65c 100644 --- a/ui/src/components/FormContainer.jsx +++ b/ui/src/components/FormContainer.jsx @@ -5,46 +5,37 @@ */ import { Container, Row, Col } from "react-bootstrap"; +import "../styles/FormContainer.css"; // assuming you have a CSS file for styles const FormContainer = ({ children, position }) => { return ( {position === "left" ? ( - <> - - - {children} - + + + {children} + - - - -

$100 bonus on us!

-

- Open an eligible account with qualifying electronic deposits and get $100 bonus. -

- -
- - - card - - - -
- + + + +

$100 bonus on us!

+

+ Open an eligible account with qualifying electronic deposits and get $100 bonus. +

+ +
+ + + card + + + +
) : ( @@ -57,3 +48,4 @@ const FormContainer = ({ children, position }) => { }; export default FormContainer; + diff --git a/ui/src/components/Header.jsx b/ui/src/components/Header.jsx index 5841163..80e1c31 100644 --- a/ui/src/components/Header.jsx +++ b/ui/src/components/Header.jsx @@ -4,35 +4,33 @@ * license that can be found in the LICENSE file. */ -import { Navbar, Nav, Container, NavDropdown } from "react-bootstrap"; -import { toast } from "react-toastify"; -import { LinkContainer } from "react-router-bootstrap"; -import { useSelector, useDispatch } from "react-redux"; -import { useNavigate } from "react-router-dom"; -import { useLogoutMutation } from "../slices/usersApiSlice"; -import { logout } from "../slices/authSlice"; -import "../index.css"; +import React from 'react'; +import { Navbar, Nav, Container, NavDropdown } from 'react-bootstrap'; +import { toast } from 'react-toastify'; +import { LinkContainer } from 'react-router-bootstrap'; +import { useSelector, useDispatch } from 'react-redux'; +import { useNavigate } from 'react-router-dom'; +import { useLogoutMutation } from '../slices/usersApiSlice'; +import { logout } from '../slices/authSlice'; +import '../index.css'; -const CustomNavItems = ({ name, link }) => { - return ( - - - - {name} - - - - ); -}; +const CustomNavItems = ({ name, link }) => ( + + + + {name} + + + +); const Header = () => { const { userInfo } = useSelector((state) => state.auth); - const dispatch = useDispatch(); const navigate = useNavigate(); - const [logoutApiCall] = useLogoutMutation(); + const logoutHandler = async () => { try { // const jwtCookie = Cookies.get("jwt"); diff --git a/ui/src/components/Hero.jsx b/ui/src/components/Hero.jsx index 54dda89..50fda60 100644 --- a/ui/src/components/Hero.jsx +++ b/ui/src/components/Hero.jsx @@ -12,18 +12,17 @@ import { faShieldAlt, faRocket, } from "@fortawesome/free-solid-svg-icons"; +import "../styles/Hero.css"; // assuming you have a CSS file for styles const Hero = () => { return (
-

- - Welcome to Martian Bank - +

+ Welcome to Martian Bank

-

+

Secure your Martian finances with Red Planet Bank - your trusted financial partner on the Red Planet. Explore our innovative banking solutions, enjoy top-notch security measures, and fuel your Martian @@ -31,20 +30,20 @@ const Hero = () => {

- -
- + { - + { - + Martian Ventures @@ -94,3 +93,4 @@ const Hero = () => { }; export default Hero; + diff --git a/ui/src/components/Loader.jsx b/ui/src/components/Loader.jsx index 438e410..6daf1dd 100644 --- a/ui/src/components/Loader.jsx +++ b/ui/src/components/Loader.jsx @@ -5,20 +5,11 @@ */ import { Spinner } from "react-bootstrap"; +import "../styles/Loader.css"; // Assuming you have a CSS file for styles const Loader = () => { - return ( - - ); + return ; }; export default Loader; + diff --git a/ui/src/main.jsx b/ui/src/main.jsx index 78c4ebd..e47cb57 100644 --- a/ui/src/main.jsx +++ b/ui/src/main.jsx @@ -35,7 +35,7 @@ import ApplyLoan from "./screens/ApplyLoanScreen.jsx"; const router = createBrowserRouter( createRoutesFromElements( }> - } /> + } /> } /> } /> } /> @@ -59,3 +59,4 @@ ReactDOM.createRoot(document.getElementById("root")).render( ); + diff --git a/ui/src/screens/AccInfoScreen.jsx b/ui/src/screens/AccInfoScreen.jsx index 0298d16..49524e7 100644 --- a/ui/src/screens/AccInfoScreen.jsx +++ b/ui/src/screens/AccInfoScreen.jsx @@ -49,18 +49,8 @@ const AccInfoScreen = () => { return ( -

- Account Information -

- +

Account Information

+
@@ -168,12 +158,11 @@ const AccInfoScreen = () => { @@ -181,11 +170,9 @@ const AccInfoScreen = () => { @@ -194,7 +181,7 @@ const AccInfoScreen = () => { - {isLoading && } + {/* isLoading && */}
); }; diff --git a/ui/src/screens/ApplyLoanScreen.jsx b/ui/src/screens/ApplyLoanScreen.jsx index 3b30c44..d092865 100644 --- a/ui/src/screens/ApplyLoanScreen.jsx +++ b/ui/src/screens/ApplyLoanScreen.jsx @@ -170,16 +170,7 @@ const ApplyLoan = () => { return ( -

- Loan Application -

+

Loan Application

{isLoading ? ( ) : ( @@ -473,10 +464,9 @@ const ApplyLoan = () => { @@ -484,9 +474,8 @@ const ApplyLoan = () => { diff --git a/ui/src/screens/ProfileScreen.jsx b/ui/src/screens/ProfileScreen.jsx index 19bdc92..3f36745 100644 --- a/ui/src/screens/ProfileScreen.jsx +++ b/ui/src/screens/ProfileScreen.jsx @@ -23,67 +23,39 @@ const ProfileScreen = () => { const dispatch = useDispatch(); const navigate = useNavigate(); - const { userInfo } = useSelector((state) => state.auth); - const [updateProfile, { isLoading }] = useUpdateUserMutation(); useEffect(() => { - setName(userInfo.name); - setEmail(userInfo.email); - }, [userInfo.email, userInfo.name]); + if (userInfo) { + setName(userInfo.name); + setEmail(userInfo.email); + } + }, [userInfo]); const submitHandler = async (e) => { e.preventDefault(); if (password !== confirmPassword) { toast.error("Passwords do not match"); - } else { - try { - const res = await updateProfile({ - name: name, - email: email, - password: password, - // token: Cookies.get("jwt"), - }).unwrap(); - dispatch(setCredentials(res)); - toast.success("Your profile has been updated", { - className: "toast-container-custom", - autoClose: 500, - hideProgressBar: true, - closeOnClick: true, - pauseOnHover: true, - draggable: true, - progress: undefined, - theme: "dark", - }); - navigate("/"); - } catch (err) { - toast.error(err?.data?.message || err.error, { - className: "toast-container-custom", - autoClose: 500, - hideProgressBar: true, - closeOnClick: true, - pauseOnHover: true, - draggable: true, - progress: undefined, - theme: "dark", - }); - } + return; + } + + try { + const res = await updateProfile({ + name, + email, + password, + }).unwrap(); + dispatch(setCredentials(res)); + toast.success("Your profile has been updated"); + navigate("/"); + } catch (err) { + toast.error(err?.data?.message || err.error); } }; return ( -

- UPDATE   DETAILS -

- +

UPDATE   DETAILS

Name diff --git a/ui/src/screens/RegisterScreen.jsx b/ui/src/screens/RegisterScreen.jsx index 24f8743..ad62f88 100644 --- a/ui/src/screens/RegisterScreen.jsx +++ b/ui/src/screens/RegisterScreen.jsx @@ -40,38 +40,16 @@ const RegisterScreen = () => { if (password !== confirmPassword) { toast.error("Passwords do not match"); - } else { - try { - const res = await register({ name, email, password }).unwrap(); - console.log(res); - dispatch(setCredentials({ ...res })); - toast.success( - "Congratulations! Your account with Martian Bank has been created.", - { - className: "toast-container-custom", - autoClose: 500, - hideProgressBar: true, - closeOnClick: true, - pauseOnHover: true, - draggable: true, - progress: undefined, - theme: "dark", - } - ); - navigate("/login"); - } catch (err) { - console.log(err); - toast.error(err?.data?.message || err.error, { - className: "toast-container-custom", - autoClose: 500, - hideProgressBar: true, - closeOnClick: true, - pauseOnHover: true, - draggable: true, - progress: undefined, - theme: "dark", - }); - } + return; + } + + try { + const res = await register({ name, email, password }).unwrap(); + dispatch(setCredentials({ ...res })); + toast.success("Congratulations! Your account has been created."); + navigate("/login"); + } catch (err) { + toast.error(err?.data?.message || err.error); } }; return ( diff --git a/ui/src/screens/TransactionScreen.jsx b/ui/src/screens/TransactionScreen.jsx index dc8c4b5..3adb888 100644 --- a/ui/src/screens/TransactionScreen.jsx +++ b/ui/src/screens/TransactionScreen.jsx @@ -23,26 +23,25 @@ import "../index.css"; const TransactionScreen = () => { const dispatch = useDispatch(); - const { userInfo } = useSelector((state) => state.auth); - - const [allAccounts, setAllAccounts] = useState([]); - const [selectedAccount, setSelectedAccount] = useState(""); const [history, setHistory] = useState([]); - const [getTransactions, { isLoading }] = useGetTransactionsMutation(); - const [getAllAccounts, { isLoading: isLoading1 }] = - useGetAllAccountsMutation(); + const [getAllAccounts, { isLoading: isLoading1 }] = useGetAllAccountsMutation(); + + useEffect(() => { + fetchAccounts(); + }, []); const fetchHistory = async (e) => { - setSelectedAccount(e.target.value); - e.preventDefault(); + const accountNumber = e.target.value; + setSelectedAccount(accountNumber); + if (!accountNumber || accountNumber === "Select Account") return; + try { const data = new FormData(); - data.append("account_number", e.target.value); + data.append("account_number", accountNumber); const res = await getTransactions(data).unwrap(); - console.log(res) dispatch(storeTransaction(res)); setHistory(res.response); } catch (err) { @@ -60,18 +59,13 @@ const TransactionScreen = () => { }; const fetchAccounts = async () => { - const acc_data = new FormData(); - acc_data.append("email_id", userInfo.email); - const res = await getAllAccounts(acc_data).unwrap(); - dispatch(getAccounts(res)); - setAllAccounts(res.response); - }; - - useEffect(() => { try { - fetchAccounts(); + const acc_data = new FormData(); + acc_data.append("email_id", userInfo.email); + const res = await getAllAccounts(acc_data).unwrap(); + dispatch(getAccounts(res)); + setAllAccounts(res.response); } catch (err) { - console.log(err); toast.error("Error in fetching accounts!", { className: "toast-container-custom", autoClose: 500, @@ -83,7 +77,7 @@ const TransactionScreen = () => { theme: "dark", }); } - }, []); + }; return (