diff --git a/src/components/MyWallet/WalletHeader.jsx b/src/components/MyWallet/WalletHeader.jsx index 5cfa5a3..40fa543 100644 --- a/src/components/MyWallet/WalletHeader.jsx +++ b/src/components/MyWallet/WalletHeader.jsx @@ -1,4 +1,4 @@ -import {Link} from 'react-router-dom' +import { Link, useLocation, useNavigate } from "react-router-dom"; import Icons from "../Helpers/Icons"; import bank1 from "../../assets/images/bank-1.png"; import bank2 from "../../assets/images/bank-2.png"; @@ -8,180 +8,194 @@ import Accordion from "../Helpers/Accordion"; export default function WalletHeader(props) { // debugger; - //props.myWalletList.result_list - return ( - <> -
-
props.handlerBalance()} - className="flex items-center lg:justify-between justify-center w-full h-full" - > - - - -

- Wallet -

- - - -
-
-
-

- Wallet -

+ //props.myWalletList.result_list + let { pathname } = useLocation(); + let navigate = useNavigate(); + return ( + <> +
+
props.handlerBalance()} + className="flex items-center lg:justify-between justify-center w-full h-full" + > + + + +

Wallet

+ + + +
+
+
+

+ Wallet +

+
+
+
    + {props.myWalletList && + props.myWalletList?.result_list?.length > 0 && + props.myWalletList.result_list.map((value, index) => ( +
  • +
    +
    +
    + +
    +
    +

    + {value.description} +

    +
    +
    +
    +

    + {(value.amount * 0.01).toFixed(2)} {value.code} +

    +

    + {/*(773.69 USD)*/} +

    +
    -
    -
      + + ))} - {props.myWalletList && - props.myWalletList?.result_list?.length > 0 && - props.myWalletList.result_list.map((value, index) => ( -
    • -
      -
      -
      - -
      -
      -

      - {value.description} -

      -
      -
      -
      -

      - {(value.amount*0.01).toFixed(2)} {value.code} -

      -

      - {/*(773.69 USD)*/} -

      -
      -
      -
    • - ))} - - {/*
    • */} - {/*
      */} - {/*
      */} - {/* */} - {/* */} - {/*
      */} - {/*
      */} - {/*

      */} - {/* MetaMask*/} - {/*

      */} - {/*
      */} - {/*
      */} - {/*
      */} - {/*

      */} - {/* 75,320 ETH*/} - {/*

      */} - {/*

      */} - {/* (773.69 USD)*/} - {/*

      */} - {/*
      */} - {/*
    */} - {/*
  • */} - {/*
  • */} - {/*
    */} - {/*
    */} - {/* */} - {/* */} - {/*
    */} - {/*
    */} - {/*

    */} - {/* Coinbase Wallet*/} - {/*

    */} - {/*
    */} - {/*
    */} - {/*
    */} - {/*

    */} - {/* 56,124 ETH*/} - {/*

    */} - {/*

    */} - {/* (773.69 USD)*/} - {/*

    */} - {/*
    */} - {/*
*/} - {/**/} - {/*
  • */} - {/*
    */} - {/*
    */} - {/* */} - {/* */} - {/*
    */} - {/*
    */} - {/*

    */} - {/* Bitski*/} - {/*

    */} - {/*
    */} - {/*
    */} - {/*
    */} - {/*

    */} - {/* 99,123 ETH*/} - {/*

    */} - {/*

    */} - {/* (773.69 USD)*/} - {/*

    */} - {/*
    */} - {/*
  • */} - {/**/} - {/*
  • */} - {/*
    */} - {/*
    */} - {/* */} - {/* */} - {/*
    */} - {/*
    */} - {/*

    */} - {/* WalletConnect*/} - {/*

    */} - {/*
    */} - {/*
    */} - {/*
    */} - {/*

    */} - {/* 43,728 ETH*/} - {/*

    */} - {/*

    */} - {/* (773.69 USD)*/} - {/*

    */} - {/*
    */} - {/*
  • */} - {/**/} - -
    - {/*
    */} + {/**/} + {/*
  • */} + {/*
    */} + {/*
    */} + {/* */} + {/* */} + {/*
    */} + {/*
    */} + {/*

    */} + {/* Coinbase Wallet*/} + {/*

    */} + {/*
    */} + {/*
    */} + {/*
    */} + {/*

    */} + {/* 56,124 ETH*/} + {/*

    */} + {/*

    */} + {/* (773.69 USD)*/} + {/*

    */} + {/*
    */} + {/*
  • */} + {/**/} + {/*
  • */} + {/*
    */} + {/*
    */} + {/* */} + {/* */} + {/*
    */} + {/*
    */} + {/*

    */} + {/* Bitski*/} + {/*

    */} + {/*
    */} + {/*
    */} + {/*
    */} + {/*

    */} + {/* 99,123 ETH*/} + {/*

    */} + {/*

    */} + {/* (773.69 USD)*/} + {/*

    */} + {/*
    */} + {/*
  • */} + {/**/} + {/*
  • */} + {/*
    */} + {/*
    */} + {/* */} + {/* */} + {/*
    */} + {/*
    */} + {/*

    */} + {/* WalletConnect*/} + {/*

    */} + {/*
    */} + {/*
    */} + {/*
    */} + {/*

    */} + {/* 43,728 ETH*/} + {/*

    */} + {/*

    */} + {/* (773.69 USD)*/} + {/*

    */} + {/*
    */} + {/*
  • */} + {/**/} + +
    + {/* */} - Manage -
    - - + { + if (pathname == "/my-wallet") + props.setBalanceDropdown.toggle(); + else navigate("/my-wallet", { replace: true }); + }} + className="w-[122px] h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white" + > + Manage + - {/**/} - {/*
    */} - {/*

    */} - {/* $ 234,435.34*/} - {/*

    */} - {/*
    */} - {/**/} -
    - ); + + + + {/**/} + {/*
    */} + {/*

    */} + {/* $ 234,435.34*/} + {/*

    */} + {/*
    */} + {/**/} +
    + + ); } diff --git a/src/components/Partials/Header.jsx b/src/components/Partials/Header.jsx index ef85dd6..2df00a4 100644 --- a/src/components/Partials/Header.jsx +++ b/src/components/Partials/Header.jsx @@ -1,5 +1,5 @@ import React, { useContext,useState, useEffect } from "react"; -import { Link } from "react-router-dom"; +import { Link, useLocation } from "react-router-dom"; import bank1 from "../../assets/images/bank-1.png"; import bank2 from "../../assets/images/bank-2.png"; import bank3 from "../../assets/images/bank-3.png"; @@ -91,6 +91,15 @@ export default function Header({ logoutModalHandler, sidebarHandler }) { setToggleNotification.toggle() } + // getting the location of head + let {pathname} = useLocation() + + const handleWalletBtn = () => { + if (pathname === "/my-wallet"){ + setbalanceValue.set(false) + } else return balanceDropdown + } + // User Profile let {firstname, lastname, email, profile_pic} = userDetails let userEmail = email.split('@')[0] @@ -234,7 +243,8 @@ export default function Header({ logoutModalHandler, sidebarHandler }) { myWalletList={myWalletList} handlerBalance={handlerBalance} balanceDropdown={balanceDropdown} - addMoneyHandler={addMoneyHandler} /> + addMoneyHandler={addMoneyHandler} + setBalanceDropdown = {setbalanceValue} /> {/* notification */}