From cf218ef77649e0168a640f00866dad9732986f43 Mon Sep 17 00:00:00 2001 From: Tomasz Awramski Date: Fri, 8 Mar 2024 16:25:08 +0100 Subject: [PATCH] refactor(gui): gui structure change to make adding more ledgers easier - change folder structure - each ledger-plugin now has separate folder and configuration - added status page for available plugins Signed-off-by: Tomasz Awramski --- .../cacti-ledger-browser-react/index.html | 2 +- .../cacti-ledger-browser-react/src/main.tsx | 266 - .../src/main/typescript/apps/cacti/index.ts | 20 + .../apps/cacti/pages/status-page.tsx | 61 + .../eth}/components/Chart/Chart.module.css | 0 .../apps/eth}/components/Chart/Chart.tsx | 0 .../apps/eth}/components/Chart/LineChart.tsx | 0 .../components/TokenHeader/TokenAccount.tsx | 0 .../TokenHeader/TokenHeader.module.css | 0 .../components/TokenHeader/TokenHeader.tsx | 0 .../src/main/typescript/apps/eth/index.tsx | 213 + .../eth/pages}/Accounts/Accounts.module.css | 0 .../apps/eth/pages}/Accounts/Accounts.tsx | 4 +- .../apps/eth/pages}/Blocks/Blocks.module.css | 0 .../apps/eth/pages}/Blocks/Blocks.tsx | 4 +- .../eth/pages}/Dashboard/Dashboard.module.css | 0 .../apps/eth/pages}/Dashboard/Dashboard.tsx | 8 +- .../apps/eth/pages}/Details/BlockDetails.tsx | 4 +- .../eth/pages}/Details/Details.module.css | 0 .../apps/eth/pages}/Details/TokenDetails.tsx | 6 +- .../Details/TokenTransactionDetails.tsx | 6 +- .../eth/pages}/Details/TransactionDetails.tsx | 6 +- .../apps/eth/pages}/ERC20/ERC20.module.css | 0 .../apps/eth/pages}/ERC20/ERC20.tsx | 10 +- .../apps/eth/pages}/ERC721/ERC721.module.css | 0 .../apps/eth/pages}/ERC721/ERC721.tsx | 6 +- .../SingleTokenHistory.module.css | 0 .../SingleTokenHistory/SingleTokenHistory.tsx | 14 +- .../Transactions/Transactions.module.css | 0 .../eth/pages}/Transactions/Transactions.tsx | 6 +- .../components/TokenHeader/TokenAccount.tsx | 18 + .../TokenHeader/TokenHeader.module.css | 57 + .../components/TokenHeader/TokenHeader.tsx | 51 + .../src/main/typescript/apps/fabric/index.tsx | 93 + .../BlocksFabric/BlocksFabric.module.css | 0 .../pages}/BlocksFabric/BlocksFabric.tsx | 6 +- .../pages}/DashFabric/DashFabric.module.css | 0 .../fabric/pages}/DashFabric/DashFabric.tsx | 8 +- .../pages}/FabricBlock/FabricBlock.module.css | 0 .../fabric/pages}/FabricBlock/FabricBlock.tsx | 2 +- .../FabricTransaction.module.css | 0 .../FabricTransaction/FabricTransaction.tsx | 4 +- .../TransactionsFabric.module.css | 0 .../TransactionsFabric/TransactionsFabric.tsx | 6 +- .../src/main/typescript/common/config.tsx | 20 + .../typescript/common}/supabase-client.tsx | 0 .../typescript/common}/supabase-types.ts | 0 .../typescript/common}/token-standards.ts | 0 .../AccountCard/AccountCard.module.css | 0 .../components/AccountCard/AccountCard.tsx | 0 .../components/AppShell}/Home.module.css | 0 .../typescript/components/AppShell}/Home.tsx | 10 +- .../AppShell/LedgerSelector.module.css} | 0 .../components/AppShell/LedgerSelector.tsx} | 6 +- .../components/AppShell}/Root.module.css | 0 .../typescript/components/AppShell}/Root.tsx | 7 +- .../components/BlockCard/BlockCard.module.css | 0 .../components/BlockCard/BlockCard.tsx | 0 .../components/TokenHeader/TokenAccount.tsx | 18 + .../TokenHeader/TokenHeader.module.css | 57 + .../components/TokenHeader/TokenHeader.tsx | 50 + .../components/ui}/Button.module.css | 0 .../typescript/components/ui}/Button.tsx | 0 .../components/ui}/CardWrapper.module.css | 0 .../typescript/components/ui}/CardWrapper.tsx | 10 +- .../typescript/components/ui}/CustomTable.css | 0 .../components/ui}/CustomTable.module.css | 0 .../typescript/components/ui}/CustomTable.tsx | 0 .../EmptyTablePlaceholder.module.css | 0 .../EmptyTablePlaceholder.tsx | 0 .../typescript/components/ui}/Menu.module.css | 0 .../typescript/components/ui}/Menu.tsx | 6 +- .../components/ui}/Pagination.module.css | 0 .../typescript/components/ui}/Pagination.tsx | 2 +- .../components/ui}/Search.module.css | 0 .../typescript/components/ui}/Search.tsx | 0 .../src/main/typescript/main.tsx | 37 + .../src/{ => main/typescript}/vite-env.d.ts | 0 .../cacti-ledger-browser-react/tsconfig.json | 30 +- .../{vite.config.ts => vite.config.mts} | 0 .../supabase-all-in-one/src/run-supabase.sh | 14 +- yarn.lock | 13772 ++++++---------- 82 files changed, 5536 insertions(+), 9384 deletions(-) delete mode 100644 packages/cacti-ledger-browser-react/src/main.tsx create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/apps/cacti/index.ts create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/apps/cacti/pages/status-page.tsx rename packages/cacti-ledger-browser-react/src/{ => main/typescript/apps/eth}/components/Chart/Chart.module.css (100%) rename packages/cacti-ledger-browser-react/src/{ => main/typescript/apps/eth}/components/Chart/Chart.tsx (100%) rename packages/cacti-ledger-browser-react/src/{ => main/typescript/apps/eth}/components/Chart/LineChart.tsx (100%) rename packages/cacti-ledger-browser-react/src/{ => main/typescript/apps/eth}/components/TokenHeader/TokenAccount.tsx (100%) rename packages/cacti-ledger-browser-react/src/{ => main/typescript/apps/eth}/components/TokenHeader/TokenHeader.module.css (100%) rename packages/cacti-ledger-browser-react/src/{ => main/typescript/apps/eth}/components/TokenHeader/TokenHeader.tsx (100%) create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/index.tsx rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Accounts/Accounts.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Accounts/Accounts.tsx (91%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Blocks/Blocks.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Blocks/Blocks.tsx (91%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Dashboard/Dashboard.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Dashboard/Dashboard.tsx (89%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Details/BlockDetails.tsx (92%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Details/Details.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Details/TokenDetails.tsx (89%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Details/TokenTransactionDetails.tsx (88%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Details/TransactionDetails.tsx (91%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/ERC20/ERC20.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/ERC20/ERC20.tsx (83%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/ERC721/ERC721.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/ERC721/ERC721.tsx (92%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/SingleTokenHistory/SingleTokenHistory.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/SingleTokenHistory/SingleTokenHistory.tsx (87%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Transactions/Transactions.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/eth => main/typescript/apps/eth/pages}/Transactions/Transactions.tsx (88%) create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenAccount.tsx create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenHeader.module.css create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenHeader.tsx create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/index.tsx rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/BlocksFabric/BlocksFabric.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/BlocksFabric/BlocksFabric.tsx (88%) rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/DashFabric/DashFabric.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/DashFabric/DashFabric.tsx (90%) rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/FabricBlock/FabricBlock.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/FabricBlock/FabricBlock.tsx (96%) rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/FabricTransaction/FabricTransaction.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/FabricTransaction/FabricTransaction.tsx (96%) rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/TransactionsFabric/TransactionsFabric.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/fabric => main/typescript/apps/fabric/pages}/TransactionsFabric/TransactionsFabric.tsx (88%) create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/common/config.tsx rename packages/cacti-ledger-browser-react/src/{ => main/typescript/common}/supabase-client.tsx (100%) rename packages/cacti-ledger-browser-react/src/{schema => main/typescript/common}/supabase-types.ts (100%) rename packages/cacti-ledger-browser-react/src/{schema => main/typescript/common}/token-standards.ts (100%) rename packages/cacti-ledger-browser-react/src/{ => main/typescript}/components/AccountCard/AccountCard.module.css (100%) rename packages/cacti-ledger-browser-react/src/{ => main/typescript}/components/AccountCard/AccountCard.tsx (100%) rename packages/cacti-ledger-browser-react/src/{pages/shared/Home => main/typescript/components/AppShell}/Home.module.css (100%) rename packages/cacti-ledger-browser-react/src/{pages/shared/Home => main/typescript/components/AppShell}/Home.tsx (57%) rename packages/cacti-ledger-browser-react/src/{components/UI/Select/Select.module.css => main/typescript/components/AppShell/LedgerSelector.module.css} (100%) rename packages/cacti-ledger-browser-react/src/{components/UI/Select/Select.tsx => main/typescript/components/AppShell/LedgerSelector.tsx} (94%) rename packages/cacti-ledger-browser-react/src/{routes => main/typescript/components/AppShell}/Root.module.css (100%) rename packages/cacti-ledger-browser-react/src/{routes => main/typescript/components/AppShell}/Root.tsx (81%) rename packages/cacti-ledger-browser-react/src/{ => main/typescript}/components/BlockCard/BlockCard.module.css (100%) rename packages/cacti-ledger-browser-react/src/{ => main/typescript}/components/BlockCard/BlockCard.tsx (100%) create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenAccount.tsx create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenHeader.module.css create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenHeader.tsx rename packages/cacti-ledger-browser-react/src/{components/UI/Button => main/typescript/components/ui}/Button.module.css (100%) rename packages/cacti-ledger-browser-react/src/{components/UI/Button => main/typescript/components/ui}/Button.tsx (100%) rename packages/cacti-ledger-browser-react/src/{components/CardWrapper => main/typescript/components/ui}/CardWrapper.module.css (100%) rename packages/cacti-ledger-browser-react/src/{components/CardWrapper => main/typescript/components/ui}/CardWrapper.tsx (93%) rename packages/cacti-ledger-browser-react/src/{components/UI/CustomTable => main/typescript/components/ui}/CustomTable.css (100%) rename packages/cacti-ledger-browser-react/src/{components/UI/CustomTable => main/typescript/components/ui}/CustomTable.module.css (100%) rename packages/cacti-ledger-browser-react/src/{components/UI/CustomTable => main/typescript/components/ui}/CustomTable.tsx (100%) rename packages/cacti-ledger-browser-react/src/{components/UI/CustomTable => main/typescript/components/ui}/EmptyTablePlaceholder/EmptyTablePlaceholder.module.css (100%) rename packages/cacti-ledger-browser-react/src/{components/UI/CustomTable => main/typescript/components/ui}/EmptyTablePlaceholder/EmptyTablePlaceholder.tsx (100%) rename packages/cacti-ledger-browser-react/src/{components/UI/Menu => main/typescript/components/ui}/Menu.module.css (100%) rename packages/cacti-ledger-browser-react/src/{components/UI/Menu => main/typescript/components/ui}/Menu.tsx (93%) rename packages/cacti-ledger-browser-react/src/{components/Pagination => main/typescript/components/ui}/Pagination.module.css (100%) rename packages/cacti-ledger-browser-react/src/{components/Pagination => main/typescript/components/ui}/Pagination.tsx (97%) rename packages/cacti-ledger-browser-react/src/{components/UI/Search => main/typescript/components/ui}/Search.module.css (100%) rename packages/cacti-ledger-browser-react/src/{components/UI/Search => main/typescript/components/ui}/Search.tsx (100%) create mode 100644 packages/cacti-ledger-browser-react/src/main/typescript/main.tsx rename packages/cacti-ledger-browser-react/src/{ => main/typescript}/vite-env.d.ts (100%) rename packages/cacti-ledger-browser-react/{vite.config.ts => vite.config.mts} (100%) diff --git a/packages/cacti-ledger-browser-react/index.html b/packages/cacti-ledger-browser-react/index.html index d847393d789..066d32e3cba 100644 --- a/packages/cacti-ledger-browser-react/index.html +++ b/packages/cacti-ledger-browser-react/index.html @@ -10,7 +10,7 @@
- + \ No newline at end of file diff --git a/packages/cacti-ledger-browser-react/src/main.tsx b/packages/cacti-ledger-browser-react/src/main.tsx deleted file mode 100644 index 79702c6575e..00000000000 --- a/packages/cacti-ledger-browser-react/src/main.tsx +++ /dev/null @@ -1,266 +0,0 @@ -import React from "react"; -import ReactDOM from "react-dom/client"; -import { createBrowserRouter, Outlet, RouterProvider } from "react-router-dom"; -import Root from "./routes/Root.tsx"; -import Dashboard from "./pages/eth/Dashboard/Dashboard.tsx"; - -import Blocks from "./pages/eth/Blocks/Blocks.tsx"; -import Transactions from "./pages/eth/Transactions/Transactions.tsx"; -import Accounts from "./pages/eth/Accounts/Accounts.tsx"; -import BlockDetails from "./pages/eth/Details/BlockDetails.tsx"; -import TokenTransactionDetails from "./pages/eth/Details/TokenTransactionDetails.tsx"; -import TokenDetails from "./pages/eth/Details/TokenDetails.tsx"; -import TransactionDetails from "./pages/eth/Details/TransactionDetails.tsx"; -import ERC20 from "./pages/eth/ERC20/ERC20.tsx"; -import SingleTokenHistory from "./pages/eth/SingleTokenHistory/SingleTokenHistory.tsx"; -import ERC721 from "./pages/eth/ERC721/ERC721.tsx"; -import TransactionsFabric from "./pages/fabric/TransactionsFabric/TransactionsFabric.tsx"; -import DashFabric from "./pages/fabric/DashFabric/DashFabric.tsx"; -import BlocksFabric from "./pages/fabric/BlocksFabric/BlocksFabric.tsx"; -import FabricTransaction from "./pages/fabric/FabricTransaction/FabricTransaction.tsx"; -import FabricBlock from "./pages/fabric/FabricBlock/FabricBlock.tsx"; - -const router = createBrowserRouter([ - { - path: "/", - element: , - children: [ - { - path: "eth", - element: ( -
- -
- ), - children: [ - // MAIN - { path: "dashboard", element: }, - { - path: "blocks", - element: ( -
- blocks - -
- ), - }, - { - path: "transactions", - element: ( -
- transactions - -
- ), - }, - // ACCOUNTS - { - path: "accounts", - element: , - children: [ - { - path: ":standard", - element: ( -
- -
- ), - }, - ], - }, - //BLOCK - { - path: "block-details", - element: , - children: [ - { - path: ":number", - element: ( -
- -
- ), - }, - ], - }, - // TOKEN TRANSACTION DETAILS - { - path: "token-txn-details", - element: ( -
- -
- ), - children: [ - { - path: ":standard/:address", - element: ( -
- -
- ), - }, - ], - }, - // TOKEN DETAILS - { - path: "token-detail", - element: ( -
- -
- ), - children: [ - { - path: ":standard/:address", - element: ( -
- -
- ), - }, - ], - }, - // TRANSACTION DETAILS - { - path: "txn-details", - element: ( -
- -
- ), - children: [ - { - path: ":id", - element: ( -
- -
- ), - }, - ], - }, - // ERC tokens - { - path: "erc20", - element: ( -
- -
- ), - children: [ - { - path: ":account", - element: ( -
- -
- ), - }, - { - path: "trend/:account/:address", - element: ( -
- -
- ), - }, - ], - }, - { - path: "erc721", - element: ( -
- -
- ), - children: [ - { - path: ":account", - element: ( -
- -
- ), - }, - ], - }, - ], - }, - // FABRIC ROUTES - { - path: "fabric", - element: , - children: [ - { - path: "dashboard", - element: ( -
- -
- ), - }, - { - path: "transactions", - element: ( -
- -
- ), - }, - { - path: "blocks", - element: ( -
- -
- ), - }, - { - path: "txn-details", - element: ( -
- -
- ), - children: [ - { - path: ":id", - element: ( -
- -
- ), - }, - ], - }, - { - path: "block-details", - element: ( -
- -
- ), - children: [ - { - path: ":id", - element: ( -
- block-details/:id - -
- ), - }, - ], - }, - ], - }, - ], - }, -]); - -ReactDOM.createRoot(document.getElementById("root")!).render( - // - , - // , -); diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/apps/cacti/index.ts b/packages/cacti-ledger-browser-react/src/main/typescript/apps/cacti/index.ts new file mode 100644 index 00000000000..d02ff4a5d76 --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/cacti/index.ts @@ -0,0 +1,20 @@ +import StatusPage from "./pages/status-page"; + +const appConfig = { + name: "Cacti", + url: "cacti", + menuEntries: [ + { + title: "Plugin Status", + url: "/", + }, + ], + routes: [ + { + path: "/", + component: StatusPage, + }, + ], +}; + +export default appConfig; diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/apps/cacti/pages/status-page.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/cacti/pages/status-page.tsx new file mode 100644 index 00000000000..22c93c7bb9a --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/cacti/pages/status-page.tsx @@ -0,0 +1,61 @@ +import { useEffect, useState } from "react"; +import { supabase } from "../../../common/supabase-client"; +import CardWrapper from "../../../components/ui/CardWrapper"; + +function StatusPage() { + const [getPluginStatus, setPluginStatuse] = useState([]); + + const fetchPluginStatus = async () => { + try { + const { data, error } = await supabase.from("plugin_status").select(); + if (error) { + throw new Error( + `Could not get plugin statuses from the DB: ${error.message}`, + ); + } + + if (data) { + setPluginStatuse( + data.map((p) => { + return { + ...p, + is_schema_initialized: p.is_schema_initialized + ? "Setup complete" + : "No schema", + }; + }), + ); + } + } catch (error) { + console.error("Error when fetching plugin statuses:", error); + } + }; + + useEffect(() => { + fetchPluginStatus(); + }, []); + + return ( +
+ +
+ ); +} + +export default StatusPage; diff --git a/packages/cacti-ledger-browser-react/src/components/Chart/Chart.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/Chart/Chart.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/Chart/Chart.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/Chart/Chart.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/Chart/Chart.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/Chart/Chart.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/Chart/Chart.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/Chart/Chart.tsx diff --git a/packages/cacti-ledger-browser-react/src/components/Chart/LineChart.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/Chart/LineChart.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/Chart/LineChart.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/Chart/LineChart.tsx diff --git a/packages/cacti-ledger-browser-react/src/components/TokenHeader/TokenAccount.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/TokenHeader/TokenAccount.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/TokenHeader/TokenAccount.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/TokenHeader/TokenAccount.tsx diff --git a/packages/cacti-ledger-browser-react/src/components/TokenHeader/TokenHeader.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/TokenHeader/TokenHeader.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/TokenHeader/TokenHeader.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/TokenHeader/TokenHeader.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/TokenHeader/TokenHeader.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/TokenHeader/TokenHeader.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/TokenHeader/TokenHeader.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/components/TokenHeader/TokenHeader.tsx diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/index.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/index.tsx new file mode 100644 index 00000000000..3c293a2594f --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/index.tsx @@ -0,0 +1,213 @@ +import { Outlet } from "react-router-dom"; +import TokenDetails from "./pages/Details/TokenDetails"; +import Dashboard from "./pages/Dashboard/Dashboard"; +import Blocks from "./pages/Blocks/Blocks"; +import Transactions from "./pages/Transactions/Transactions"; +import Accounts from "./pages/Accounts/Accounts"; +import TokenTransactionDetails from "./pages/Details/TokenTransactionDetails"; +import TransactionDetails from "./pages/Details/TransactionDetails"; +import ERC20 from "./pages/ERC20/ERC20"; +import SingleTokenHistory from "./pages/SingleTokenHistory/SingleTokenHistory"; +import ERC721 from "./pages/ERC721/ERC721"; +import BlockDetails from "./pages/Details/BlockDetails"; + +interface AppConfig { + name: string; + url: string; + pluginName: string; + menuEntries: { + title: string; + url: string; + }[]; + routes: any; +} + +const ethConfig: AppConfig = { + name: "Ethereum", + url: "eth", + pluginName: "PluginPersistenceEthereum", + menuEntries: [ + { + title: "Dashboard", + url: "/", + }, + { + title: "ERC20", + url: "/accounts/erc20", + }, + { + title: "ERC721 (NFT)", + url: "/accounts/erc721", + }, + ], + routes: [ + // MAIN + { + path: "dashboard", + element: ( +
+ +
+ ), + }, + { + path: "blocks", + element: ( +
+ +
+ ), + }, + { + path: "transactions", + + element: ( +
+ +
+ ), + }, + // ACCOUNTS + { + path: "accounts", + element: ( +
+ +
+ ), + children: [ + { + path: ":standard", + element: ( +
+ +
+ ), + }, + ], + }, + //BLOCK + { + path: "block-details", + element: ( +
+ +
+ ), + children: [ + { + path: ":number", + element: ( +
+ +
+ ), + }, + ], + }, + // TOKEN TRANSACTION DETAILS + { + path: "token-txn-details", + element: ( +
+ +
+ ), + children: [ + { + path: ":standard/:address", + element: ( +
+ +
+ ), + }, + ], + }, + // TOKEN DETAILS + { + path: "token-details", + element: ( +
+ +
+ ), + children: [ + { + path: ":standard/:address", + element: ( +
+ +
+ ), + }, + ], + }, + // TRANSACTION DETAILS + { + path: "txn-details", + element: ( +
+ +
+ ), + children: [ + { + path: ":id", + element: ( +
+ +
+ ), + }, + ], + }, + // ERC tokens + { + path: "erc20", + element: ( +
+ +
+ ), + children: [ + { + path: ":account", + element: ( +
+ +
+ ), + }, + { + path: "trend/:account/:address", + element: ( +
+ +
+ ), + }, + ], + }, + { + path: "erc721", + element: ( +
+ +
+ ), + children: [ + { + path: ":account", + element: ( +
+ +
+ ), + }, + ], + }, + ], +}; + +export default ethConfig; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Accounts/Accounts.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Accounts/Accounts.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/eth/Accounts/Accounts.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Accounts/Accounts.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Accounts/Accounts.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Accounts/Accounts.tsx similarity index 91% rename from packages/cacti-ledger-browser-react/src/pages/eth/Accounts/Accounts.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Accounts/Accounts.tsx index 96f748056ba..6d04fe4cf3f 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/Accounts/Accounts.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Accounts/Accounts.tsx @@ -1,5 +1,5 @@ -import { supabase } from "../../../supabase-client"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; +import { supabase } from "../../../../common/supabase-client"; +import CardWrapper from "../../../../components/ui/CardWrapper"; import { useNavigate, useParams } from "react-router-dom"; import { useEffect, useState } from "react"; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Blocks/Blocks.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Blocks/Blocks.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/eth/Blocks/Blocks.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Blocks/Blocks.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Blocks/Blocks.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Blocks/Blocks.tsx similarity index 91% rename from packages/cacti-ledger-browser-react/src/pages/eth/Blocks/Blocks.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Blocks/Blocks.tsx index 6ee261ee456..c54552e57aa 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/Blocks/Blocks.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Blocks/Blocks.tsx @@ -1,6 +1,6 @@ -import { supabase } from "../../../supabase-client"; +import { supabase } from "../../../../common/supabase-client"; import { useNavigate } from "react-router-dom"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; +import CardWrapper from "../../../../components/ui/CardWrapper"; import { Block } from "../../../schema/supabase-types"; import styles from "./Blocks.module.css"; import { useEffect, useState } from "react"; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Dashboard/Dashboard.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Dashboard/Dashboard.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/eth/Dashboard/Dashboard.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Dashboard/Dashboard.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Dashboard/Dashboard.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Dashboard/Dashboard.tsx similarity index 89% rename from packages/cacti-ledger-browser-react/src/pages/eth/Dashboard/Dashboard.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Dashboard/Dashboard.tsx index 834e1ee03c9..6b6c637658e 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/Dashboard/Dashboard.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Dashboard/Dashboard.tsx @@ -1,11 +1,11 @@ import { useNavigate } from "react-router-dom"; import { useEffect, useState } from "react"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; -import { Transaction } from "../../../schema/supabase-types"; -import { Block } from "../../../schema/supabase-types"; +import CardWrapper from "../../../../components/ui/CardWrapper"; +import { Transaction } from "../../../../common/supabase-types"; +import { Block } from "../../../../common/supabase-types"; +import { supabase } from "../../../../common/supabase-client"; import styles from "./Dashboard.module.css"; -import { supabase } from "../../../supabase-client"; function Dashboard() { const navigate = useNavigate(); diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Details/BlockDetails.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/BlockDetails.tsx similarity index 92% rename from packages/cacti-ledger-browser-react/src/pages/eth/Details/BlockDetails.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/BlockDetails.tsx index c101421d1da..51871a1aad5 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/Details/BlockDetails.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/BlockDetails.tsx @@ -1,5 +1,5 @@ -import { supabase } from "../../../supabase-client"; -import { Block } from "../../../schema/supabase-types"; +import { supabase } from "../../../../common/supabase-client"; +import { Block } from "../../../../common/supabase-types"; import styles from "./Details.module.css"; import { useParams } from "react-router-dom"; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Details/Details.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/Details.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/eth/Details/Details.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/Details.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Details/TokenDetails.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/TokenDetails.tsx similarity index 89% rename from packages/cacti-ledger-browser-react/src/pages/eth/Details/TokenDetails.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/TokenDetails.tsx index e979c0eb91a..ee104581664 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/Details/TokenDetails.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/TokenDetails.tsx @@ -1,9 +1,9 @@ -import { supabase } from "../../../supabase-client"; -import { STANDARDS } from "../../../schema/token-standards"; +import { supabase } from "../../../../common/supabase-client"; +import { STANDARDS } from "../../../../common/token-standards"; import { TokenMetadata20, TokenMetadata721, -} from "../../../schema/supabase-types"; +} from "../../../../common/supabase-types"; import styles from "./Details.module.css"; import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Details/TokenTransactionDetails.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/TokenTransactionDetails.tsx similarity index 88% rename from packages/cacti-ledger-browser-react/src/pages/eth/Details/TokenTransactionDetails.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/TokenTransactionDetails.tsx index a6fa6b20cdd..8cd1bc4b248 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/Details/TokenTransactionDetails.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/TokenTransactionDetails.tsx @@ -1,6 +1,6 @@ -import { supabase } from "../../../supabase-client"; -import { STANDARDS } from "../../../schema/token-standards"; -import { ERC20Txn, ERC721Txn } from "../../../schema/supabase-types"; +import { supabase } from "../../../../common/supabase-client"; +import { STANDARDS } from "../../../../common/token-standards"; +import { ERC20Txn, ERC721Txn } from "../../../../common/supabase-types"; import styles from "./Details.module.css"; import { useEffect, useState } from "react"; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Details/TransactionDetails.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/TransactionDetails.tsx similarity index 91% rename from packages/cacti-ledger-browser-react/src/pages/eth/Details/TransactionDetails.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/TransactionDetails.tsx index 04101f56f46..79f7fec79b5 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/Details/TransactionDetails.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Details/TransactionDetails.tsx @@ -1,6 +1,6 @@ -import { supabase } from "../../../supabase-client"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; -import { Transaction, TokenTransfer } from "../../../schema/supabase-types"; +import { supabase } from "../../../../common/supabase-client"; +import CardWrapper from "../../../../components/ui/CardWrapper"; +import { Transaction, TokenTransfer } from "../../../../common/supabase-types"; import styles from "./Details.module.css"; import { useEffect, useState } from "react"; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/ERC20/ERC20.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC20/ERC20.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/eth/ERC20/ERC20.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC20/ERC20.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/ERC20/ERC20.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC20/ERC20.tsx similarity index 83% rename from packages/cacti-ledger-browser-react/src/pages/eth/ERC20/ERC20.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC20/ERC20.tsx index e8c9a4f53f8..73a2a16b52c 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/ERC20/ERC20.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC20/ERC20.tsx @@ -1,8 +1,8 @@ -import TokenAccount from "../../../components/TokenHeader/TokenAccount"; -import { supabase } from "../../../supabase-client"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; -import Chart from "../../../components/Chart/Chart"; -import { ERC20Txn } from "../../../schema/supabase-types"; +import TokenAccount from "../../../../components/TokenHeader/TokenAccount"; +import { supabase } from "../../../../common/supabase-client"; +import CardWrapper from "../../../../components/ui/CardWrapper"; +import Chart from "../../components/Chart/Chart"; +import { ERC20Txn } from "../../../../common/supabase-types"; import styles from "./ERC20.module.css"; import { useNavigate, useParams } from "react-router-dom"; import { useEffect, useState } from "react"; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/ERC721/ERC721.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC721/ERC721.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/eth/ERC721/ERC721.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC721/ERC721.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/ERC721/ERC721.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC721/ERC721.tsx similarity index 92% rename from packages/cacti-ledger-browser-react/src/pages/eth/ERC721/ERC721.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC721/ERC721.tsx index 6585226ef5b..f9d6e514bac 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/ERC721/ERC721.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/ERC721/ERC721.tsx @@ -1,6 +1,6 @@ -import TokenAccount from "../../../components/TokenHeader/TokenAccount"; -import { supabase } from "../../../supabase-client"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; +import TokenAccount from "../../../../components/TokenHeader/TokenAccount"; +import { supabase } from "../../../../common/supabase-client"; +import CardWrapper from "../../../../components/ui/CardWrapper"; import { ERC721Txn } from "../../../schema/supabase-types"; import { TokenMetadata721 } from "../../../schema/supabase-types"; import styles from "./ERC721.module.css"; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/SingleTokenHistory/SingleTokenHistory.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/SingleTokenHistory/SingleTokenHistory.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/eth/SingleTokenHistory/SingleTokenHistory.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/SingleTokenHistory/SingleTokenHistory.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/SingleTokenHistory/SingleTokenHistory.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/SingleTokenHistory/SingleTokenHistory.tsx similarity index 87% rename from packages/cacti-ledger-browser-react/src/pages/eth/SingleTokenHistory/SingleTokenHistory.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/SingleTokenHistory/SingleTokenHistory.tsx index 59298a47a40..5bcb11df99e 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/SingleTokenHistory/SingleTokenHistory.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/SingleTokenHistory/SingleTokenHistory.tsx @@ -1,11 +1,11 @@ -import { supabase } from "../../../supabase-client"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; -import LineChart from "../../../components/Chart/LineChart"; -import TokenHeader from "../../../components/TokenHeader/TokenHeader"; -import { TokenHistoryItem20 } from "../../../schema/supabase-types"; -import { balanceDate } from "../../../schema/supabase-types"; +import { supabase } from "../../../../common/supabase-client"; +import CardWrapper from "../../../../components/ui/CardWrapper"; +import LineChart from "../../components/Chart/LineChart"; +import TokenHeader from "../../../../components/TokenHeader/TokenHeader"; +import { TokenHistoryItem20 } from "../../../../common/supabase-types"; +import { balanceDate } from "../../../../common/supabase-types"; import styles from "./SingleTokenHistory.module.css"; -import EmptyTablePlaceholder from "../../../components/UI/CustomTable/EmptyTablePlaceholder/EmptyTablePlaceholder"; +import EmptyTablePlaceholder from "../../../../components/ui/EmptyTablePlaceholder/EmptyTablePlaceholder"; import { useEffect, useState } from "react"; import { useNavigate, useParams } from "react-router-dom"; diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Transactions/Transactions.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Transactions/Transactions.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/eth/Transactions/Transactions.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Transactions/Transactions.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/eth/Transactions/Transactions.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Transactions/Transactions.tsx similarity index 88% rename from packages/cacti-ledger-browser-react/src/pages/eth/Transactions/Transactions.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Transactions/Transactions.tsx index 7f36f27298f..5cf6444f359 100644 --- a/packages/cacti-ledger-browser-react/src/pages/eth/Transactions/Transactions.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/eth/pages/Transactions/Transactions.tsx @@ -1,6 +1,6 @@ -import { supabase } from "../../../supabase-client"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; -import { Transaction } from "../../../schema/supabase-types"; +import { supabase } from "../../../../common/supabase-client"; +import { Transaction } from "../../../../common/supabase-types"; +import CardWrapper from "../../../../components/ui/CardWrapper"; import styles from "./Transactions.module.css"; import { useNavigate } from "react-router-dom"; diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenAccount.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenAccount.tsx new file mode 100644 index 00000000000..0400b16cfc2 --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenAccount.tsx @@ -0,0 +1,18 @@ +import styles from "./TokenHeader.module.css"; +import AccountBalanceWalletIcon from "@mui/icons-material/AccountBalanceWallet"; + +function TokenAccount(props) { + return ( +
+ + {" "} + + + {" "} + {props.accountNum} + +
+ ); +} + +export default TokenAccount; diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenHeader.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenHeader.module.css new file mode 100644 index 00000000000..2d9ef9600c8 --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenHeader.module.css @@ -0,0 +1,57 @@ +.token-header { + display: flex; + flex-direction: column; + width: 100%; + gap: 1rem; +} + +.token-details { + width: 100%; + height: min-content; + border: 1px solid rgb(240, 236, 236); + border-radius: 10px; + gap: 3rem; + padding: 1rem 2rem; + display: flex; + justify-content: flex-start; + align-items: center; + background-color: rgb(247, 245, 245); +} + +.token-details div { + display: flex; + align-items: center; + gap: 1rem; +} + +.token-icon { + height: 100%; + transform: translateY(10%); + color: rgb(34, 70, 70); +} + +.token-account { + font-size: 16px; + width: 100%; + height: min-content; + display: flex; + align-items: center; + justify-content: center; + background-color: rgb(247, 245, 245); + border-radius: 10px; + padding: 1rem; + padding-left: 2rem; +} + +.token-account span { + display: flex; + align-items: center; + gap: .5rem; +} + +.token-account-icon { + color: rgb(22, 92, 65); + font-size: 28px; + height: 30px; + width: 30px; +} \ No newline at end of file diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenHeader.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenHeader.tsx new file mode 100644 index 00000000000..d47c124ff84 --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/components/TokenHeader/TokenHeader.tsx @@ -0,0 +1,51 @@ +import TokenAccount from "./TokenAccount"; +import { TokenMetadata20 } from "../../schema/supabase-types"; +import { supabase } from "../../supabase-client"; + +import styles from "./TokenHeader.module.css"; +import { useEffect, useState } from "react"; + +function TokenHeader(props) { + const [tokenData, setTokenData] = useState(); + + const fetchData = async () => { + try { + const { data } = await supabase + .from(`token_metadata_erc20`) + .select("*") + .match({ address: props.token_address }); + console.log(data); + if (data?.[0]) { + setTokenData(data[0]); + } else { + throw new Error("Failed to load token details"); + } + } catch (error: any) { + console.error(error.message); + } + }; + + useEffect(() => { + fetchData(); + }, []); + + return ( +
+ +
+

+ Address: {props.token_address} +

+

+ Created at: {tokenData?.created_at} +

+

+ Total supply: + {tokenData?.total_supply} +

+
+
+ ); +} + +export default TokenHeader; diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/index.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/index.tsx new file mode 100644 index 00000000000..66fe6a989b0 --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/index.tsx @@ -0,0 +1,93 @@ +import DashFabric from "./pages/DashFabric/DashFabric"; +import TransactionsFabric from "./pages/TransactionsFabric/TransactionsFabric"; +import BlocksFabric from "./pages/BlocksFabric/BlocksFabric"; +import FabricTransaction from "./pages/FabricTransaction/FabricTransaction"; +import FabricBlock from "./pages/FabricBlock/FabricBlock"; +import { Outlet } from "react-router-dom"; + +interface AppConfig { + name: string; + url: string; + pluginName: string; + menuEntries: { + title: string; + url: string; + }[]; + routes: any; +} + +const fabricConfig: AppConfig = { + name: "Fabric", + url: "fabric", + pluginName: "PluginPersistenceFabric", + menuEntries: [ + { + title: "Dashboard", + url: "/dashboard", + }, + ], + routes: [ + { + path: "dashboard", + element: ( +
+ +
+ ), + }, + { + path: "transactions", + element: ( +
+ +
+ ), + }, + { + path: "blocks", + element: ( +
+ +
+ ), + }, + { + path: "txn-details", + element: ( +
+ +
+ ), + children: [ + { + path: ":id", + element: ( +
+ +
+ ), + }, + ], + }, + { + path: "block-details", + element: ( +
+ +
+ ), + children: [ + { + path: ":id", + element: ( +
+ +
+ ), + }, + ], + }, + ], +}; + +export default fabricConfig; diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/BlocksFabric/BlocksFabric.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/BlocksFabric/BlocksFabric.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/fabric/BlocksFabric/BlocksFabric.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/BlocksFabric/BlocksFabric.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/BlocksFabric/BlocksFabric.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/BlocksFabric/BlocksFabric.tsx similarity index 88% rename from packages/cacti-ledger-browser-react/src/pages/fabric/BlocksFabric/BlocksFabric.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/BlocksFabric/BlocksFabric.tsx index b78d3b1c713..55a404ace42 100644 --- a/packages/cacti-ledger-browser-react/src/pages/fabric/BlocksFabric/BlocksFabric.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/BlocksFabric/BlocksFabric.tsx @@ -1,6 +1,6 @@ -import { supabase } from "../../../supabase-client"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; -import { Block } from "../../../schema/supabase-types"; +import { supabase } from "../../../../common/supabase-client"; +import CardWrapper from "../../../../components/ui/CardWrapper"; +import { Block } from "../../../../common/supabase-types"; import styles from "./BlocksFabric.module.css"; import { useNavigate } from "react-router-dom"; import { useEffect, useState } from "react"; diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/DashFabric/DashFabric.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/DashFabric/DashFabric.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/fabric/DashFabric/DashFabric.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/DashFabric/DashFabric.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/DashFabric/DashFabric.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/DashFabric/DashFabric.tsx similarity index 90% rename from packages/cacti-ledger-browser-react/src/pages/fabric/DashFabric/DashFabric.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/DashFabric/DashFabric.tsx index 2eb86d638e2..dedc76e96f3 100644 --- a/packages/cacti-ledger-browser-react/src/pages/fabric/DashFabric/DashFabric.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/DashFabric/DashFabric.tsx @@ -1,7 +1,7 @@ -import { supabase } from "../../../supabase-client"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; -import { Transaction } from "../../../schema/supabase-types"; -import { Block } from "../../../schema/supabase-types"; +import { supabase } from "../../../../common/supabase-client"; +import CardWrapper from "../../../../components/ui/CardWrapper"; +import { Transaction } from "../../../../common/supabase-types"; +import { Block } from "../../../../common/supabase-types"; import styles from "./DashFabric.module.css"; import { useNavigate } from "react-router-dom"; import { useEffect, useState } from "react"; diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/FabricBlock/FabricBlock.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricBlock/FabricBlock.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/fabric/FabricBlock/FabricBlock.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricBlock/FabricBlock.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/FabricBlock/FabricBlock.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricBlock/FabricBlock.tsx similarity index 96% rename from packages/cacti-ledger-browser-react/src/pages/fabric/FabricBlock/FabricBlock.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricBlock/FabricBlock.tsx index d4fa0f6cb88..92327116314 100644 --- a/packages/cacti-ledger-browser-react/src/pages/fabric/FabricBlock/FabricBlock.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricBlock/FabricBlock.tsx @@ -1,6 +1,6 @@ import styles from "./FabricBlock.module.css"; -import { supabase } from "../../../supabase-client"; +import { supabase } from "../../../../common/supabase-client"; import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/FabricTransaction/FabricTransaction.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricTransaction/FabricTransaction.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/fabric/FabricTransaction/FabricTransaction.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricTransaction/FabricTransaction.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/FabricTransaction/FabricTransaction.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricTransaction/FabricTransaction.tsx similarity index 96% rename from packages/cacti-ledger-browser-react/src/pages/fabric/FabricTransaction/FabricTransaction.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricTransaction/FabricTransaction.tsx index 5bd071bb046..8a749087c2d 100644 --- a/packages/cacti-ledger-browser-react/src/pages/fabric/FabricTransaction/FabricTransaction.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/FabricTransaction/FabricTransaction.tsx @@ -1,6 +1,6 @@ import styles from "./FabricTransaction.module.css"; -import { supabase } from "../../../supabase-client"; -import Button from "../../../components/UI/Button/Button"; +import { supabase } from "../../../../common/supabase-client"; +import Button from "../../../../components/ui/Button"; import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import ContentCopyIcon from "@mui/icons-material/ContentCopy"; diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/TransactionsFabric/TransactionsFabric.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/TransactionsFabric/TransactionsFabric.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/fabric/TransactionsFabric/TransactionsFabric.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/TransactionsFabric/TransactionsFabric.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/fabric/TransactionsFabric/TransactionsFabric.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/TransactionsFabric/TransactionsFabric.tsx similarity index 88% rename from packages/cacti-ledger-browser-react/src/pages/fabric/TransactionsFabric/TransactionsFabric.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/TransactionsFabric/TransactionsFabric.tsx index 782e8daf6fe..234355fddcb 100644 --- a/packages/cacti-ledger-browser-react/src/pages/fabric/TransactionsFabric/TransactionsFabric.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/apps/fabric/pages/TransactionsFabric/TransactionsFabric.tsx @@ -1,6 +1,6 @@ -import { supabase } from "../../../supabase-client"; -import CardWrapper from "../../../components/CardWrapper/CardWrapper"; -import { Transaction } from "../../../schema/supabase-types"; +import { supabase } from "../../../../common/supabase-client"; +import { Transaction } from "../../../../common/supabase-types"; +import CardWrapper from "../../../../components/ui/CardWrapper"; import styles from "./TransactionsFabric.module.css"; import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/common/config.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/common/config.tsx new file mode 100644 index 00000000000..e25e96bbaa1 --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/common/config.tsx @@ -0,0 +1,20 @@ +import cactiGuiConfig from "../apps/cacti/index"; +import ethereumGuiConfig from "../apps/eth"; +import fabricAppConfig from "../apps/fabric"; + +export type AppConfig = { + name: string; + url: string; + pluginName?: string; + menuEntries: { + title: string; + url: string; + }[]; + routes: any; +}; + +export const appConfig: AppConfig[] = [ + cactiGuiConfig, + ethereumGuiConfig, + fabricAppConfig, +]; diff --git a/packages/cacti-ledger-browser-react/src/supabase-client.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/common/supabase-client.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/supabase-client.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/common/supabase-client.tsx diff --git a/packages/cacti-ledger-browser-react/src/schema/supabase-types.ts b/packages/cacti-ledger-browser-react/src/main/typescript/common/supabase-types.ts similarity index 100% rename from packages/cacti-ledger-browser-react/src/schema/supabase-types.ts rename to packages/cacti-ledger-browser-react/src/main/typescript/common/supabase-types.ts diff --git a/packages/cacti-ledger-browser-react/src/schema/token-standards.ts b/packages/cacti-ledger-browser-react/src/main/typescript/common/token-standards.ts similarity index 100% rename from packages/cacti-ledger-browser-react/src/schema/token-standards.ts rename to packages/cacti-ledger-browser-react/src/main/typescript/common/token-standards.ts diff --git a/packages/cacti-ledger-browser-react/src/components/AccountCard/AccountCard.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/AccountCard/AccountCard.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/AccountCard/AccountCard.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/AccountCard/AccountCard.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/AccountCard/AccountCard.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/AccountCard/AccountCard.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/AccountCard/AccountCard.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/AccountCard/AccountCard.tsx diff --git a/packages/cacti-ledger-browser-react/src/pages/shared/Home/Home.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Home.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/pages/shared/Home/Home.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Home.module.css diff --git a/packages/cacti-ledger-browser-react/src/pages/shared/Home/Home.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Home.tsx similarity index 57% rename from packages/cacti-ledger-browser-react/src/pages/shared/Home/Home.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Home.tsx index c50ba071b01..b3fff7cf3ca 100644 --- a/packages/cacti-ledger-browser-react/src/pages/shared/Home/Home.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Home.tsx @@ -1,14 +1,18 @@ import styles from "./Home.module.css"; -import logo from "../../../../../../images/HL_Cacti_Logo_Color.png"; +import logo from "../../../../../../../images/HL_Cacti_Logo_Color.png"; +import StatusPage from "../../apps/cacti/pages/status-page"; + const Home = () => { return (

Select ledger from the dropdown menu

- + + + {/* Logo - + */}
); }; diff --git a/packages/cacti-ledger-browser-react/src/components/UI/Select/Select.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/LedgerSelector.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/UI/Select/Select.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/LedgerSelector.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/UI/Select/Select.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/LedgerSelector.tsx similarity index 94% rename from packages/cacti-ledger-browser-react/src/components/UI/Select/Select.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/LedgerSelector.tsx index 122bc55f813..9aa3a6c44b9 100644 --- a/packages/cacti-ledger-browser-react/src/components/UI/Select/Select.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/LedgerSelector.tsx @@ -1,5 +1,5 @@ import { useLocation } from "react-router-dom"; -import styles from "./Select.module.css"; +import styles from "./LedgerSelector.module.css"; import { useState } from "react"; const options = [ @@ -8,7 +8,7 @@ const options = [ { value: "fabric", display: "Fabric" }, ]; -function Select(props) { +function LedgerSelector(props) { const selectStartLedgerByUrl = (path: string) => options.find((option) => option.value === path); @@ -70,4 +70,4 @@ function Select(props) { ); } -export default Select; +export default LedgerSelector; diff --git a/packages/cacti-ledger-browser-react/src/routes/Root.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Root.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/routes/Root.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Root.module.css diff --git a/packages/cacti-ledger-browser-react/src/routes/Root.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Root.tsx similarity index 81% rename from packages/cacti-ledger-browser-react/src/routes/Root.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Root.tsx index 29fdf77b4a1..313aea6bb77 100644 --- a/packages/cacti-ledger-browser-react/src/routes/Root.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/components/AppShell/Root.tsx @@ -1,7 +1,10 @@ import { Outlet, useLocation } from "react-router-dom"; + +import Home from "./Home"; + import styles from "./Root.module.css"; -import Menu from "../components/UI/Menu/Menu"; -import Home from "../pages/shared/Home/Home"; + +import Menu from "../ui/Menu"; function Root() { const location = useLocation(); diff --git a/packages/cacti-ledger-browser-react/src/components/BlockCard/BlockCard.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/BlockCard/BlockCard.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/BlockCard/BlockCard.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/BlockCard/BlockCard.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/BlockCard/BlockCard.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/BlockCard/BlockCard.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/BlockCard/BlockCard.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/BlockCard/BlockCard.tsx diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenAccount.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenAccount.tsx new file mode 100644 index 00000000000..0400b16cfc2 --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenAccount.tsx @@ -0,0 +1,18 @@ +import styles from "./TokenHeader.module.css"; +import AccountBalanceWalletIcon from "@mui/icons-material/AccountBalanceWallet"; + +function TokenAccount(props) { + return ( +
+ + {" "} + + + {" "} + {props.accountNum} + +
+ ); +} + +export default TokenAccount; diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenHeader.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenHeader.module.css new file mode 100644 index 00000000000..2d9ef9600c8 --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenHeader.module.css @@ -0,0 +1,57 @@ +.token-header { + display: flex; + flex-direction: column; + width: 100%; + gap: 1rem; +} + +.token-details { + width: 100%; + height: min-content; + border: 1px solid rgb(240, 236, 236); + border-radius: 10px; + gap: 3rem; + padding: 1rem 2rem; + display: flex; + justify-content: flex-start; + align-items: center; + background-color: rgb(247, 245, 245); +} + +.token-details div { + display: flex; + align-items: center; + gap: 1rem; +} + +.token-icon { + height: 100%; + transform: translateY(10%); + color: rgb(34, 70, 70); +} + +.token-account { + font-size: 16px; + width: 100%; + height: min-content; + display: flex; + align-items: center; + justify-content: center; + background-color: rgb(247, 245, 245); + border-radius: 10px; + padding: 1rem; + padding-left: 2rem; +} + +.token-account span { + display: flex; + align-items: center; + gap: .5rem; +} + +.token-account-icon { + color: rgb(22, 92, 65); + font-size: 28px; + height: 30px; + width: 30px; +} \ No newline at end of file diff --git a/packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenHeader.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenHeader.tsx new file mode 100644 index 00000000000..e2b5c45019e --- /dev/null +++ b/packages/cacti-ledger-browser-react/src/main/typescript/components/TokenHeader/TokenHeader.tsx @@ -0,0 +1,50 @@ +import TokenAccount from "./TokenAccount"; +import { TokenMetadata20 } from "../../common/supabase-types"; +import { supabase } from "../../common/supabase-client"; +import styles from "./TokenHeader.module.css"; +import { useEffect, useState } from "react"; + +function TokenHeader(props) { + const [tokenData, setTokenData] = useState(); + + const fetchData = async () => { + try { + const { data } = await supabase + .from(`token_metadata_erc20`) + .select("*") + .match({ address: props.token_address }); + console.log(data); + if (data?.[0]) { + setTokenData(data[0]); + } else { + throw new Error("Failed to load token details"); + } + } catch (error: any) { + console.error(error.message); + } + }; + + useEffect(() => { + fetchData(); + }, []); + + return ( +
+ +
+

+ Address: {props.token_address} +

+

+ Created at: {tokenData?.created_at} +

+

+ Total supply: + {tokenData?.total_supply} +

+
+
+ ); +} + +export default TokenHeader; diff --git a/packages/cacti-ledger-browser-react/src/components/UI/Button/Button.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/Button.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/UI/Button/Button.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/Button.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/UI/Button/Button.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/Button.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/UI/Button/Button.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/Button.tsx diff --git a/packages/cacti-ledger-browser-react/src/components/CardWrapper/CardWrapper.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CardWrapper.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/CardWrapper/CardWrapper.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CardWrapper.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/CardWrapper/CardWrapper.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CardWrapper.tsx similarity index 93% rename from packages/cacti-ledger-browser-react/src/components/CardWrapper/CardWrapper.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CardWrapper.tsx index d4f714dca68..d201435b12e 100644 --- a/packages/cacti-ledger-browser-react/src/components/CardWrapper/CardWrapper.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CardWrapper.tsx @@ -1,10 +1,10 @@ -import Button from "../UI/Button/Button"; -import Search from "../UI/Search/Search"; +import Button from "./Button"; +import Search from "./Search"; -import CustomTable from "../UI/CustomTable/CustomTable"; +import CustomTable from "./CustomTable"; import { TableProps } from "../../schema/supabase-types"; -import Pagination from "../Pagination/Pagination"; -import EmptyTablePlaceholder from "../UI/CustomTable/EmptyTablePlaceholder/EmptyTablePlaceholder"; +import Pagination from "./Pagination"; +import EmptyTablePlaceholder from "./EmptyTablePlaceholder/EmptyTablePlaceholder"; import styles from "./CardWrapper.module.css"; import { useLocation, useNavigate } from "react-router-dom"; diff --git a/packages/cacti-ledger-browser-react/src/components/UI/CustomTable/CustomTable.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CustomTable.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/UI/CustomTable/CustomTable.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CustomTable.css diff --git a/packages/cacti-ledger-browser-react/src/components/UI/CustomTable/CustomTable.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CustomTable.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/UI/CustomTable/CustomTable.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CustomTable.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/UI/CustomTable/CustomTable.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CustomTable.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/UI/CustomTable/CustomTable.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/CustomTable.tsx diff --git a/packages/cacti-ledger-browser-react/src/components/UI/CustomTable/EmptyTablePlaceholder/EmptyTablePlaceholder.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/EmptyTablePlaceholder/EmptyTablePlaceholder.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/UI/CustomTable/EmptyTablePlaceholder/EmptyTablePlaceholder.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/EmptyTablePlaceholder/EmptyTablePlaceholder.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/UI/CustomTable/EmptyTablePlaceholder/EmptyTablePlaceholder.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/EmptyTablePlaceholder/EmptyTablePlaceholder.tsx similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/UI/CustomTable/EmptyTablePlaceholder/EmptyTablePlaceholder.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/EmptyTablePlaceholder/EmptyTablePlaceholder.tsx diff --git a/packages/cacti-ledger-browser-react/src/components/UI/Menu/Menu.module.css b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/Menu.module.css similarity index 100% rename from packages/cacti-ledger-browser-react/src/components/UI/Menu/Menu.module.css rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/Menu.module.css diff --git a/packages/cacti-ledger-browser-react/src/components/UI/Menu/Menu.tsx b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/Menu.tsx similarity index 93% rename from packages/cacti-ledger-browser-react/src/components/UI/Menu/Menu.tsx rename to packages/cacti-ledger-browser-react/src/main/typescript/components/ui/Menu.tsx index a9af5fd10dd..2871cbf211c 100644 --- a/packages/cacti-ledger-browser-react/src/components/UI/Menu/Menu.tsx +++ b/packages/cacti-ledger-browser-react/src/main/typescript/components/ui/Menu.tsx @@ -1,8 +1,8 @@ import { useEffect, useState } from "react"; import { useLocation, useNavigate } from "react-router-dom"; -import Select from "../Select/Select"; +import LedgerSelector from "../AppShell/LedgerSelector"; import styles from "./Menu.module.css"; -import Button from "../Button/Button"; +import Button from "../ui/Button"; const ledgersPaths = { eth: [ @@ -53,7 +53,7 @@ function Menu() { return (
-