diff --git a/src/Constants/Constants.js b/src/Constants/Constants.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/Constants/Constants.js @@ -0,0 +1 @@ + diff --git a/src/assets/images/search.png b/src/assets/images/search.png new file mode 100644 index 0000000..f7679e2 Binary files /dev/null and b/src/assets/images/search.png differ diff --git a/src/components/AmountCard/AmountCard.jsx b/src/components/AmountCard/AmountCard.jsx index f9050fb..ee56ff4 100644 --- a/src/components/AmountCard/AmountCard.jsx +++ b/src/components/AmountCard/AmountCard.jsx @@ -13,8 +13,9 @@ import { FaFileAlt, FaShoppingCart } from "react-icons/fa"; import { FaClipboard, FaGlobe, FaWallet } from "react-icons/fa6"; import { PiWalletFill } from "react-icons/pi"; + const AmountCard = () => { - const { colorMode, toggleColorMode } = useColorMode(); + const { colorMode} = useColorMode(); const statsData = [ { @@ -61,6 +62,7 @@ const AmountCard = () => { { - const { colorMode, toggleColorMode } = useColorMode(); + const { colorMode} = useColorMode(); const { transactions } = useContext(GlobalStateContext); + + function copyToClipboard(text) { + navigator.clipboard + .writeText(text) + .then(() => { + // console.log('Text copied to clipboard'); + // alert('Text copied to clipboard'); + toast({ + render: () => ( + + ), + }); + }) + .catch((err) => { + console.error("Failed to copy text: ", err); + }); + } + + return ( @@ -46,13 +66,17 @@ const LatestTransactions = () => { Sender : - - {transaction.sender} - + + {transaction.sender} + copyToClipboard(transaction.sender)} /> + Receiver : - {transaction.receiver} + + {transaction.receiver} + copyToClipboard(transaction.receiver)} /> + { Transaction type : - {transaction.transactionType} + {transaction.transactionType} Subnet ID/Main net : - {transaction.subnetID} + + {transaction.subnetID} + diff --git a/src/components/RelatedTransactions/RelatedTransactions.jsx b/src/components/RelatedTransactions/RelatedTransactions.jsx new file mode 100644 index 0000000..1ad2846 --- /dev/null +++ b/src/components/RelatedTransactions/RelatedTransactions.jsx @@ -0,0 +1,23 @@ +import { Box, Container, Heading, HStack, Image, Text, useColorMode } from '@chakra-ui/react' +import React from 'react' +import Search from '../../assets/images/search.png' + +const RelatedTransactions = () => { + const { colorMode} = useColorMode(); + + return ( + + + + Related transactions info + + + + No records found + + + + ) +} + +export default RelatedTransactions diff --git a/src/components/ToastBox.jsx b/src/components/ToastBox.jsx new file mode 100644 index 0000000..bbddff2 --- /dev/null +++ b/src/components/ToastBox.jsx @@ -0,0 +1,24 @@ + +import { Box, Text } from "@chakra-ui/react"; +import React from "react"; +import { FaCheck } from "react-icons/fa"; +import { IoWarningOutline } from "react-icons/io5"; + +const ToastBox = ({ message, status }) => { + return ( + + + {status === "error" || status === "warn" ? : } + {message} + + ); +}; + +export default ToastBox; diff --git a/src/index.css b/src/index.css index f2d0c7b..4271550 100644 --- a/src/index.css +++ b/src/index.css @@ -59,6 +59,11 @@ button:focus-visible { outline: 4px auto -webkit-focus-ring-color; } +a:hover { + color: inherit !important; + font-weight: inherit; +} + @media (prefers-color-scheme: light) { :root { color: #213547; diff --git a/src/pages/DidInfo.jsx b/src/pages/DidInfo.jsx new file mode 100644 index 0000000..736764a --- /dev/null +++ b/src/pages/DidInfo.jsx @@ -0,0 +1,54 @@ +import { + Box, + Container, + Divider, + Heading, + HStack, + Text, + useColorMode, + } from "@chakra-ui/react"; + import React from "react"; + import { MdContentCopy} from "react-icons/md"; + import { Link } from "react-router-dom"; + import RelatedTransactions from "../components/RelatedTransactions/RelatedTransactions"; + import bannerImage from "../assets/images/bannerImg.png"; + + const DidInfo = () => { + const { colorMode } = useColorMode(); + + return ( + <> + + + + DID Info + + + DID + + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + + + Balance + + $ 10000.12345 + + copyToClipboard(transaction.sender)}/> + + + + + + + + ); + }; + + export default DidInfo; + \ No newline at end of file diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx index e58f376..78d54d9 100644 --- a/src/pages/Home.jsx +++ b/src/pages/Home.jsx @@ -45,7 +45,7 @@ const Home = () => { > { border: `1px solid ${ colorMode === "light" ? "#230A79" : "#393939" }`, + borderLeft:"0px", + borderRight:"0px", outline: "0px", }} _focus={{ outline: "none" }} @@ -118,7 +120,7 @@ const Home = () => { justifyContent={"space-between"} alignItems={"center"} > - Transaction History + Transaction History { const { overview } = useContext(GlobalStateContext); - const { colorMode, toggleColorMode } = useColorMode(); + const { colorMode} = useColorMode(); return ( - + { + const { colorMode } = useColorMode(); + + return ( + <> + + + + Smart Contract Info + + + Smart Contract Token + + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + + + Transaction ID + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + + Block + + + + Block ID: + + + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz + !"§ $%& + + + copyToClipboard(transaction.sender)}/> + + + + + + Block Hash: + + + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz!"§ $%& + + + copyToClipboard(transaction.receiver)}/> + + + + Network + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + + + Executor + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + Deployer + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + Creator + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + + + + + Pledge amount + $ 100 + + + Timestamp + 18 hours ago, 29/07/2024 + + + Quorum list + + bafybmibqle4w7k6acjbznk6ksapiyfwff6vwbwyaqx25wmzagt3awzbeky + + copyToClipboard(transaction.sender)}/> + + + + + Pledge Token + + bafybmibqle4w7k6acjbznk6ksapiyfwff6vwbwyaqx25wmzagt3awzbeky + + copyToClipboard(transaction.sender)}/> + + + + + + + + ); + }; + + export default Transaction; + \ No newline at end of file diff --git a/src/pages/Subnet.jsx b/src/pages/Subnet.jsx index 38a3def..964da80 100644 --- a/src/pages/Subnet.jsx +++ b/src/pages/Subnet.jsx @@ -5,6 +5,7 @@ import LatestTransactions from "../components/LatestTransactions/LatestTransacti import GlobalStateContext from "../Contexts/GlobalStateContext"; import Pagination from "../components/Pagination"; import { MdOutlineErrorOutline } from "react-icons/md"; +import bannerImage from "../assets/images/bannerImg.png"; const Subnet = () => { @@ -12,7 +13,7 @@ const Subnet = () => { const { colorMode, toggleColorMode } = useColorMode(); return ( - + { + + const { overview } = useContext(GlobalStateContext); + const { colorMode} = useColorMode(); + + function copyToClipboard(text) { + navigator.clipboard + .writeText(text) + .then(() => { + // console.log('Text copied to clipboard'); + // alert('Text copied to clipboard'); + toast({ + render: () => ( + + ), + }); + }) + .catch((err) => { + console.error("Failed to copy text: ", err); + }); + } + + return ( + + + + Main Net - A1B2C3D4E5 + + + View total number of records + + + + + + + + Sr. no + + + Transactions + + + + {overview.map((transaction, index) => ( + + + {index + 1}. + + + + + {transaction.description} + + + + Sender : + + + {transaction.sender} + copyToClipboard(transaction.sender)} /> + + + + + Receiver : + + + {transaction.receiver} + copyToClipboard(transaction.receiver)} /> + + + + + + Smart contract ID dd : + + + {transaction.contract} + + + + + Date and Time Stamp : + + + {transaction.date} + + + + + Amount: + + + {transaction.amount} + + + + + + + + + Transaction type : + + + {transaction.transactionType} + + + + + + + + ))} + + + + + + ); +}; + +export default SubnetInner; diff --git a/src/pages/Transaction.jsx b/src/pages/Transaction.jsx new file mode 100644 index 0000000..8447cd8 --- /dev/null +++ b/src/pages/Transaction.jsx @@ -0,0 +1,132 @@ +import { + Box, + Container, + Divider, + Heading, + HStack, + Text, + useColorMode, +} from "@chakra-ui/react"; +import React from "react"; +import { MdContentCopy} from "react-icons/md"; +import { Link } from "react-router-dom"; +import RelatedTransactions from "../components/RelatedTransactions/RelatedTransactions"; +import bannerImage from "../assets/images/bannerImg.png"; + +const Transaction = () => { + const { colorMode } = useColorMode(); + + return ( + <> + + + + Transaction Info + + + Transaction ID + + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + + + + Super Title + + + Token ID : + + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz!"§ $%& + + + copyToClipboard(transaction.sender)}/> + + + + + + Block ID : + + + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz!"§ $%& + + + copyToClipboard(transaction.receiver)}/> + + + + + + Network + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + Sender + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + Receiver + + abc5def6ghi7jkl8mno9pqrs2tuv5wxyzabcdefghijklmnopqrs5674577tuvwxyz !"§ $%& + + copyToClipboard(transaction.sender)}/> + + + + + + + Amount + $ 100 + + + $ 100 + 18 hours ago, 29/07/2024 + + + Quorum list + + bafybmibqle4w7k6acjbznk6ksapiyfwff6vwbwyaqx25wmzagt3awzbeky + + copyToClipboard(transaction.sender)}/> + + + + + Pledge Token + + bafybmibqle4w7k6acjbznk6ksapiyfwff6vwbwyaqx25wmzagt3awzbeky + + copyToClipboard(transaction.sender)}/> + + + + + + + + ); +}; + +export default Transaction; diff --git a/src/routes/_routes.jsx b/src/routes/_routes.jsx index 9facc83..ad1ef6d 100644 --- a/src/routes/_routes.jsx +++ b/src/routes/_routes.jsx @@ -2,6 +2,10 @@ import Home from "../pages/Home"; import MainNet from "../pages/MainNet"; import Subnet from "../pages/Subnet"; +import SubnetInner from "../pages/SubnetInner"; +import Transaction from "../pages/Transaction"; +import SmartContract from "../pages/SmartContract"; +import DidInfo from "../pages/DidInfo"; export const route = [ { @@ -16,4 +20,20 @@ export const route = [ path: "/subnet", element: , }, + { + path: "/subnet-inner", + element: , + }, + { + path: "/transaction", + element: , + }, + { + path: "/smart-contract", + element: , + }, + { + path: "/did-info", + element: , + }, ];