);
}
+
+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/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/top-packages/TopPackagesCard.tsx b/apps/explorer/src/components/top-packages/TopPackagesCard.tsx
index 9a172b38586..0ead5efec72 100644
--- a/apps/explorer/src/components/top-packages/TopPackagesCard.tsx
+++ b/apps/explorer/src/components/top-packages/TopPackagesCard.tsx
@@ -11,17 +11,17 @@ import { ErrorBoundary } from '../error-boundary/ErrorBoundary';
import { TopPackagesTable } from './TopPackagesTable';
import { Panel, Title } from '@iota/apps-ui-kit';
-type DateFilter = '3D' | '7D' | '30D';
+type DateFilter = '3d' | '1w' | '1m';
type ApiDateFilter = 'rank3Days' | 'rank7Days' | 'rank30Days';
export const FILTER_TO_API_FILTER: Record = {
- '3D': 'rank3Days',
- '7D': 'rank7Days',
- '30D': 'rank30Days',
+ '3d': 'rank3Days',
+ '1w': 'rank7Days',
+ '1m': 'rank30Days',
};
export function TopPackagesCard(): JSX.Element {
const rpc = useEnhancedRpcClient();
- const [selectedFilter, setSelectedFilter] = useState('3D');
+ const [selectedFilter, setSelectedFilter] = useState('3d');
const { data, isPending } = useQuery({
queryKey: ['top-packages', selectedFilter],
@@ -35,9 +35,10 @@ export function TopPackagesCard(): JSX.Element {
setSelectedFilter(val)}
+ filtersAsChip
/>
-
+
+
+
diff --git a/apps/explorer/src/components/ui/FilterList.tsx b/apps/explorer/src/components/ui/FilterList.tsx
index bb4771910b2..1f0fd48bc90 100644
--- a/apps/explorer/src/components/ui/FilterList.tsx
+++ b/apps/explorer/src/components/ui/FilterList.tsx
@@ -5,23 +5,27 @@
// TODO: This component really shouldn't use the `Tabs` component, it should just use radix,
// and should define it's own styles since the concerns here are pretty different.
-import { ButtonSegment, SegmentedButton } from '@iota/apps-ui-kit';
+import { ButtonSegment, SegmentedButton, Chip } from '@iota/apps-ui-kit';
export interface FilterListProps {
selected: T;
options: readonly T[];
onSelected(value: T): void;
+ filtersAsChip?: boolean;
}
export function FilterList({
options,
selected,
onSelected,
+ filtersAsChip,
}: FilterListProps): JSX.Element {
+ const FilterComponent = filtersAsChip ? Chip : ButtonSegment;
+
return (
{options.map((option) => (
-