From 3ff010caf9cd62c537991bcec7ae8b8cb0f41503 Mon Sep 17 00:00:00 2001 From: Muhammad Umar Farooq <92017762+UmarFarooq361@users.noreply.github.com> Date: Sat, 6 May 2023 13:46:59 +0500 Subject: [PATCH] update in ethereum card display when account is connected then account shorted address will be display but when no account is connected then simple text 'Addesss' will be displayed --- client/src/components/Welcome.jsx | 75 ++++++++++++++++++++++--------- package-lock.json | 6 +++ 2 files changed, 60 insertions(+), 21 deletions(-) create mode 100644 package-lock.json diff --git a/client/src/components/Welcome.jsx b/client/src/components/Welcome.jsx index a009dfa..c1122ea 100644 --- a/client/src/components/Welcome.jsx +++ b/client/src/components/Welcome.jsx @@ -7,7 +7,8 @@ import { TransactionContext } from "../context/TransactionContext"; import { shortenAddress } from "../utils/shortenAddress"; import { Loader } from "."; -const companyCommonStyles = "min-h-[70px] sm:px-0 px-2 sm:min-w-[120px] flex justify-center items-center border-[0.5px] border-gray-400 text-sm font-light text-white"; +const companyCommonStyles = + "min-h-[70px] sm:px-0 px-2 sm:min-w-[120px] flex justify-center items-center border-[0.5px] border-gray-400 text-sm font-light text-white"; const Input = ({ placeholder, name, type, value, handleChange }) => ( ( ); const Welcome = () => { - const { currentAccount, connectWallet, handleChange, sendTransaction, formData, isLoading } = useContext(TransactionContext); + const { + currentAccount, + connectWallet, + handleChange, + sendTransaction, + formData, + isLoading, + } = useContext(TransactionContext); const handleSubmit = (e) => { const { addressTo, amount, keyword, message } = formData; @@ -41,7 +49,8 @@ const Welcome = () => { Send Crypto
across the world

- Explore the crypto world. Buy and sell cryptocurrencies easily on Krypto. + Explore the crypto world. Buy and sell cryptocurrencies easily on + Krypto.

{!currentAccount && ( - )} + {isLoading ? ( + + ) : ( + + )} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..126eef0 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "project_web3.0", + "lockfileVersion": 2, + "requires": true, + "packages": {} +}