From 9abb8f9fc924063be804b72a57673060c9aa9500 Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 Date: Mon, 31 Jul 2023 18:11:21 +0700 Subject: [PATCH 1/8] chore: update filter component to filter chains by typedChainId --- .../PoolTransactionsTable.tsx | 4 -- .../components/PoolTransactionsTable/types.ts | 1 - .../components/table/FilterButton.tsx | 52 ++++++++----------- apps/hubble-stats/components/table/types.ts | 20 ++++--- .../PoolTransactionsTableContainer.tsx | 19 ++++--- 5 files changed, 39 insertions(+), 57 deletions(-) diff --git a/apps/hubble-stats/components/PoolTransactionsTable/PoolTransactionsTable.tsx b/apps/hubble-stats/components/PoolTransactionsTable/PoolTransactionsTable.tsx index 8f22e59804..404717b9fe 100644 --- a/apps/hubble-stats/components/PoolTransactionsTable/PoolTransactionsTable.tsx +++ b/apps/hubble-stats/components/PoolTransactionsTable/PoolTransactionsTable.tsx @@ -66,15 +66,11 @@ const columns: ColumnDef[] = [ const PoolTransactionsTable: FC = ({ data, - globalSearchText, pageSize, }) => { const table = useReactTable({ data, columns, - state: { - globalFilter: globalSearchText, - }, initialState: { pagination: { pageSize, diff --git a/apps/hubble-stats/components/PoolTransactionsTable/types.ts b/apps/hubble-stats/components/PoolTransactionsTable/types.ts index 53af909f70..792f4727a6 100644 --- a/apps/hubble-stats/components/PoolTransactionsTable/types.ts +++ b/apps/hubble-stats/components/PoolTransactionsTable/types.ts @@ -14,6 +14,5 @@ export type PoolTransactionType = { export interface PoolTransactionsTableProps { data: PoolTransactionType[]; - globalSearchText: string; pageSize: number; } diff --git a/apps/hubble-stats/components/table/FilterButton.tsx b/apps/hubble-stats/components/table/FilterButton.tsx index 947be60e1f..16074aa600 100644 --- a/apps/hubble-stats/components/table/FilterButton.tsx +++ b/apps/hubble-stats/components/table/FilterButton.tsx @@ -1,4 +1,4 @@ -import { FC, useMemo } from 'react'; +import { FC } from 'react'; import { Accordion, AccordionButton, @@ -12,7 +12,7 @@ import { DropdownBody, } from '@webb-tools/webb-ui-components'; import { TokenIcon, ChevronDown } from '@webb-tools/icons'; -import { chainsConfig, ChainConfig } from '@webb-tools/dapp-config/chains'; +import { chainsConfig } from '@webb-tools/dapp-config/chains'; import { FilterButtonProps } from './types'; @@ -28,18 +28,6 @@ const FilterButton: FC = ({ setSelectedDestinationChains, showAllFn, }) => { - const sourceChainOptions = useMemo(() => { - return Object.keys(chainsConfig) - .map((key: any) => [String(key), chainsConfig[key]]) - .filter((val: any) => sourceChains.includes(val['1'].name)); - }, [sourceChains]); - - const destinationChainOptions = useMemo(() => { - return Object.keys(chainsConfig) - .map((key: any) => [String(key), chainsConfig[key]]) - .filter((val: any) => destinationChains.includes(val['1'].name)); - }, [destinationChains]); - return ( @@ -68,13 +56,11 @@ const FilterButton: FC = ({ value={selectedTokens} options={tokens} onChange={(tokens) => { - setSelectedTokens(tokens as [string, string][]); + setSelectedTokens(tokens as [number, string][]); }} - iconGetter={([_key, name]) => ( - - )} + iconGetter={([_, name]) => } labelGetter={([_, name]) => name} - keyGetter={([tokenId]) => `Filter_proposals${tokenId}`} + keyGetter={([tokenId]) => tokenId.toString()} className="px-0" labelClassName="uppercase" showAllLabel={false} @@ -91,14 +77,17 @@ const FilterButton: FC = ({ { - setSelectedSourceChains(chains as [string, ChainConfig][]); + setSelectedSourceChains(chains as number[]); }} - labelGetter={([_, chain]: any) => ( - + labelGetter={(typedChainId) => ( + )} - keyGetter={([chainId]) => `Filter_proposals${chainId}`} + keyGetter={(typedChainId) => typedChainId.toString()} className="px-0" labelClassName="!pl-0" showAllLabel={false} @@ -114,16 +103,17 @@ const FilterButton: FC = ({ { - setSelectedDestinationChains( - chains as [string, ChainConfig][] - ); + setSelectedDestinationChains(chains as number[]); }} - labelGetter={([_, chain]: any) => ( - + labelGetter={(typedChainId) => ( + )} - keyGetter={([chainId]) => `Filter_proposals${chainId}`} + keyGetter={(typedChainId) => typedChainId.toString()} className="px-0" labelClassName="!pl-0" showAllLabel={false} diff --git a/apps/hubble-stats/components/table/types.ts b/apps/hubble-stats/components/table/types.ts index e952970c0c..d90a8d233d 100644 --- a/apps/hubble-stats/components/table/types.ts +++ b/apps/hubble-stats/components/table/types.ts @@ -1,5 +1,3 @@ -import { ChainConfig } from '@webb-tools/dapp-config'; - export interface HeaderCellProps { title: string; tooltip?: string; @@ -37,14 +35,14 @@ export interface DestinationCellProps { } export interface FilterButtonProps { - tokens: [string, string][]; - selectedTokens: [string, string][]; - setSelectedTokens: (tokens: [string, string][]) => void; - sourceChains: string[]; - selectedSourceChains: [string, ChainConfig][]; - setSelectedSourceChains: (chains: [string, ChainConfig][]) => void; - destinationChains: string[]; - selectedDestinationChains: [string, ChainConfig][]; - setSelectedDestinationChains: (chains: [string, ChainConfig][]) => void; + tokens: [number, string][]; + selectedTokens: [number, string][]; + setSelectedTokens: (tokens: [number, string][]) => void; + sourceChains: number[]; + selectedSourceChains: number[]; + setSelectedSourceChains: (chains: number[]) => void; + destinationChains: number[]; + selectedDestinationChains: number[]; + setSelectedDestinationChains: (chains: number[]) => void; showAllFn: () => void; } diff --git a/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx b/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx index 5c922a26eb..7016810b30 100644 --- a/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx +++ b/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx @@ -1,18 +1,21 @@ 'use client'; -import { useState, useMemo } from 'react'; +import { FC, useMemo } from 'react'; import { TableAndChartTabs } from '@webb-tools/webb-ui-components'; import { PoolTransactionsTable } from '../../components'; import { FilterButton } from '../../components/table'; import { PoolTransactionType } from '../../components/PoolTransactionsTable/types'; -const pageSize = 10; +interface PoolTransactionsTableContainerProps { + poolsData?: PoolTransactionType[]; +} -const PoolTransactionsTableContainer = () => { - const [poolsData, setPoolsData] = useState([]); - const [globalSearchText, setGlobalSearchText] = useState(''); +const pageSize = 10; +const PoolTransactionsTableContainer: FC< + PoolTransactionsTableContainerProps +> = ({ poolsData = [] }) => { const filterButton = useMemo( () => ( { headerClassName="w-full overflow-x-auto" triggerClassName="whitespace-nowrap" > - + ); }; From e4448e8ee3aa592d7f33e5866e7b58150cfd5cff Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 Date: Mon, 31 Jul 2023 18:38:30 +0700 Subject: [PATCH 2/8] chore: update typedChainIds prop in shielded tables --- .../ShieldedAssetsTable/ShieldedAssetsTable.tsx | 11 ++++++----- .../components/ShieldedAssetsTable/types.ts | 8 ++++---- .../ShieldedPoolsTable/ShieldedPoolsTable.tsx | 11 ++++++----- .../components/ShieldedPoolsTable/types.ts | 6 +++--- apps/hubble-stats/utils/getChainNamesByTypedId.ts | 7 +++++++ apps/hubble-stats/utils/index.ts | 1 + 6 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 apps/hubble-stats/utils/getChainNamesByTypedId.ts diff --git a/apps/hubble-stats/components/ShieldedAssetsTable/ShieldedAssetsTable.tsx b/apps/hubble-stats/components/ShieldedAssetsTable/ShieldedAssetsTable.tsx index 7b3fc75686..fec6dd3fdf 100644 --- a/apps/hubble-stats/components/ShieldedAssetsTable/ShieldedAssetsTable.tsx +++ b/apps/hubble-stats/components/ShieldedAssetsTable/ShieldedAssetsTable.tsx @@ -20,6 +20,7 @@ import { ShieldedAssetDark, ShieldedAssetLight } from '@webb-tools/icons'; import { ShieldedAssetType, ShieldedAssetsTableProps } from './types'; import { HeaderCell, NumberCell, ShieldedCell } from '../table'; import { PoolTypeChip } from '..'; +import { getChainNamesByTypedId } from '../../utils'; const columnHelper = createColumnHelper(); @@ -50,11 +51,11 @@ const staticColumns: ColumnDef[] = [ header: () => , cell: (props) => , }), - columnHelper.accessor('chains', { + columnHelper.accessor('typedChainIds', { header: () => , cell: (props) => ( @@ -70,14 +71,14 @@ const ShieldedAssetsTable: FC = ({ const columns = useMemo[]>( () => [ - columnHelper.accessor('assetAddress', { + columnHelper.accessor('address', { header: () => ( ), cell: (props) => ( : } /> ), diff --git a/apps/hubble-stats/components/ShieldedAssetsTable/types.ts b/apps/hubble-stats/components/ShieldedAssetsTable/types.ts index 3572f8868a..5480baab6b 100644 --- a/apps/hubble-stats/components/ShieldedAssetsTable/types.ts +++ b/apps/hubble-stats/components/ShieldedAssetsTable/types.ts @@ -1,14 +1,14 @@ import { PoolType } from '../PoolTypeChip/types'; export interface ShieldedAssetType { - assetAddress: string; - assetSymbol: string; - assetsUrl: string; + address: string; + symbol: string; + url: string; poolType: PoolType; composition: string[]; deposits24h: number; tvl: number; - chains: string[]; + typedChainIds: number[]; } export interface ShieldedAssetsTableProps { diff --git a/apps/hubble-stats/components/ShieldedPoolsTable/ShieldedPoolsTable.tsx b/apps/hubble-stats/components/ShieldedPoolsTable/ShieldedPoolsTable.tsx index b12f26100b..ffefc5fc68 100644 --- a/apps/hubble-stats/components/ShieldedPoolsTable/ShieldedPoolsTable.tsx +++ b/apps/hubble-stats/components/ShieldedPoolsTable/ShieldedPoolsTable.tsx @@ -14,18 +14,19 @@ import { Table, IconsGroup, fuzzyFilter } from '@webb-tools/webb-ui-components'; import { ShieldedPoolType, ShieldedPoolsTableProps } from './types'; import { HeaderCell, NumberCell, ShieldedCell } from '../table'; import { PoolTypeChip } from '..'; +import { getChainNamesByTypedId } from '../../utils'; const columnHelper = createColumnHelper(); const columns: ColumnDef[] = [ - columnHelper.accessor('poolAddress', { + columnHelper.accessor('address', { header: () => ( ), cell: (props) => ( ), }), @@ -49,11 +50,11 @@ const columns: ColumnDef[] = [ header: () => , cell: (props) => , }), - columnHelper.accessor('chains', { + columnHelper.accessor('typedChainIds', { header: () => , cell: (props) => ( diff --git a/apps/hubble-stats/components/ShieldedPoolsTable/types.ts b/apps/hubble-stats/components/ShieldedPoolsTable/types.ts index 02dd757412..8c87782da1 100644 --- a/apps/hubble-stats/components/ShieldedPoolsTable/types.ts +++ b/apps/hubble-stats/components/ShieldedPoolsTable/types.ts @@ -1,13 +1,13 @@ import { PoolType } from '../PoolTypeChip/types'; export interface ShieldedPoolType { - poolSymbol: string; - poolAddress: string; + symbol: string; + address: string; poolType: PoolType; token: number; deposits24h: number; tvl: number; - chains: string[]; + typedChainIds: string[]; } export interface ShieldedPoolsTableProps { diff --git a/apps/hubble-stats/utils/getChainNamesByTypedId.ts b/apps/hubble-stats/utils/getChainNamesByTypedId.ts new file mode 100644 index 0000000000..ad6ace5bce --- /dev/null +++ b/apps/hubble-stats/utils/getChainNamesByTypedId.ts @@ -0,0 +1,7 @@ +import { chainsConfig } from '@webb-tools/dapp-config/chains'; + +const getChainNamesByTypedId = (typedChainIds: number[]) => { + return typedChainIds.map((typedChainId) => chainsConfig[typedChainId].name); +}; + +export default getChainNamesByTypedId; diff --git a/apps/hubble-stats/utils/index.ts b/apps/hubble-stats/utils/index.ts index daa6cd1945..13061a8d06 100644 --- a/apps/hubble-stats/utils/index.ts +++ b/apps/hubble-stats/utils/index.ts @@ -1 +1,2 @@ +export { default as getChainNamesByTypedId } from './getChainNamesByTypedId'; export { default as getSortedTypedChainIds } from './getSortedTypedChainIds'; From 3bf56f382e5f8d9d1b78b8dff2d3e8a5a68f36e4 Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 Date: Mon, 31 Jul 2023 18:47:47 +0700 Subject: [PATCH 3/8] chore: remove darkmode check in Shielded Asset Table --- .../ShieldedAssetsTable.tsx | 44 ++++++------------- .../components/table/ShieldedCell.tsx | 13 ++++-- apps/hubble-stats/components/table/types.ts | 1 - 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/apps/hubble-stats/components/ShieldedAssetsTable/ShieldedAssetsTable.tsx b/apps/hubble-stats/components/ShieldedAssetsTable/ShieldedAssetsTable.tsx index fec6dd3fdf..aa878e6933 100644 --- a/apps/hubble-stats/components/ShieldedAssetsTable/ShieldedAssetsTable.tsx +++ b/apps/hubble-stats/components/ShieldedAssetsTable/ShieldedAssetsTable.tsx @@ -1,4 +1,4 @@ -import { FC, useMemo } from 'react'; +import { FC } from 'react'; import { createColumnHelper, useReactTable, @@ -9,13 +9,7 @@ import { ColumnDef, Table as RTTable, } from '@tanstack/react-table'; -import { - Table, - fuzzyFilter, - IconsGroup, - useDarkMode, -} from '@webb-tools/webb-ui-components'; -import { ShieldedAssetDark, ShieldedAssetLight } from '@webb-tools/icons'; +import { Table, fuzzyFilter, IconsGroup } from '@webb-tools/webb-ui-components'; import { ShieldedAssetType, ShieldedAssetsTableProps } from './types'; import { HeaderCell, NumberCell, ShieldedCell } from '../table'; @@ -24,7 +18,18 @@ import { getChainNamesByTypedId } from '../../utils'; const columnHelper = createColumnHelper(); -const staticColumns: ColumnDef[] = [ +const columns: ColumnDef[] = [ + columnHelper.accessor('address', { + header: () => ( + + ), + cell: (props) => ( + + ), + }), columnHelper.accessor('poolType', { header: () => , cell: (props) => ( @@ -67,27 +72,6 @@ const ShieldedAssetsTable: FC = ({ data, pageSize, }) => { - const [isDarkMode] = useDarkMode(); - - const columns = useMemo[]>( - () => [ - columnHelper.accessor('address', { - header: () => ( - - ), - cell: (props) => ( - : } - /> - ), - }), - ...staticColumns, - ], - [isDarkMode] - ); - const table = useReactTable({ data, columns, diff --git a/apps/hubble-stats/components/table/ShieldedCell.tsx b/apps/hubble-stats/components/table/ShieldedCell.tsx index 05c75753ee..b05abf2b97 100644 --- a/apps/hubble-stats/components/table/ShieldedCell.tsx +++ b/apps/hubble-stats/components/table/ShieldedCell.tsx @@ -1,14 +1,19 @@ import { FC } from 'react'; import { Typography } from '@webb-tools/webb-ui-components'; import { shortenHex } from '@webb-tools/webb-ui-components/utils'; -import { ExternalLinkIcon } from '@radix-ui/react-icons'; +import { + ExternalLinkLine, + ShieldedAssetDark, + ShieldedAssetLight, +} from '@webb-tools/icons'; import { ShieldedCellProps } from './types'; -const ShieldedCell: FC = ({ title, address, icon }) => { +const ShieldedCell: FC = ({ title, address }) => { return (
- {icon ?? null} + +
= ({ title, address, icon }) => { {/* TODO: update href */} - +
diff --git a/apps/hubble-stats/components/table/types.ts b/apps/hubble-stats/components/table/types.ts index d90a8d233d..8f3d774d8b 100644 --- a/apps/hubble-stats/components/table/types.ts +++ b/apps/hubble-stats/components/table/types.ts @@ -15,7 +15,6 @@ export interface NumberCellProps { export interface ShieldedCellProps { title: string; address: string; - icon?: JSX.Element; } export type ActivityType = 'deposit' | 'transfer' | 'withdraw'; From d3537f3031b415d221a3120632ae53490911584e Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 Date: Mon, 31 Jul 2023 20:04:14 +0700 Subject: [PATCH 4/8] chore: minor refactor accross files --- .../KeyMetricItem/KeyMetricItem.tsx | 8 +----- .../PoolTransactionsTable.tsx | 26 +++++++++---------- .../components/table/DestinationCell.tsx | 7 ++--- .../components/table/HeaderCell.tsx | 4 +-- .../components/table/NumberCell.tsx | 4 +-- .../components/table/TimeCell.tsx | 4 +-- .../KeyMetricsTableContainer.tsx | 9 +------ .../PoolMetadataTableContainer.tsx | 3 ++- .../PoolOverviewContainer.tsx | 9 +------ 9 files changed, 28 insertions(+), 46 deletions(-) diff --git a/apps/hubble-stats/components/KeyMetricItem/KeyMetricItem.tsx b/apps/hubble-stats/components/KeyMetricItem/KeyMetricItem.tsx index 4d77347e2c..0534be891b 100644 --- a/apps/hubble-stats/components/KeyMetricItem/KeyMetricItem.tsx +++ b/apps/hubble-stats/components/KeyMetricItem/KeyMetricItem.tsx @@ -12,13 +12,7 @@ const KeyMetricItem: FC = ({ changeRate, }) => { return ( -
+
{title} diff --git a/apps/hubble-stats/components/PoolTransactionsTable/PoolTransactionsTable.tsx b/apps/hubble-stats/components/PoolTransactionsTable/PoolTransactionsTable.tsx index 404717b9fe..67c85e1392 100644 --- a/apps/hubble-stats/components/PoolTransactionsTable/PoolTransactionsTable.tsx +++ b/apps/hubble-stats/components/PoolTransactionsTable/PoolTransactionsTable.tsx @@ -25,41 +25,41 @@ const columnHelper = createColumnHelper(); const columns: ColumnDef[] = [ columnHelper.accessor('activity', { header: () => , - cell: (row) => ( + cell: (props) => ( ), }), columnHelper.accessor('tokenAmount', { header: () => , - cell: (row) => ( + cell: (props) => ( ), }), columnHelper.accessor('source', { header: () => , - cell: (row) => ( + cell: (props) => ( ), }), columnHelper.accessor('destination', { header: () => , - cell: (row) => , + cell: (props) => , }), columnHelper.accessor('time', { header: () => , - cell: (row) => ( - + cell: (props) => ( + ), }), ]; diff --git a/apps/hubble-stats/components/table/DestinationCell.tsx b/apps/hubble-stats/components/table/DestinationCell.tsx index 7a30a33110..046fa5dd7c 100644 --- a/apps/hubble-stats/components/table/DestinationCell.tsx +++ b/apps/hubble-stats/components/table/DestinationCell.tsx @@ -1,5 +1,5 @@ import { FC } from 'react'; -import cx from 'classnames'; +import { twMerge } from 'tailwind-merge'; import { ShieldedAssetLight } from '@webb-tools/icons'; import { DestinationCellProps } from './types'; @@ -7,10 +7,11 @@ import { DestinationCellProps } from './types'; const DestinationCell: FC = ({ className }) => { return ( diff --git a/apps/hubble-stats/components/table/HeaderCell.tsx b/apps/hubble-stats/components/table/HeaderCell.tsx index c1e5b73e11..500ab31c6f 100644 --- a/apps/hubble-stats/components/table/HeaderCell.tsx +++ b/apps/hubble-stats/components/table/HeaderCell.tsx @@ -1,5 +1,5 @@ import { FC } from 'react'; -import cx from 'classnames'; +import { twMerge } from 'tailwind-merge'; import { IconWithTooltip, Typography } from '@webb-tools/webb-ui-components'; import { InformationLine } from '@webb-tools/icons'; @@ -10,7 +10,7 @@ const HeaderCell: FC = ({ title, tooltip, className }) => { = ({ return ( = ({ time, className }) => { return ( {time ? 'Today' : '-'} diff --git a/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx b/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx index 9cfbe8d56b..6ad3e2bd4d 100644 --- a/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx +++ b/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx @@ -1,19 +1,12 @@ 'use client'; import { FC } from 'react'; -import cx from 'classnames'; import { KeyMetricItem } from '../../components'; const KeyMetricsTableContainer: FC = () => { return ( -
+
{/* Tablet and Desktop */}
diff --git a/apps/hubble-stats/containers/PoolMetadataTableContainer/PoolMetadataTableContainer.tsx b/apps/hubble-stats/containers/PoolMetadataTableContainer/PoolMetadataTableContainer.tsx index ab2a147f82..ecc2a293f3 100644 --- a/apps/hubble-stats/containers/PoolMetadataTableContainer/PoolMetadataTableContainer.tsx +++ b/apps/hubble-stats/containers/PoolMetadataTableContainer/PoolMetadataTableContainer.tsx @@ -1,5 +1,6 @@ 'use client'; +import { FC } from 'react'; import { Typography } from '@webb-tools/webb-ui-components'; import { PoolMetadataTable } from '../../components'; @@ -40,7 +41,7 @@ const metadata: PoolAttributeType[] = [ }, ]; -const PoolMetadataTableContainer = () => { +const PoolMetadataTableContainer: FC = () => { return (
diff --git a/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx b/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx index 37ed893eef..3a1a4f12d7 100644 --- a/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx +++ b/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx @@ -1,7 +1,6 @@ 'use client'; import { FC } from 'react'; -import cx from 'classnames'; import { Typography } from '@webb-tools/webb-ui-components'; import { shortenHex } from '@webb-tools/webb-ui-components/utils'; import { @@ -28,13 +27,7 @@ const PoolOverviewContainer: FC<{ poolOverviewData?: PoolOverviewType }> = ({ poolOverviewData = undefined, }) => { return ( -
+
{/* Icon */} Date: Tue, 1 Aug 2023 11:51:12 +0700 Subject: [PATCH 5/8] chore:n add favicon + optimize 'use client' --- apps/hubble-stats/app/layout.tsx | 22 ++++++++++-------- apps/hubble-stats/app/page.tsx | 6 ----- .../components/AreaChart/AreaChart.tsx | 2 ++ .../components/BarChart/BarChart.tsx | 2 ++ .../hubble-stats/components/Header/Header.tsx | 5 ++-- .../NetworkPoolTable/NetworkPoolTable.tsx | 2 ++ .../NetworkTokenTable/NetworkTokenTable.tsx | 2 ++ .../PoolMetadataTable/PoolMetadataTable.tsx | 2 ++ .../PoolTransactionsTable.tsx | 2 ++ .../ShieldedAssetsTable.tsx | 2 ++ .../ShieldedPoolsTable/ShieldedPoolsTable.tsx | 2 ++ apps/hubble-stats/components/index.ts | 2 ++ .../components/sideBar/SideBar.tsx | 12 ++++++++++ .../components/sideBar/SideBarMenu.tsx | 12 ++++++++++ .../hubble-stats/components/sideBar/index.tsx | 2 ++ .../sideBar/sideBarProps.tsx} | 0 apps/hubble-stats/constants/index.ts | 1 - .../KeyMetricsTableContainer.tsx | 2 -- .../NetworkTablesContainer.tsx | 2 -- .../PoolMetadataTableContainer.tsx | 2 -- .../PoolOverviewContainer.tsx | 2 -- .../PoolTransactionsTableContainer.tsx | 2 -- .../ShieldedTablesContainer.tsx | 2 -- apps/hubble-stats/public/favicon.ico | Bin 15086 -> 0 bytes apps/hubble-stats/public/favicon.png | Bin 0 -> 16585 bytes libs/icons/src/hooks/useDynamicSVGImport.tsx | 2 ++ libs/webb-ui-components/src/index.ts | 2 ++ 27 files changed, 62 insertions(+), 32 deletions(-) create mode 100644 apps/hubble-stats/components/sideBar/SideBar.tsx create mode 100644 apps/hubble-stats/components/sideBar/SideBarMenu.tsx create mode 100644 apps/hubble-stats/components/sideBar/index.tsx rename apps/hubble-stats/{constants/sideBar.ts => components/sideBar/sideBarProps.tsx} (100%) delete mode 100644 apps/hubble-stats/constants/index.ts delete mode 100644 apps/hubble-stats/public/favicon.ico create mode 100644 apps/hubble-stats/public/favicon.png diff --git a/apps/hubble-stats/app/layout.tsx b/apps/hubble-stats/app/layout.tsx index 882848e5eb..4eed7ec9fd 100644 --- a/apps/hubble-stats/app/layout.tsx +++ b/apps/hubble-stats/app/layout.tsx @@ -1,14 +1,16 @@ -'use client'; - -import { - WebbUIProvider, - Footer, - SideBar, -} from '@webb-tools/webb-ui-components'; +import { Metadata } from 'next'; +import { WebbUIProvider, Footer } from '@webb-tools/webb-ui-components'; import '@webb-tools/webb-ui-components/tailwind.css'; -import { Header } from '../components'; -import { sideBarProps } from '../constants'; +import { Header, SideBar } from '../components'; + +export const metadata: Metadata = { + title: 'Hubble Stats', + description: 'Welcome to Hubble Stats!', + icons: { + icon: '/favicon.png', + }, +}; export default function RootLayout({ children, @@ -19,7 +21,7 @@ export default function RootLayout({ - +
{children} diff --git a/apps/hubble-stats/app/page.tsx b/apps/hubble-stats/app/page.tsx index 4e3502842a..159fbd0f1b 100644 --- a/apps/hubble-stats/app/page.tsx +++ b/apps/hubble-stats/app/page.tsx @@ -1,15 +1,9 @@ -import { Metadata } from 'next'; import { KeyMetricsTableContainer, ShieldedTablesContainer, OverviewChartsContainer, } from '../containers'; -export const metadata: Metadata = { - title: 'Hubble Stats', - description: 'Welcome to Hubble Stats!', -}; - export default async function Index() { return (
diff --git a/apps/hubble-stats/components/AreaChart/AreaChart.tsx b/apps/hubble-stats/components/AreaChart/AreaChart.tsx index 76ecc2ebbd..3fb7887069 100644 --- a/apps/hubble-stats/components/AreaChart/AreaChart.tsx +++ b/apps/hubble-stats/components/AreaChart/AreaChart.tsx @@ -1,3 +1,5 @@ +'use client'; + import { FC } from 'react'; import { ResponsiveContainer, diff --git a/apps/hubble-stats/components/BarChart/BarChart.tsx b/apps/hubble-stats/components/BarChart/BarChart.tsx index bb8d3cba74..cf1ee43c3e 100644 --- a/apps/hubble-stats/components/BarChart/BarChart.tsx +++ b/apps/hubble-stats/components/BarChart/BarChart.tsx @@ -1,3 +1,5 @@ +'use client'; + import { FC } from 'react'; import { ResponsiveContainer, diff --git a/apps/hubble-stats/components/Header/Header.tsx b/apps/hubble-stats/components/Header/Header.tsx index b26c9a0ae3..a3ba97e838 100644 --- a/apps/hubble-stats/components/Header/Header.tsx +++ b/apps/hubble-stats/components/Header/Header.tsx @@ -5,12 +5,11 @@ import { BreadcrumbsItem, Chip, ChipProps, - SideBarMenu, } from '@webb-tools/webb-ui-components'; import { BlockIcon, GridFillIcon, Spinner } from '@webb-tools/icons'; import { IconBase } from '@webb-tools/icons/types'; -import { sideBarProps } from '../../constants'; +import { SideBarMenu } from '..'; const Header = () => { const tvl = useMemo(() => { @@ -25,7 +24,7 @@ const Header = () => {
{/* Breadcrumbs */}
- + { + return ; +}; + +export default SideBar; diff --git a/apps/hubble-stats/components/sideBar/SideBarMenu.tsx b/apps/hubble-stats/components/sideBar/SideBarMenu.tsx new file mode 100644 index 0000000000..eacd69e530 --- /dev/null +++ b/apps/hubble-stats/components/sideBar/SideBarMenu.tsx @@ -0,0 +1,12 @@ +'use client'; + +import { FC } from 'react'; +import { SideBarMenu as SideBarMenuCmp } from '@webb-tools/webb-ui-components'; + +import sideBarProps from './sideBarProps'; + +const SideBarMenu: FC = () => { + return ; +}; + +export default SideBarMenu; diff --git a/apps/hubble-stats/components/sideBar/index.tsx b/apps/hubble-stats/components/sideBar/index.tsx new file mode 100644 index 0000000000..07a45eed61 --- /dev/null +++ b/apps/hubble-stats/components/sideBar/index.tsx @@ -0,0 +1,2 @@ +export { default as SideBar } from './SideBar'; +export { default as SideBarMenu } from './SideBarMenu'; diff --git a/apps/hubble-stats/constants/sideBar.ts b/apps/hubble-stats/components/sideBar/sideBarProps.tsx similarity index 100% rename from apps/hubble-stats/constants/sideBar.ts rename to apps/hubble-stats/components/sideBar/sideBarProps.tsx diff --git a/apps/hubble-stats/constants/index.ts b/apps/hubble-stats/constants/index.ts deleted file mode 100644 index 456794533d..0000000000 --- a/apps/hubble-stats/constants/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as sideBarProps } from './sideBar'; diff --git a/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx b/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx index 6ad3e2bd4d..e8023e8ef6 100644 --- a/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx +++ b/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx @@ -1,5 +1,3 @@ -'use client'; - import { FC } from 'react'; import { KeyMetricItem } from '../../components'; diff --git a/apps/hubble-stats/containers/NetworkTablesContainer/NetworkTablesContainer.tsx b/apps/hubble-stats/containers/NetworkTablesContainer/NetworkTablesContainer.tsx index c71ed4f000..b0696dc80f 100644 --- a/apps/hubble-stats/containers/NetworkTablesContainer/NetworkTablesContainer.tsx +++ b/apps/hubble-stats/containers/NetworkTablesContainer/NetworkTablesContainer.tsx @@ -1,5 +1,3 @@ -'use client'; - import { FC } from 'react'; import { TableAndChartTabs, Typography } from '@webb-tools/webb-ui-components'; diff --git a/apps/hubble-stats/containers/PoolMetadataTableContainer/PoolMetadataTableContainer.tsx b/apps/hubble-stats/containers/PoolMetadataTableContainer/PoolMetadataTableContainer.tsx index ecc2a293f3..1d501a43eb 100644 --- a/apps/hubble-stats/containers/PoolMetadataTableContainer/PoolMetadataTableContainer.tsx +++ b/apps/hubble-stats/containers/PoolMetadataTableContainer/PoolMetadataTableContainer.tsx @@ -1,5 +1,3 @@ -'use client'; - import { FC } from 'react'; import { Typography } from '@webb-tools/webb-ui-components'; diff --git a/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx b/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx index 3a1a4f12d7..95d4708f58 100644 --- a/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx +++ b/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx @@ -1,5 +1,3 @@ -'use client'; - import { FC } from 'react'; import { Typography } from '@webb-tools/webb-ui-components'; import { shortenHex } from '@webb-tools/webb-ui-components/utils'; diff --git a/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx b/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx index 7016810b30..850e0fd4b1 100644 --- a/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx +++ b/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx @@ -1,5 +1,3 @@ -'use client'; - import { FC, useMemo } from 'react'; import { TableAndChartTabs } from '@webb-tools/webb-ui-components'; diff --git a/apps/hubble-stats/containers/ShieldedTablesContainer/ShieldedTablesContainer.tsx b/apps/hubble-stats/containers/ShieldedTablesContainer/ShieldedTablesContainer.tsx index 09230744ef..a85c97ec15 100644 --- a/apps/hubble-stats/containers/ShieldedTablesContainer/ShieldedTablesContainer.tsx +++ b/apps/hubble-stats/containers/ShieldedTablesContainer/ShieldedTablesContainer.tsx @@ -1,5 +1,3 @@ -'use client'; - import { FC } from 'react'; import { TableAndChartTabs, TabContent } from '@webb-tools/webb-ui-components'; diff --git a/apps/hubble-stats/public/favicon.ico b/apps/hubble-stats/public/favicon.ico deleted file mode 100644 index 317ebcb2336e0833a22dddf0ab287849f26fda57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15086 zcmeI332;U^%p|z7g|#(P)qFEA@4f!_@qOK2 z_lJl}!lhL!VT_U|uN7%8B2iKH??xhDa;*`g{yjTFWHvXn;2s{4R7kH|pKGdy(7z!K zgftM+Ku7~24TLlh(!g)gz|foI94G^t2^IO$uvX$3(OR0<_5L2sB)lMAMy|+`xodJ{ z_Uh_1m)~h?a;2W{dmhM;u!YGo=)OdmId_B<%^V^{ovI@y`7^g1_V9G}*f# zNzAtvou}I!W1#{M^@ROc(BZ! z+F!!_aR&Px3_reO(EW+TwlW~tv*2zr?iP7(d~a~yA|@*a89IUke+c472NXM0wiX{- zl`UrZC^1XYyf%1u)-Y)jj9;MZ!SLfd2Hl?o|80Su%Z?To_=^g_Jt0oa#CT*tjx>BI z16wec&AOWNK<#i0Qd=1O$fymLRoUR*%;h@*@v7}wApDl^w*h}!sYq%kw+DKDY)@&A z@9$ULEB3qkR#85`lb8#WZw=@})#kQig9oqy^I$dj&k4jU&^2(M3q{n1AKeGUKPFbr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7Ws#5jHV3=G zE$+D7E?GGncUqHA%bu;$9tUGcmr~i#1AL`bk!NN}=CHq9r8(YJa~p=7O_`5&gs-UG z{8UG%YAE=@=ewwBs@oyRC-Hy z_oBzmxTu(XI!U2Rv+2BVSp04P>n&oBUa4C%fpd)AO;vbY@5 zms`lQ;j6GLX9{=rZvdff|oO3y@O*0Way9Dt6$iS-kGcKF#H>}l{b8wDV5D5 zW-H9mdWx%dM?u5@!@KQg>sXCM9D3b2NK0Jwl<$OV*7D)uD;nYtIOmp5ebs|c;L_U$ zqv%Y&yv^Tl$gpB-eyh0*600crT1Pl^>Bxk~Zqe93%%*eZJfe}LL_rCJPmtdD#XNqv zz8K(5<9k&8#df0?;fz1*>bB{8M6kz;G$OQOFN96^&Fa3%W2rrY&UHjMF?gSfu~s5K z_G&cVv#!-{;^H5{>qLGX5O9ZYSM9hhNLlfr00I`CQL#R1ShMZaT_gW_0Ps;-S*l9H6#D-G D(ybpE literal 0 HcmV?d00001 diff --git a/libs/icons/src/hooks/useDynamicSVGImport.tsx b/libs/icons/src/hooks/useDynamicSVGImport.tsx index 1f78089757..d1a80842fd 100644 --- a/libs/icons/src/hooks/useDynamicSVGImport.tsx +++ b/libs/icons/src/hooks/useDynamicSVGImport.tsx @@ -1,3 +1,5 @@ +'use client'; + import React, { useEffect, useMemo, useState } from 'react'; /** diff --git a/libs/webb-ui-components/src/index.ts b/libs/webb-ui-components/src/index.ts index 6d7853877a..e4c470828e 100644 --- a/libs/webb-ui-components/src/index.ts +++ b/libs/webb-ui-components/src/index.ts @@ -1,3 +1,5 @@ +'use client'; + export * from './components'; export * from './containers'; export * from './typography'; From afc57bd030cdc83beddb111af7ebfca2e0e55f45 Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 Date: Tue, 1 Aug 2023 14:13:41 +0700 Subject: [PATCH 6/8] chore: refactor components --- apps/hubble-stats/app/layout.tsx | 11 +- .../components/Breadcrumbs/Breadcrumbs.tsx | 61 +++++++++ .../components/Breadcrumbs/index.ts | 1 + .../components/Breadcrumbs/types.ts | 7 ++ .../hubble-stats/components/Header/Header.tsx | 118 ------------------ apps/hubble-stats/components/Header/index.ts | 2 - apps/hubble-stats/components/Header/types.ts | 12 -- apps/hubble-stats/components/index.ts | 2 +- .../hubble-stats/containers/Layout/Layout.tsx | 31 +++++ apps/hubble-stats/containers/Layout/index.ts | 1 + .../OverviewChipsContainer.tsx | 29 +++++ .../OverviewChipsContainer/index.ts | 1 + .../PoolTransactionsTableContainer.tsx | 2 + apps/hubble-stats/containers/index.ts | 3 + 14 files changed, 139 insertions(+), 142 deletions(-) create mode 100644 apps/hubble-stats/components/Breadcrumbs/Breadcrumbs.tsx create mode 100644 apps/hubble-stats/components/Breadcrumbs/index.ts create mode 100644 apps/hubble-stats/components/Breadcrumbs/types.ts delete mode 100644 apps/hubble-stats/components/Header/Header.tsx delete mode 100644 apps/hubble-stats/components/Header/index.ts delete mode 100644 apps/hubble-stats/components/Header/types.ts create mode 100644 apps/hubble-stats/containers/Layout/Layout.tsx create mode 100644 apps/hubble-stats/containers/Layout/index.ts create mode 100644 apps/hubble-stats/containers/OverviewChipsContainer/OverviewChipsContainer.tsx create mode 100644 apps/hubble-stats/containers/OverviewChipsContainer/index.ts diff --git a/apps/hubble-stats/app/layout.tsx b/apps/hubble-stats/app/layout.tsx index 674f2969c0..ece930c6ce 100644 --- a/apps/hubble-stats/app/layout.tsx +++ b/apps/hubble-stats/app/layout.tsx @@ -2,7 +2,7 @@ import { Metadata } from 'next'; import { WebbUIProvider, Footer } from '@webb-tools/webb-ui-components'; import '@webb-tools/webb-ui-components/tailwind.css'; -import { Header, SideBar } from '../components'; +import { Layout } from '../containers'; export const metadata: Metadata = { title: 'Hubble Stats', @@ -20,14 +20,7 @@ export default function RootLayout({ return ( - - -
-
- {children} -
-
- + {children}
); diff --git a/apps/hubble-stats/components/Breadcrumbs/Breadcrumbs.tsx b/apps/hubble-stats/components/Breadcrumbs/Breadcrumbs.tsx new file mode 100644 index 0000000000..7bbd8b2aa7 --- /dev/null +++ b/apps/hubble-stats/components/Breadcrumbs/Breadcrumbs.tsx @@ -0,0 +1,61 @@ +'use client'; + +import { FC, useMemo } from 'react'; +import Link from 'next/link'; +import { usePathname } from 'next/navigation'; +import { + Breadcrumbs as BreadcrumbsCmp, + BreadcrumbsItem, +} from '@webb-tools/webb-ui-components'; +import { CoinIcon, ContrastLine } from '@webb-tools/icons'; + +import { BreadcrumbType } from './types'; + +const Breadcrumbs: FC = () => { + const pathname = usePathname(); + + const breadCrumbs = useMemo(() => { + const parts = pathname.split('/'); + const activeItem = parts[parts.length - 1]; + + const breadCrumbItems: BreadcrumbType[] = [ + { + label: 'Hubble Overview', + isLast: activeItem !== '' ? false : true, + icon: ( + + ), + href: '/', + }, + ]; + + if (activeItem !== '') { + breadCrumbItems.push({ + label: activeItem, + isLast: true, + icon: , + href: '', + }); + } + + return breadCrumbItems; + }, [pathname]); + + return ( + + {breadCrumbs.map((breadcrumb, index) => ( + + + {breadcrumb.label} + + + ))} + + ); +}; + +export default Breadcrumbs; diff --git a/apps/hubble-stats/components/Breadcrumbs/index.ts b/apps/hubble-stats/components/Breadcrumbs/index.ts new file mode 100644 index 0000000000..0835ba0b68 --- /dev/null +++ b/apps/hubble-stats/components/Breadcrumbs/index.ts @@ -0,0 +1 @@ +export { default as Breadcrumbs } from './Breadcrumbs'; diff --git a/apps/hubble-stats/components/Breadcrumbs/types.ts b/apps/hubble-stats/components/Breadcrumbs/types.ts new file mode 100644 index 0000000000..47053b33b9 --- /dev/null +++ b/apps/hubble-stats/components/Breadcrumbs/types.ts @@ -0,0 +1,7 @@ +export type BreadcrumbType = { + label: string; + isLast: boolean; + icon: JSX.Element; + href: string; + className?: string; +}; diff --git a/apps/hubble-stats/components/Header/Header.tsx b/apps/hubble-stats/components/Header/Header.tsx deleted file mode 100644 index 0c739f1bf6..0000000000 --- a/apps/hubble-stats/components/Header/Header.tsx +++ /dev/null @@ -1,118 +0,0 @@ -'use client'; - -import { BlockIcon, CoinIcon, ContrastLine, Spinner } from '@webb-tools/icons'; -import { IconBase } from '@webb-tools/icons/types'; -import { FC, useMemo } from 'react'; -import Link from 'next/link'; -import { - Breadcrumbs, - BreadcrumbsItem, - Chip, - ChipProps, -} from '@webb-tools/webb-ui-components'; -import { HeaderProps, Breadcrumb } from './types'; -import { usePathname } from 'next/navigation'; - -import { SideBarMenu } from '..'; - -const Header = ({ tvlValue, volumeValue }: HeaderProps) => { - const pathname = usePathname(); - - const breadCrumbs = useMemo(() => { - const parts = pathname.split('/'); - const activeItem = parts[parts.length - 1]; - - const breadCrumbItems: Breadcrumb[] = [ - { - label: 'Hubble Overview', - isLast: activeItem !== '' ? false : true, - icon: ( - - ), - href: '/', - }, - ]; - - if (activeItem !== '') { - breadCrumbItems.push({ - label: activeItem, - isLast: true, - icon: , - href: '', - }); - } - - return breadCrumbItems; - }, [pathname]); - - return ( -
- {/* Breadcrumbs */} -
- - - {breadCrumbs.map((breadcrumb, index) => ( - - - {breadcrumb.label} - - - ))} - -
- - {/* TVL and Volume Chips */} -
- - -
-
- ); -}; - -type VolumeChipProps = { - color: ChipProps['color']; - className?: string; - Icon: (props: IconBase) => JSX.Element; - iconClassName?: string; - iconSize?: IconBase['size']; - value: string; - isLoading?: boolean; -}; - -export const VolumeChip: FC = ({ - color, - className, - Icon, - iconClassName, - iconSize = 'md', - value, - isLoading, -}) => { - return ( - - - {isLoading ? : value} - - ); -}; - -export default Header; diff --git a/apps/hubble-stats/components/Header/index.ts b/apps/hubble-stats/components/Header/index.ts deleted file mode 100644 index b35d22a28a..0000000000 --- a/apps/hubble-stats/components/Header/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as Header } from './Header'; -export * from './types'; diff --git a/apps/hubble-stats/components/Header/types.ts b/apps/hubble-stats/components/Header/types.ts deleted file mode 100644 index e6a7822aa6..0000000000 --- a/apps/hubble-stats/components/Header/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type Breadcrumb = { - label: string; - isLast: boolean; - icon: JSX.Element; - href: string; - className?: string; -}; - -export type HeaderProps = { - tvlValue: string; - volumeValue: string; -}; diff --git a/apps/hubble-stats/components/index.ts b/apps/hubble-stats/components/index.ts index 440e845588..5909f4588c 100644 --- a/apps/hubble-stats/components/index.ts +++ b/apps/hubble-stats/components/index.ts @@ -1,6 +1,6 @@ export * from './AreaChart'; export * from './BarChart'; -export * from './Header'; +export * from './Breadcrumbs'; export * from './KeyMetricItem'; export * from './NetworkPoolTable'; export * from './NetworkTokenTable'; diff --git a/apps/hubble-stats/containers/Layout/Layout.tsx b/apps/hubble-stats/containers/Layout/Layout.tsx new file mode 100644 index 0000000000..78aff88d72 --- /dev/null +++ b/apps/hubble-stats/containers/Layout/Layout.tsx @@ -0,0 +1,31 @@ +import { FC } from 'react'; +import { Footer } from '@webb-tools/webb-ui-components'; + +import { OverviewChipsContainer } from '..'; +import { SideBar, SideBarMenu, Breadcrumbs } from '../../components'; + +const Layout: FC<{ children?: React.ReactNode }> = ({ children }) => { + return ( + + +
+ {/* Header */} +
+
+ + +
+ +
+ + {/* Body */} + {children} + + {/* Footer */} +
+
+ + ); +}; + +export default Layout; diff --git a/apps/hubble-stats/containers/Layout/index.ts b/apps/hubble-stats/containers/Layout/index.ts new file mode 100644 index 0000000000..6c48faec7d --- /dev/null +++ b/apps/hubble-stats/containers/Layout/index.ts @@ -0,0 +1 @@ +export { default as Layout } from './Layout'; diff --git a/apps/hubble-stats/containers/OverviewChipsContainer/OverviewChipsContainer.tsx b/apps/hubble-stats/containers/OverviewChipsContainer/OverviewChipsContainer.tsx new file mode 100644 index 0000000000..ea6e3cb1c6 --- /dev/null +++ b/apps/hubble-stats/containers/OverviewChipsContainer/OverviewChipsContainer.tsx @@ -0,0 +1,29 @@ +import { FC } from 'react'; +import { Chip } from '@webb-tools/webb-ui-components'; +import { BlockIcon } from '@webb-tools/icons'; + +interface OverviewChipsContainerProps { + tvlValue?: number; + volumeValue?: number; +} + +const OverviewChipsContainer: FC = ({ + tvlValue, + volumeValue, +}) => { + return ( +
+ + + TVL: {tvlValue ? `${tvlValue}` : ' - '} + + + + + Volume: {volumeValue ? `${volumeValue}` : ' - '} + +
+ ); +}; + +export default OverviewChipsContainer; diff --git a/apps/hubble-stats/containers/OverviewChipsContainer/index.ts b/apps/hubble-stats/containers/OverviewChipsContainer/index.ts new file mode 100644 index 0000000000..ccadb4f60c --- /dev/null +++ b/apps/hubble-stats/containers/OverviewChipsContainer/index.ts @@ -0,0 +1 @@ +export { default as OverviewChipsContainer } from './OverviewChipsContainer'; diff --git a/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx b/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx index 850e0fd4b1..7016810b30 100644 --- a/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx +++ b/apps/hubble-stats/containers/PoolTransactionsTableContainer/PoolTransactionsTableContainer.tsx @@ -1,3 +1,5 @@ +'use client'; + import { FC, useMemo } from 'react'; import { TableAndChartTabs } from '@webb-tools/webb-ui-components'; diff --git a/apps/hubble-stats/containers/index.ts b/apps/hubble-stats/containers/index.ts index 3934b212d8..d653738c60 100644 --- a/apps/hubble-stats/containers/index.ts +++ b/apps/hubble-stats/containers/index.ts @@ -1,7 +1,10 @@ export { KeyMetricsTableContainer } from './KeyMetricsTableContainer'; export { NetworkTablesContainer } from './NetworkTablesContainer'; export { OverviewChartsContainer } from './OverviewChartsContainer'; +export { OverviewChipsContainer } from './OverviewChipsContainer'; export { PoolMetadataTableContainer } from './PoolMetadataTableContainer'; export { PoolOverviewContainer } from './PoolOverviewContainer'; export { PoolTransactionsTableContainer } from './PoolTransactionsTableContainer'; export { ShieldedTablesContainer } from './ShieldedTablesContainer'; + +export { Layout } from './Layout'; From a23008dcaad53132b00fdbe40d066a3d1c0abef0 Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 Date: Tue, 1 Aug 2023 14:39:44 +0700 Subject: [PATCH 7/8] chore: refactor charts code --- .../components/AreaChart/AreaChart.tsx | 5 +++- .../components/AreaChart/types.ts | 6 +++-- .../components/BarChart/BarChart.tsx | 5 +++- .../hubble-stats/components/BarChart/types.ts | 6 +++-- .../OverviewChartsContainer.tsx | 27 +++---------------- 5 files changed, 19 insertions(+), 30 deletions(-) diff --git a/apps/hubble-stats/components/AreaChart/AreaChart.tsx b/apps/hubble-stats/components/AreaChart/AreaChart.tsx index 3fb7887069..2eef4ced69 100644 --- a/apps/hubble-stats/components/AreaChart/AreaChart.tsx +++ b/apps/hubble-stats/components/AreaChart/AreaChart.tsx @@ -8,16 +8,19 @@ import { Tooltip, XAxis, } from 'recharts'; +import { useDarkMode } from '@webb-tools/webb-ui-components'; + import { AreaChartProps } from './types'; const AreaChart: FC = ({ data, setDate, setValue, - isDarkMode, width = '100%', height = 180, }) => { + const [isDarkMode] = useDarkMode(); + return ( ; setValue: (value: number | null) => void; setDate: (date: Date | null) => void; - isDarkMode: boolean; width?: number | string; height?: number | string; }; diff --git a/apps/hubble-stats/components/BarChart/BarChart.tsx b/apps/hubble-stats/components/BarChart/BarChart.tsx index cf1ee43c3e..1023d3f507 100644 --- a/apps/hubble-stats/components/BarChart/BarChart.tsx +++ b/apps/hubble-stats/components/BarChart/BarChart.tsx @@ -8,16 +8,19 @@ import { Tooltip, Bar, } from 'recharts'; +import { useDarkMode } from '@webb-tools/webb-ui-components'; + import { BarChartProps } from './types'; const BarChart: FC = ({ data, setValue, setDate, - isDarkMode, width = '100%', height = 180, }) => { + const [isDarkMode] = useDarkMode(); + return ( ; setValue: (value: number | null) => void; setDate: (date: Date | null) => void; - isDarkMode: boolean; width?: number | string; height?: number | string; }; diff --git a/apps/hubble-stats/containers/OverviewChartsContainer/OverviewChartsContainer.tsx b/apps/hubble-stats/containers/OverviewChartsContainer/OverviewChartsContainer.tsx index c783427073..39388c1ec9 100644 --- a/apps/hubble-stats/containers/OverviewChartsContainer/OverviewChartsContainer.tsx +++ b/apps/hubble-stats/containers/OverviewChartsContainer/OverviewChartsContainer.tsx @@ -1,7 +1,8 @@ 'use client'; -import { useEffect, useMemo, useState } from 'react'; +import { useMemo, useState } from 'react'; import { DaysFilterType, ChartContainer } from '@webb-tools/webb-ui-components'; + import { AreaChart, BarChart } from '../../components'; const OverviewChartsContainer = () => { @@ -20,22 +21,6 @@ const OverviewChartsContainer = () => { // 24 Hour Volume data type (day, week, month) - Default value is Week const [volumeDataType, setVolumeDataType] = useState('week'); - const [isDarkMode, setIsDarkMode] = useState(false); - - useEffect(() => { - const handleThemeChange = () => { - setIsDarkMode(localStorage.getItem('theme') === 'dark'); - }; - - handleThemeChange(); - - window.addEventListener('storage', handleThemeChange); - - return () => { - window.removeEventListener('storage', handleThemeChange); - }; - }, []); - const tvlData = useMemo(() => { const data = []; @@ -71,12 +56,7 @@ const OverviewChartsContainer = () => { value={tvlValue} date={tvlDate} > - + {/* 24 Hour Volume Chart Container */} @@ -93,7 +73,6 @@ const OverviewChartsContainer = () => { data={volumeData} setDate={setVolumeDate} setValue={setVolumeValue} - isDarkMode={isDarkMode} />
From 0af328e0b306ca7233f3842d4aae84cf23889c8e Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 Date: Wed, 2 Aug 2023 09:07:16 +0700 Subject: [PATCH 8/8] chore: update code based on comments --- .../components/KeyMetricItem/KeyMetricItem.tsx | 8 +++++++- apps/hubble-stats/components/ShieldedPoolsTable/types.ts | 2 +- .../KeyMetricsTableContainer.tsx | 9 ++++++++- .../PoolOverviewContainer/PoolOverviewContainer.tsx | 9 ++++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/apps/hubble-stats/components/KeyMetricItem/KeyMetricItem.tsx b/apps/hubble-stats/components/KeyMetricItem/KeyMetricItem.tsx index 0534be891b..23636b2716 100644 --- a/apps/hubble-stats/components/KeyMetricItem/KeyMetricItem.tsx +++ b/apps/hubble-stats/components/KeyMetricItem/KeyMetricItem.tsx @@ -12,7 +12,13 @@ const KeyMetricItem: FC = ({ changeRate, }) => { return ( -
+
{title} diff --git a/apps/hubble-stats/components/ShieldedPoolsTable/types.ts b/apps/hubble-stats/components/ShieldedPoolsTable/types.ts index 8c87782da1..e1db285fc8 100644 --- a/apps/hubble-stats/components/ShieldedPoolsTable/types.ts +++ b/apps/hubble-stats/components/ShieldedPoolsTable/types.ts @@ -7,7 +7,7 @@ export interface ShieldedPoolType { token: number; deposits24h: number; tvl: number; - typedChainIds: string[]; + typedChainIds: number[]; } export interface ShieldedPoolsTableProps { diff --git a/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx b/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx index e8023e8ef6..de097005c9 100644 --- a/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx +++ b/apps/hubble-stats/containers/KeyMetricsTableContainer/KeyMetricsTableContainer.tsx @@ -1,10 +1,17 @@ import { FC } from 'react'; +import cx from 'classnames'; import { KeyMetricItem } from '../../components'; const KeyMetricsTableContainer: FC = () => { return ( -
+
{/* Tablet and Desktop */}
diff --git a/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx b/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx index 95d4708f58..307b1e316c 100644 --- a/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx +++ b/apps/hubble-stats/containers/PoolOverviewContainer/PoolOverviewContainer.tsx @@ -1,4 +1,5 @@ import { FC } from 'react'; +import cx from 'classnames'; import { Typography } from '@webb-tools/webb-ui-components'; import { shortenHex } from '@webb-tools/webb-ui-components/utils'; import { @@ -25,7 +26,13 @@ const PoolOverviewContainer: FC<{ poolOverviewData?: PoolOverviewType }> = ({ poolOverviewData = undefined, }) => { return ( -
+
{/* Icon */}