MCPcopy
hub / github.com/adrianhajdin/project_web3.0 / TransactionsCard

Function TransactionsCard

client/src/components/Transactions.jsx:9–48  ·  view source on GitHub ↗
({ addressTo, addressFrom, timestamp, message, keyword, amount, url })

Source from the content-addressed store, hash-verified

7import { shortenAddress } from "../utils/shortenAddress";
8
9const TransactionsCard = ({ addressTo, addressFrom, timestamp, message, keyword, amount, url }) => {
10 const gifUrl = useFetch({ keyword });
11
12 return (
13 <div className="bg-[#181918] m-4 flex flex-1
14 2xl:min-w-[450px]
15 2xl:max-w-[500px]
16 sm:min-w-[270px]
17 sm:max-w-[300px]
18 min-w-full
19 flex-col p-3 rounded-md hover:shadow-2xl"
20 >
21 <div className="flex flex-col items-center w-full mt-3">
22 <div className="display-flex justify-start w-full mb-6 p-2">
23 <a href={`https://ropsten.etherscan.io/address/${addressFrom}`} target="_blank" rel="noreferrer">
24 <p className="text-white text-base">From: {shortenAddress(addressFrom)}</p>
25 </a>
26 <a href={`https://ropsten.etherscan.io/address/${addressTo}`} target="_blank" rel="noreferrer">
27 <p className="text-white text-base">To: {shortenAddress(addressTo)}</p>
28 </a>
29 <p className="text-white text-base">Amount: {amount} ETH</p>
30 {message && (
31 <>
32 <br />
33 <p className="text-white text-base">Message: {message}</p>
34 </>
35 )}
36 </div>
37 <img
38 src={gifUrl || url}
39 alt="nature"
40 className="w-full h-64 2xl:h-96 rounded-md shadow-lg object-cover"
41 />
42 <div className="bg-black p-3 px-5 w-max rounded-3xl -mt-5 shadow-2xl">
43 <p className="text-[#37c7da] font-bold">{timestamp}</p>
44 </div>
45 </div>
46 </div>
47 );
48};
49
50const Transactions = () => {
51 const { transactions, currentAccount } = useContext(TransactionContext);

Callers

nothing calls this directly

Calls 2

shortenAddressFunction · 0.90
useFetchFunction · 0.85

Tested by

no test coverage detected