-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(insights): initial app shell & index pages
- Loading branch information
Showing
89 changed files
with
4,051 additions
and
762 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v20.17.0 | ||
v20.18.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
nodejs 20.17.0 | ||
pnpm 9.12.1 | ||
nodejs 20.18.0 | ||
pnpm 9.12.3 | ||
rust 1.78.0 | ||
python 3.12.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Loading as default } from "../components/Loading"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { Home as default } from "../components/Home"; | ||
export { Overview as default } from "../components/Overview"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { PriceFeedsLayout as default } from "../../components/PriceFeeds/layout"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { PriceFeedsLoading as default } from "../../components/PriceFeeds/loading"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { PriceFeeds as default } from "../../components/PriceFeeds"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { PublishersLayout as default } from "../../components/Publishers/layout"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { PublishersLoading as default } from "../../components/Publishers/loading"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Publishers as default } from "../../components/Publishers"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createClient } from "@clickhouse/client"; | ||
|
||
import { CLICKHOUSE } from "./config/server"; | ||
|
||
export const client = createClient(CLICKHOUSE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
"use client"; | ||
|
||
import { Copy, Check } from "@phosphor-icons/react/dist/ssr"; | ||
import { useLogger } from "@pythnetwork/app-logger"; | ||
import { UnstyledButton } from "@pythnetwork/component-library/UnstyledButton"; | ||
import clsx from "clsx"; | ||
import { type ComponentProps, useCallback, useEffect, useState } from "react"; | ||
|
||
type CopyButtonProps = ComponentProps<typeof UnstyledButton> & { | ||
text: string; | ||
}; | ||
|
||
export const CopyButton = ({ | ||
text, | ||
children, | ||
className, | ||
...props | ||
}: CopyButtonProps) => { | ||
const [isCopied, setIsCopied] = useState(false); | ||
const logger = useLogger(); | ||
const copy = useCallback(() => { | ||
// eslint-disable-next-line n/no-unsupported-features/node-builtins | ||
navigator.clipboard | ||
.writeText(text) | ||
.then(() => { | ||
setIsCopied(true); | ||
}) | ||
.catch((error: unknown) => { | ||
/* TODO do something here? */ | ||
logger.error(error); | ||
}); | ||
}, [text, logger]); | ||
|
||
useEffect(() => { | ||
setIsCopied(false); | ||
}, [text]); | ||
|
||
useEffect(() => { | ||
if (isCopied) { | ||
const timeout = setTimeout(() => { | ||
setIsCopied(false); | ||
}, 2000); | ||
return () => { | ||
clearTimeout(timeout); | ||
}; | ||
} else { | ||
return; | ||
} | ||
}, [isCopied]); | ||
|
||
return ( | ||
<UnstyledButton | ||
onPress={copy} | ||
isDisabled={isCopied} | ||
className={clsx( | ||
"group/copy-button mx-[-0.5em] -mt-0.5 inline-block whitespace-nowrap rounded-md px-[0.5em] py-0.5 outline-none outline-0 outline-steel-600 transition data-[hovered]:bg-black/5 data-[focus-visible]:outline-2 dark:outline-steel-300 dark:data-[hovered]:bg-white/10", | ||
className, | ||
)} | ||
{...(isCopied && { "data-is-copied": true })} | ||
{...props} | ||
> | ||
{(...args) => ( | ||
<> | ||
<span> | ||
{typeof children === "function" ? children(...args) : children} | ||
</span> | ||
<span className="relative top-[0.125em] ml-1 inline-block"> | ||
<span className="opacity-50 transition-opacity duration-100 group-data-[is-copied]/copy-button:opacity-0"> | ||
<Copy className="size-[1em]" /> | ||
<div className="sr-only">Copy to clipboard</div> | ||
</span> | ||
<Check className="absolute inset-0 text-green-600 opacity-0 transition-opacity duration-100 group-data-[is-copied]/copy-button:opacity-100" /> | ||
</span> | ||
</> | ||
)} | ||
</UnstyledButton> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import clsx from "clsx"; | ||
import type { ComponentProps } from "react"; | ||
|
||
export const H1 = ({ className, children, ...props }: ComponentProps<"h1">) => ( | ||
<h1 className={clsx(className, "text-2xl font-medium")} {...props}> | ||
{children} | ||
</h1> | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Skeleton } from "@pythnetwork/component-library/Skeleton"; | ||
|
||
import { H1 } from "../H1"; | ||
import { MaxWidth } from "../MaxWidth"; | ||
|
||
export const Loading = () => ( | ||
<MaxWidth> | ||
<H1> | ||
<Skeleton className="w-60" /> | ||
</H1> | ||
</MaxWidth> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import clsx from "clsx"; | ||
import type { ComponentProps } from "react"; | ||
|
||
export const MaxWidth = ({ className, ...props }: ComponentProps<"div">) => ( | ||
<div | ||
className={clsx("mx-auto box-content max-w-screen-2xl px-6", className)} | ||
{...props} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { ButtonLink } from "@pythnetwork/component-library/Button"; | ||
|
||
import { MaxWidth } from "../MaxWidth"; | ||
|
||
export const NotFound = () => ( | ||
<main> | ||
<MaxWidth> | ||
<h1>Not Found</h1> | ||
<p>{"The page you're looking for isn't here"}</p> | ||
<ButtonLink href="/">Go Home</ButtonLink> | ||
</main> | ||
</MaxWidth> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { H1 } from "../H1"; | ||
import { MaxWidth } from "../MaxWidth"; | ||
|
||
export const Overview = () => ( | ||
<MaxWidth> | ||
<H1>Overview</H1> | ||
</MaxWidth> | ||
); |
Oops, something went wrong.