diff --git a/apps/explorer/src/components/AddressesCardGraph.tsx b/apps/explorer/src/components/AddressesCardGraph.tsx index 3258b556573..0c5ba23db08 100644 --- a/apps/explorer/src/components/AddressesCardGraph.tsx +++ b/apps/explorer/src/components/AddressesCardGraph.tsx @@ -8,7 +8,8 @@ import { useMemo } from 'react'; import { useGetAddressMetrics } from '~/hooks/useGetAddressMetrics'; import { useGetAllEpochAddressMetrics } from '~/hooks/useGetAllEpochAddressMetrics'; import { LabelTextSize, TooltipPosition } from '@iota/apps-ui-kit'; -import { StatisticsPanel, GraphTooltip } from './StatisticsPanel'; +import { StatisticsPanel } from './StatisticsPanel'; +import { GraphTooltipContent } from './GraphTooltipContent'; const GRAPH_DATA_FIELD = 'cumulativeAddresses'; const GRAPH_DATA_TEXT = 'Total addresses'; @@ -18,7 +19,13 @@ function TooltipContent({ data }: { data: AllEpochsAddressMetrics[number] }): JS const totalFormatted = formatAmount(data[GRAPH_DATA_FIELD]); const overline = `${dateFormatted}, Epoch ${data.epoch}`; - return ; + return ( + + ); } const FALLBACK = '--'; diff --git a/apps/explorer/src/components/AreaGraph.tsx b/apps/explorer/src/components/AreaGraph.tsx index ebfc5f690f5..dd3723c03d0 100644 --- a/apps/explorer/src/components/AreaGraph.tsx +++ b/apps/explorer/src/components/AreaGraph.tsx @@ -13,7 +13,7 @@ import { bisector, extent } from 'd3-array'; import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'; import { throttle } from 'throttle-debounce'; -import { GraphTooltipContent } from './GraphTooltipContent'; +import { GraphTooltipContainer } from './GraphTooltipContent'; let idCounter = 0; @@ -129,21 +129,33 @@ export function AreaGraph({ offsetTop={0} left={tooltipLeft} top={tooltipTopAdj} - className="pointer-events-none absolute z-10 h-0 w-max overflow-visible" + className="pointer-events-none absolute z-10 h-0 w-max overflow-visible bg-black" unstyled detectBounds > - {tooltipContent(tooltipContentProps)} + + {tooltipContent(tooltipContentProps)} + ) : null} - - + + - + diff --git a/apps/explorer/src/components/GraphTooltipContent.tsx b/apps/explorer/src/components/GraphTooltipContent.tsx index ddceab1776c..515c04990b7 100644 --- a/apps/explorer/src/components/GraphTooltipContent.tsx +++ b/apps/explorer/src/components/GraphTooltipContent.tsx @@ -4,18 +4,13 @@ import { useTooltipPosition } from '@visx/tooltip'; import clsx from 'clsx'; -import { type ReactNode } from 'react'; -type GraphTooltipContentProps = { - children: ReactNode; -}; - -export function GraphTooltipContent({ children }: GraphTooltipContentProps): JSX.Element { +export function GraphTooltipContainer({ children }: React.PropsWithChildren): JSX.Element { const { isFlippedHorizontally } = useTooltipPosition(); return (
); } + +interface GraphTooltipContentProps { + title: string; + overline: string; + subtitle: string; +} +export function GraphTooltipContent({ title, overline, subtitle }: GraphTooltipContentProps) { + return ( +
+ {overline} + {title} + {subtitle} +
+ ); +} diff --git a/apps/explorer/src/components/StatisticsPanel.tsx b/apps/explorer/src/components/StatisticsPanel.tsx index b2701d4b6d6..b30be733170 100644 --- a/apps/explorer/src/components/StatisticsPanel.tsx +++ b/apps/explorer/src/components/StatisticsPanel.tsx @@ -69,18 +69,3 @@ export function StatisticsPanel({ ); } - -interface GraphTooltipProps { - title: string; - overline: string; - subtitle: string; -} -export function GraphTooltip({ title, overline, subtitle }: GraphTooltipProps) { - return ( -
- {overline} - {title} - {subtitle} -
- ); -} diff --git a/apps/explorer/src/components/ThemedIotaLogo.tsx b/apps/explorer/src/components/ThemedIotaLogo.tsx new file mode 100644 index 00000000000..71a42a49a8d --- /dev/null +++ b/apps/explorer/src/components/ThemedIotaLogo.tsx @@ -0,0 +1,8 @@ +// Copyright (c) 2024 IOTA Stiftung +// SPDX-License-Identifier: Apache-2.0 + +import { IotaLogoWeb } from '@iota/ui-icons'; + +export function ThemedIotaLogo(): React.JSX.Element { + return ; +} diff --git a/apps/explorer/src/components/TransactionsCardGraph.tsx b/apps/explorer/src/components/TransactionsCardGraph.tsx index 510f5785b7c..ee9f1a8679a 100644 --- a/apps/explorer/src/components/TransactionsCardGraph.tsx +++ b/apps/explorer/src/components/TransactionsCardGraph.tsx @@ -5,7 +5,8 @@ import { CoinFormat, formatAmount, formatBalance, formatDate } from '@iota/core'; import { useIotaClientQuery } from '@iota/dapp-kit'; import { LabelTextSize, TooltipPosition } from '@iota/apps-ui-kit'; -import { GraphTooltip, StatisticsPanel } from './StatisticsPanel'; +import { StatisticsPanel } from './StatisticsPanel'; +import { GraphTooltipContent } from './GraphTooltipContent'; interface TooltipContentProps { data: { @@ -24,7 +25,11 @@ function TooltipContent({ const overline = `${dateFormatted}, Epoch ${epoch}`; return ( - + ); } diff --git a/apps/explorer/src/components/footer/Footer.tsx b/apps/explorer/src/components/footer/Footer.tsx index e5f17ca794f..d4f43153c63 100644 --- a/apps/explorer/src/components/footer/Footer.tsx +++ b/apps/explorer/src/components/footer/Footer.tsx @@ -4,9 +4,9 @@ import { Divider } from '@iota/apps-ui-kit'; import { LegalLinks, LegalText } from './Legal'; -import { IotaLogoWeb } from '@iota/ui-icons'; import { Link } from '~/components/ui'; import { FOOTER_LINKS } from '~/lib/constants'; +import { ThemedIotaLogo } from '../ThemedIotaLogo'; function FooterLinks(): JSX.Element { return ( @@ -14,7 +14,11 @@ function FooterLinks(): JSX.Element {
    {FOOTER_LINKS.map(({ title, href }) => (
  • - + {title}
  • @@ -26,11 +30,11 @@ function FooterLinks(): JSX.Element { function Footer(): JSX.Element { return ( -