Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/insights/src/app/price-feeds/layout.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { Metadata } from "next";
import type { ReactNode } from "react";

export { ZoomLayoutTransition as default } from "../../components/ZoomLayoutTransition";
const Layout = ({ children }: { children: ReactNode }) => children;
export default Layout;
// export { ZoomLayoutTransition as default } from "../../components/ZoomLayoutTransition";

export const metadata: Metadata = {
title: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { PriceFeedsLoading as default } from "../../../../../components/Publisher/price-feeds-loading";
5 changes: 4 additions & 1 deletion apps/insights/src/app/publishers/layout.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { Metadata } from "next";
import type { ReactNode } from "react";

export { ZoomLayoutTransition as default } from "../../components/ZoomLayoutTransition";
const Layout = ({ children }: { children: ReactNode }) => children;
export default Layout;
// export { ZoomLayoutTransition as default } from "../../components/ZoomLayoutTransition";

export const metadata: Metadata = {
title: {
Expand Down
8 changes: 3 additions & 5 deletions apps/insights/src/components/PriceComponentsCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,9 @@ export const PriceComponentsCardContents = <
title={
<>
<span>{label}</span>
{!props.isLoading && (
<Badge style="filled" variant="neutral" size="md">
{props.numResults}
</Badge>
)}
<Badge style="filled" variant="neutral" size="md">
{!props.isLoading && props.numResults}
</Badge>
</>
}
toolbar={
Expand Down
22 changes: 22 additions & 0 deletions apps/insights/src/components/Publisher/price-feeds-loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"use client";

import { PriceComponentsCardContents } from "../PriceComponentsCard";
import { PriceFeedTag } from "../PriceFeedTag";

export const PriceFeedsLoading = () => (
<PriceComponentsCardContents
label="Price Feeds"
searchPlaceholder="Feed symbol"
nameLoadingSkeleton={<PriceFeedTag compact isLoading />}
isLoading
extraColumns={[
{
id: "assetClass",
name: "ASSET CLASS",
alignment: "left",
allowsSorting: true,
},
]}
nameWidth={90}
/>
);
79 changes: 40 additions & 39 deletions apps/insights/src/components/Root/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,47 @@ export const MainNavTabs = (
return <MainNavTabsComponent pathname={pathname} {...props} />;
};

export const TabPanel = ({
children,
...props
}: Omit<ComponentProps<typeof UnstyledTabPanel>, "id">) => {
export const TabPanel = (
props: Omit<ComponentProps<typeof UnstyledTabPanel>, "id">,
) => {
const tabId = useSelectedLayoutSegment() ?? "";

return (
<UnstyledTabPanel key="tabpanel" id={tabId} {...props}>
{(args) => (
<LayoutTransition
variants={{
initial: (custom) => ({
opacity: 0,
x: isMovingLeft(custom) ? "-2%" : "2%",
}),
exit: (custom) => ({
opacity: 0,
x: isMovingLeft(custom) ? "2%" : "-2%",
transition: {
x: { type: "spring", bounce: 0 },
},
}),
}}
initial="initial"
animate={{
opacity: 1,
x: 0,
transition: {
x: { type: "spring", bounce: 0 },
},
}}
exit="exit"
>
{typeof children === "function" ? children(args) : children}
</LayoutTransition>
)}
</UnstyledTabPanel>
);
return <UnstyledTabPanel key="tabpanel" id={tabId} {...props} />;

// return (
// <UnstyledTabPanel key="tabpanel" id={tabId} {...props}>
// {(args) => (
// <LayoutTransition
// variants={{
// initial: (custom) => ({
// opacity: 0,
// x: isMovingLeft(custom) ? "-2%" : "2%",
// }),
// exit: (custom) => ({
// opacity: 0,
// x: isMovingLeft(custom) ? "2%" : "-2%",
// transition: {
// x: { type: "spring", bounce: 0 },
// },
// }),
// }}
// initial="initial"
// animate={{
// opacity: 1,
// x: 0,
// transition: {
// x: { type: "spring", bounce: 0 },
// },
// }}
// exit="exit"
// >
// {typeof children === "function" ? children(args) : children}
// </LayoutTransition>
// )}
// </UnstyledTabPanel>
// );
};

const isMovingLeft = ({ segment, prevSegment }: VariantArg): boolean =>
segment === null ||
(segment === "publishers" && prevSegment === "price-feeds");
// const isMovingLeft = ({ segment, prevSegment }: VariantArg): boolean =>
// segment === null ||
// (segment === "publishers" && prevSegment === "price-feeds");
75 changes: 38 additions & 37 deletions apps/insights/src/components/Tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useSelectedLayoutSegment, usePathname } from "next/navigation";
import type { ComponentProps } from "react";
import { useMemo } from "react";

import { LayoutTransition } from "../LayoutTransition";
// import { LayoutTransition } from "../LayoutTransition";

export const TabRoot = (
props: Omit<ComponentProps<typeof UnstyledTabs>, "selectedKey">,
Expand Down Expand Up @@ -44,42 +44,43 @@ export const Tabs = ({ prefix, items, ...props }: TabsProps) => {
return <TabList pathname={pathname} items={mappedItems} {...props} />;
};

export const TabPanel = ({
children,
...props
}: Omit<ComponentProps<typeof UnstyledTabPanel>, "id">) => {
export const TabPanel = (
props: Omit<ComponentProps<typeof UnstyledTabPanel>, "id">,
) => {
const tabId = useSelectedLayoutSegment() ?? "";

return (
<UnstyledTabPanel key="tabpanel" id={tabId} {...props}>
{(args) => (
<LayoutTransition
variants={{
initial: ({ segment }) => ({
opacity: 0,
x: segment === null ? "-2%" : "2%",
}),
exit: ({ segment }) => ({
opacity: 0,
x: segment === null ? "2%" : "-2%",
transition: {
x: { type: "spring", bounce: 0 },
},
}),
}}
initial="initial"
animate={{
opacity: 1,
x: 0,
transition: {
x: { type: "spring", bounce: 0 },
},
}}
exit="exit"
>
{typeof children === "function" ? children(args) : children}
</LayoutTransition>
)}
</UnstyledTabPanel>
);
return <UnstyledTabPanel key="tabpanel" id={tabId} {...props} />;

// return (
// <UnstyledTabPanel key="tabpanel" id={tabId} {...props}>
// {(args) => (
// <LayoutTransition
// variants={{
// initial: ({ segment }) => ({
// opacity: 0,
// x: segment === null ? "-2%" : "2%",
// }),
// exit: ({ segment }) => ({
// opacity: 0,
// x: segment === null ? "2%" : "-2%",
// transition: {
// x: { type: "spring", bounce: 0 },
// },
// }),
// }}
// initial="initial"
// animate={{
// opacity: 1,
// x: 0,
// transition: {
// x: { type: "spring", bounce: 0 },
// },
// }}
// exit="exit"
// >
// {typeof children === "function" ? children(args) : children}
// </LayoutTransition>
// )}
// </UnstyledTabPanel>
// );
};
Loading