diff --git a/apps/hubble-stats/app/layout.tsx b/apps/hubble-stats/app/layout.tsx index 7e54a9abc8..a3102af212 100644 --- a/apps/hubble-stats/app/layout.tsx +++ b/apps/hubble-stats/app/layout.tsx @@ -19,7 +19,7 @@ import { WEBB_DOCS_URL, WEBB_MKT_URL, } from '@webb-tools/webb-ui-components/constants'; -import { Header } from '../components/Header'; +import { Header } from '../components'; export default function RootLayout({ children, @@ -89,12 +89,10 @@ export default function RootLayout({ footer={footer} /> -
-
-
- {children} -
-
+
+
+ {children} +
diff --git a/apps/hubble-stats/app/page.tsx b/apps/hubble-stats/app/page.tsx index 9733649b45..e057496575 100644 --- a/apps/hubble-stats/app/page.tsx +++ b/apps/hubble-stats/app/page.tsx @@ -2,8 +2,8 @@ import { Metadata } from 'next'; import { KeyMetricsTableContainer, ShieldedTablesContainer, + OverviewChartsContainer, } from '../containers'; -import { VolumeChartsContainer } from '../containers/VolumeChartsContainer'; export const metadata: Metadata = { title: 'Hubble Stats', @@ -13,7 +13,7 @@ export const metadata: Metadata = { 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 f566f99d53..76ecc2ebbd 100644 --- a/apps/hubble-stats/components/Areachart/Areachart.tsx +++ b/apps/hubble-stats/components/Areachart/Areachart.tsx @@ -1,19 +1,24 @@ -import { ResponsiveContainer, AreaChart, Area, Tooltip, XAxis } from 'recharts'; -import { AreachartProps } from './types'; - -export const Areachart = (props: AreachartProps) => { - const { - data, - setDate, - setValue, - isDarkMode, - width = '100%', - height = 180, - } = props; +import { FC } from 'react'; +import { + ResponsiveContainer, + AreaChart as AreaChartCmp, + Area, + Tooltip, + XAxis, +} from 'recharts'; +import { AreaChartProps } from './types'; +const AreaChart: FC = ({ + data, + setDate, + setValue, + isDarkMode, + width = '100%', + height = 180, +}) => { return ( - { setDate && setDate(null); @@ -52,7 +57,9 @@ export const Areachart = (props: AreachartProps) => { fillOpacity={0} strokeWidth={2} /> - + ); }; + +export default AreaChart; diff --git a/apps/hubble-stats/components/Areachart/index.ts b/apps/hubble-stats/components/Areachart/index.ts index 521207731b..4857683302 100644 --- a/apps/hubble-stats/components/Areachart/index.ts +++ b/apps/hubble-stats/components/Areachart/index.ts @@ -1,2 +1 @@ -export * from './Areachart'; -export * from './types'; +export { default as AreaChart } from './AreaChart'; diff --git a/apps/hubble-stats/components/Areachart/types.ts b/apps/hubble-stats/components/Areachart/types.ts index 770559d846..3b2b2d9c05 100644 --- a/apps/hubble-stats/components/Areachart/types.ts +++ b/apps/hubble-stats/components/Areachart/types.ts @@ -1,4 +1,4 @@ -export type AreachartProps = { +export type AreaChartProps = { data: any; setValue: (value: number | null) => void; setDate: (date: Date | null) => void; diff --git a/apps/hubble-stats/components/Barchart/Barchart.tsx b/apps/hubble-stats/components/Barchart/Barchart.tsx index 922cac393b..bb8d3cba74 100644 --- a/apps/hubble-stats/components/Barchart/Barchart.tsx +++ b/apps/hubble-stats/components/Barchart/Barchart.tsx @@ -1,19 +1,24 @@ -import { ResponsiveContainer, BarChart, XAxis, Tooltip, Bar } from 'recharts'; -import { BarchartProps } from './types'; - -export const Barchart = (props: BarchartProps) => { - const { - data, - setValue, - setDate, - isDarkMode, - width = '100%', - height = 180, - } = props; +import { FC } from 'react'; +import { + ResponsiveContainer, + BarChart as BarChartCmp, + XAxis, + Tooltip, + Bar, +} from 'recharts'; +import { BarChartProps } from './types'; +const BarChart: FC = ({ + data, + setValue, + setDate, + isDarkMode, + width = '100%', + height = 180, +}) => { return ( - { setValue && setValue(null); @@ -47,7 +52,9 @@ export const Barchart = (props: BarchartProps) => { }} /> - + ); }; + +export default BarChart; diff --git a/apps/hubble-stats/components/Barchart/index.ts b/apps/hubble-stats/components/Barchart/index.ts index b371b63545..a53e00eabe 100644 --- a/apps/hubble-stats/components/Barchart/index.ts +++ b/apps/hubble-stats/components/Barchart/index.ts @@ -1,2 +1 @@ -export * from './Barchart'; -export * from './types'; +export { default as BarChart } from './BarChart'; diff --git a/apps/hubble-stats/components/Barchart/types.ts b/apps/hubble-stats/components/Barchart/types.ts index 1f07189afd..719b0486b5 100644 --- a/apps/hubble-stats/components/Barchart/types.ts +++ b/apps/hubble-stats/components/Barchart/types.ts @@ -1,4 +1,4 @@ -export type BarchartProps = { +export type BarChartProps = { data: any; setValue: (value: number | null) => void; setDate: (date: Date | null) => void; diff --git a/apps/hubble-stats/components/Header/Header.tsx b/apps/hubble-stats/components/Header/Header.tsx index cef444b5ec..7a9fbc5f5b 100644 --- a/apps/hubble-stats/components/Header/Header.tsx +++ b/apps/hubble-stats/components/Header/Header.tsx @@ -9,7 +9,7 @@ import { import Link from 'next/link'; import React, { useMemo } from 'react'; -export const Header = () => { +const Header = () => { const tvl = useMemo(() => { return 'TVL: $13,642,124'; }, []); @@ -80,3 +80,5 @@ export const VolumeChip: React.FC = ({ ); }; + +export default Header; diff --git a/apps/hubble-stats/components/Header/index.ts b/apps/hubble-stats/components/Header/index.ts index 266dec8a1b..5653319dec 100644 --- a/apps/hubble-stats/components/Header/index.ts +++ b/apps/hubble-stats/components/Header/index.ts @@ -1 +1 @@ -export * from './Header'; +export { default as Header } from './Header'; diff --git a/apps/hubble-stats/components/index.ts b/apps/hubble-stats/components/index.ts index 835301b4ba..102548c55e 100644 --- a/apps/hubble-stats/components/index.ts +++ b/apps/hubble-stats/components/index.ts @@ -1,3 +1,6 @@ +export * from './AreaChart'; +export * from './BarChart'; +export * from './Header'; export * from './KeyMetricItem'; export * from './PoolMetadataTable'; export * from './PoolOverviewItem'; @@ -5,5 +8,3 @@ export * from './PoolTransactionsTable'; export * from './PoolTypeChip'; export * from './ShieldedAssetsTable'; export * from './ShieldedPoolsTable'; -export * from './Areachart'; -export * from './Barchart'; diff --git a/apps/hubble-stats/containers/VolumeChartsContainer/VolumeChartsContainer.tsx b/apps/hubble-stats/containers/OverviewChartsContainer/OverviewChartsContainer.tsx similarity index 94% rename from apps/hubble-stats/containers/VolumeChartsContainer/VolumeChartsContainer.tsx rename to apps/hubble-stats/containers/OverviewChartsContainer/OverviewChartsContainer.tsx index 8246126ca1..3a347913a7 100644 --- a/apps/hubble-stats/containers/VolumeChartsContainer/VolumeChartsContainer.tsx +++ b/apps/hubble-stats/containers/OverviewChartsContainer/OverviewChartsContainer.tsx @@ -1,9 +1,10 @@ 'use client'; + import { useEffect, useMemo, useState } from 'react'; import { DaysFilterType, ChartContainer } from '@webb-tools/webb-ui-components'; -import { Areachart, Barchart } from '../../components'; +import { AreaChart, BarChart } from '../../components'; -export const VolumeChartsContainer = () => { +const OverviewChartsContainer = () => { // Current TVLVolume & Volume values (Default values) const [currentTvlValue, setCurrentTvlValue] = useState(13.6); const [currentVolumeValue, setCurrentVolumeValue] = useState(8.56); @@ -70,7 +71,7 @@ export const VolumeChartsContainer = () => { value={tvlValue} date={tvlDate} > - { daysFilterType={volumeDataType} setDaysFilterType={setVolumeDataType} > - { ); }; + +export default OverviewChartsContainer; diff --git a/apps/hubble-stats/containers/OverviewChartsContainer/index.ts b/apps/hubble-stats/containers/OverviewChartsContainer/index.ts new file mode 100644 index 0000000000..426add05d1 --- /dev/null +++ b/apps/hubble-stats/containers/OverviewChartsContainer/index.ts @@ -0,0 +1 @@ +export { default as OverviewChartsContainer } from './OverviewChartsContainer'; diff --git a/apps/hubble-stats/containers/VolumeChartsContainer/index.ts b/apps/hubble-stats/containers/VolumeChartsContainer/index.ts deleted file mode 100644 index c06ca8259a..0000000000 --- a/apps/hubble-stats/containers/VolumeChartsContainer/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './VolumeChartsContainer'; diff --git a/apps/hubble-stats/containers/index.ts b/apps/hubble-stats/containers/index.ts index 3efa5a331f..d13a1fe0d7 100644 --- a/apps/hubble-stats/containers/index.ts +++ b/apps/hubble-stats/containers/index.ts @@ -1,4 +1,5 @@ export * from './KeyMetricsTableContainer'; +export * from './OverviewChartsContainer'; export * from './PoolMetadataTableContainer'; export * from './PoolOverviewContainer'; export * from './PoolTransactionsTableContainer';