Skip to content

Commit 68c1b81

Browse files
authored
Merge pull request #2210 from pyth-network/cprussin/price-feed-chart
fix(component-library): fix prefetching react-aria links
2 parents c2f7225 + 7cd3f93 commit 68c1b81

File tree

56 files changed

+516
-658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+516
-658
lines changed

apps/insights/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"nuqs": "catalog:",
4242
"react": "catalog:",
4343
"react-aria": "catalog:",
44-
"react-aria-components": "catalog:",
4544
"react-dom": "catalog:",
4645
"recharts": "catalog:",
4746
"superjson": "catalog:",

apps/insights/src/components/PriceFeed/price-components-card.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
import { Card } from "@pythnetwork/component-library/Card";
44
import { Paginator } from "@pythnetwork/component-library/Paginator";
5-
import { type RowConfig, Table } from "@pythnetwork/component-library/Table";
5+
import {
6+
type RowConfig,
7+
type SortDescriptor,
8+
Table,
9+
} from "@pythnetwork/component-library/Table";
610
import { type ReactNode, Suspense, useMemo } from "react";
711
import { useFilter, useCollator } from "react-aria";
8-
import type { SortDescriptor } from "react-aria-components";
912

1013
import { useQueryParamFilterPagination } from "../../use-query-param-filter-pagination";
1114
import { FormattedNumber } from "../FormattedNumber";

apps/insights/src/components/PriceFeed/price-feed-select.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
"use client";
22

33
import { DropdownCaretDown } from "@pythnetwork/component-library/DropdownCaretDown";
4-
import { type ReactNode, useMemo, useState } from "react";
5-
import { useCollator, useFilter } from "react-aria";
64
import {
7-
Select,
8-
Button,
9-
Popover,
10-
Dialog,
5+
Virtualizer,
6+
ListLayout,
7+
} from "@pythnetwork/component-library/Virtualizer";
8+
import { Button } from "@pythnetwork/component-library/unstyled/Button";
9+
import { Dialog } from "@pythnetwork/component-library/unstyled/Dialog";
10+
import {
1111
ListBox,
1212
ListBoxItem,
13-
UNSTABLE_Virtualizer as Virtualizer,
14-
UNSTABLE_ListLayout as ListLayout,
13+
} from "@pythnetwork/component-library/unstyled/ListBox";
14+
import { Popover } from "@pythnetwork/component-library/unstyled/Popover";
15+
import { Select } from "@pythnetwork/component-library/unstyled/Select";
16+
import {
1517
TextField,
1618
Input,
17-
} from "react-aria-components";
19+
} from "@pythnetwork/component-library/unstyled/TextField";
20+
import { type ReactNode, useMemo, useState } from "react";
21+
import { useCollator, useFilter } from "react-aria";
1822

1923
import styles from "./price-feed-select.module.scss";
2024

apps/insights/src/components/PriceFeed/tabs.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"use client";
22

3-
import { Tabs as TabsComponent } from "@pythnetwork/component-library/Tabs";
3+
import { TabList } from "@pythnetwork/component-library/TabList";
44
import {
5-
UnstyledTabPanel,
6-
UnstyledTabs,
7-
} from "@pythnetwork/component-library/UnstyledTabs";
5+
TabPanel as UnstyledTabPanel,
6+
Tabs as UnstyledTabs,
7+
} from "@pythnetwork/component-library/unstyled/Tabs";
88
import { useSelectedLayoutSegment, usePathname } from "next/navigation";
99
import { useMemo, type ComponentProps } from "react";
1010

@@ -18,13 +18,10 @@ export const TabRoot = (
1818
return <UnstyledTabs selectedKey={tabId} {...props} />;
1919
};
2020

21-
type TabsProps = Omit<
22-
ComponentProps<typeof TabsComponent>,
23-
"pathname" | "items"
24-
> & {
21+
type TabsProps = Omit<ComponentProps<typeof TabList>, "pathname" | "items"> & {
2522
slug: string;
2623
items: (Omit<
27-
ComponentProps<typeof TabsComponent>["items"],
24+
ComponentProps<typeof TabList>["items"],
2825
"href" | "id"
2926
>[number] & {
3027
segment: string | undefined;
@@ -42,7 +39,7 @@ export const Tabs = ({ slug, items, ...props }: TabsProps) => {
4239
}));
4340
}, [items, slug]);
4441

45-
return <TabsComponent pathname={pathname} items={mappedItems} {...props} />;
42+
return <TabList pathname={pathname} items={mappedItems} {...props} />;
4643
};
4744

4845
export const TabPanel = ({

apps/insights/src/components/PriceFeeds/price-feeds-card.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ import { Card } from "@pythnetwork/component-library/Card";
77
import { Paginator } from "@pythnetwork/component-library/Paginator";
88
import { SearchInput } from "@pythnetwork/component-library/SearchInput";
99
import { Select } from "@pythnetwork/component-library/Select";
10-
import { type RowConfig, Table } from "@pythnetwork/component-library/Table";
10+
import {
11+
type RowConfig,
12+
type SortDescriptor,
13+
Table,
14+
} from "@pythnetwork/component-library/Table";
1115
import { useQueryState, parseAsString } from "nuqs";
1216
import { type ReactNode, Suspense, useCallback, useMemo } from "react";
1317
import { useFilter, useCollator } from "react-aria";
14-
import type { SortDescriptor } from "react-aria-components";
1518

1619
import { useQueryParamFilterPagination } from "../../use-query-param-filter-pagination";
1720
import { SKELETON_WIDTH } from "../LivePrices";

apps/insights/src/components/Publishers/publishers-card.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ import { Badge } from "@pythnetwork/component-library/Badge";
55
import { Card } from "@pythnetwork/component-library/Card";
66
import { Paginator } from "@pythnetwork/component-library/Paginator";
77
import { SearchInput } from "@pythnetwork/component-library/SearchInput";
8-
import { type RowConfig, Table } from "@pythnetwork/component-library/Table";
8+
import {
9+
type RowConfig,
10+
type SortDescriptor,
11+
Table,
12+
} from "@pythnetwork/component-library/Table";
913
import { type ReactNode, Suspense, useMemo } from "react";
1014
import { useFilter, useCollator } from "react-aria";
11-
import type { SortDescriptor } from "react-aria-components";
1215

1316
import { useQueryParamFilterPagination } from "../../use-query-param-filter-pagination";
1417
import { NoResults } from "../NoResults";

apps/insights/src/components/Publishers/semicircle-meter.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"use client";
22

3+
import { Meter } from "@pythnetwork/component-library/unstyled/Meter";
34
import dynamic from "next/dynamic";
45
import { type ComponentProps, Suspense } from "react";
5-
import { Meter } from "react-aria-components";
66
import { PolarAngleAxis, RadialBar } from "recharts";
77

8-
export { Label } from "react-aria-components";
8+
export { Label } from "@pythnetwork/component-library/unstyled/Label";
99

1010
const RadialBarChart = dynamic(
1111
() => import("recharts").then((recharts) => recharts.RadialBarChart),

apps/insights/src/components/Root/nav-link.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use client";
22

3+
import { Link } from "@pythnetwork/component-library/unstyled/Link";
34
import { useSelectedLayoutSegment } from "next/navigation";
45
import type { ReactNode } from "react";
5-
import { Link } from "react-aria-components";
66

77
type Props = {
88
href: string;

apps/insights/src/components/Root/tabs.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
import { MainNavTabs as MainNavTabsComponent } from "@pythnetwork/component-library/MainNavTabs";
44
import {
5-
UnstyledTabPanel,
6-
UnstyledTabs,
7-
} from "@pythnetwork/component-library/UnstyledTabs";
5+
TabPanel as UnstyledTabPanel,
6+
Tabs,
7+
} from "@pythnetwork/component-library/unstyled/Tabs";
88
import { useSelectedLayoutSegment, usePathname } from "next/navigation";
99
import { type ComponentProps } from "react";
1010

1111
import { type VariantArg, LayoutTransition } from "../LayoutTransition";
1212

1313
export const TabRoot = (
14-
props: Omit<ComponentProps<typeof UnstyledTabs>, "selectedKey">,
14+
props: Omit<ComponentProps<typeof Tabs>, "selectedKey">,
1515
) => {
1616
const tabId = useSelectedLayoutSegment() ?? "";
1717

18-
return <UnstyledTabs selectedKey={tabId} {...props} />;
18+
return <Tabs selectedKey={tabId} {...props} />;
1919
};
2020

2121
export const MainNavTabs = (

apps/insights/src/components/Score/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"use client";
22

33
import { Skeleton } from "@pythnetwork/component-library/Skeleton";
4+
import { Meter } from "@pythnetwork/component-library/unstyled/Meter";
45
import type { CSSProperties } from "react";
5-
import { Meter } from "react-aria-components";
66

77
import styles from "./index.module.scss";
88

0 commit comments

Comments
 (0)