diff --git a/apps/insights/src/components/CopyButton/index.module.scss b/apps/insights/src/components/CopyButton/index.module.scss index f4ab5e171b..6770d1df5e 100644 --- a/apps/insights/src/components/CopyButton/index.module.scss +++ b/apps/insights/src/components/CopyButton/index.module.scss @@ -1,8 +1,31 @@ @use "@pythnetwork/component-library/theme"; .copyButton { + display: inline-flex; + flex-flow: row nowrap; + align-items: center; + justify-content: center; + gap: 0.5em; + background: transparent; + transition-property: background-color, color, border-color, outline-color; + transition-duration: 100ms; + transition-timing-function: linear; + border: 1px solid transparent; + outline-offset: 0; + outline: theme.spacing(1) solid transparent; + -webkit-tap-highlight-color: transparent; + border-radius: theme.border-radius("base"); + cursor: pointer; + line-height: 150%; + padding-left: 0.5em; + padding-right: 0.5em; + margin-left: -0.5em; + margin-right: -0.5em; + .iconContainer { position: relative; + height: 1em; + width: 1em; .copyIcon { opacity: 0.5; @@ -24,13 +47,26 @@ } } - &[data-is-copied] .iconContainer { - .copyIcon { - opacity: 0; - } + &[data-focus-visible] { + border-color: theme.color("focus"); + outline-color: theme.color("focus-dim"); + } - .checkIcon { - opacity: 1; + &[data-hovered] { + background-color: theme.color("button", "outline", "background", "hover"); + } + + &[data-is-copied] { + background-color: theme.color("states", "info", "background"); + + .iconContainer { + .copyIcon { + opacity: 0; + } + + .checkIcon { + opacity: 1; + } } } } diff --git a/apps/insights/src/components/CopyButton/index.tsx b/apps/insights/src/components/CopyButton/index.tsx index 53de57de10..200e2a82f0 100644 --- a/apps/insights/src/components/CopyButton/index.tsx +++ b/apps/insights/src/components/CopyButton/index.tsx @@ -3,22 +3,20 @@ import { Check } from "@phosphor-icons/react/dist/ssr/Check"; import { Copy } from "@phosphor-icons/react/dist/ssr/Copy"; import { useLogger } from "@pythnetwork/app-logger"; -import { - type Props as ButtonProps, - Button, -} from "@pythnetwork/component-library/Button"; -import type { Button as UnstyledButton } from "@pythnetwork/component-library/unstyled/Button"; +import { Button } from "@pythnetwork/component-library/unstyled/Button"; import clsx from "clsx"; -import { useCallback, useEffect, useState } from "react"; +import { type ComponentProps, useCallback, useEffect, useState } from "react"; import styles from "./index.module.scss"; +const COPY_INDICATOR_TIME = 1000; + type OwnProps = { text: string; }; type Props = Omit< - ButtonProps, + ComponentProps, keyof OwnProps | "onPress" | "afterIcon" > & OwnProps; @@ -46,7 +44,7 @@ export const CopyButton = ({ text, children, className, ...props }: Props) => { if (isCopied) { const timeout = setTimeout(() => { setIsCopied(false); - }, 2000); + }, COPY_INDICATOR_TIME); return () => { clearTimeout(timeout); }; @@ -59,16 +57,18 @@ export const CopyButton = ({ text, children, className, ...props }: Props) => { ); }; diff --git a/apps/insights/src/components/EntityList/index.module.scss b/apps/insights/src/components/EntityList/index.module.scss index a641bfef73..fb93c38e07 100644 --- a/apps/insights/src/components/EntityList/index.module.scss +++ b/apps/insights/src/components/EntityList/index.module.scss @@ -16,6 +16,7 @@ outline-color 100ms linear, background-color 100ms linear; -webkit-tap-highlight-color: transparent; + cursor: pointer; &[data-focus-visible] { outline: theme.spacing(0.5) solid theme.color("focus"); diff --git a/apps/insights/src/components/PriceFeed/layout.module.scss b/apps/insights/src/components/PriceFeed/layout.module.scss index efd749b12b..ad50baf973 100644 --- a/apps/insights/src/components/PriceFeed/layout.module.scss +++ b/apps/insights/src/components/PriceFeed/layout.module.scss @@ -30,8 +30,8 @@ .rightGroup { display: flex; flex-flow: row nowrap; - align-items: center; - gap: theme.spacing(2); + align-items: stretch; + gap: theme.spacing(4); & > * { flex: 1 1 0; diff --git a/apps/insights/src/components/PriceFeed/layout.tsx b/apps/insights/src/components/PriceFeed/layout.tsx index debdccc5e4..f9d0613848 100644 --- a/apps/insights/src/components/PriceFeed/layout.tsx +++ b/apps/insights/src/components/PriceFeed/layout.tsx @@ -68,8 +68,6 @@ export const PriceFeedLayout = async ({ children, params }: Props) => {
diff --git a/apps/insights/src/components/PriceFeeds/price-feeds-card.module.scss b/apps/insights/src/components/PriceFeeds/price-feeds-card.module.scss index 27f05e18f1..7288aad7e6 100644 --- a/apps/insights/src/components/PriceFeeds/price-feeds-card.module.scss +++ b/apps/insights/src/components/PriceFeeds/price-feeds-card.module.scss @@ -20,8 +20,4 @@ display: none; } } - - .feedKey { - margin: -#{theme.button-padding("sm", false)}; - } } diff --git a/apps/insights/src/components/PriceFeeds/price-feeds-card.tsx b/apps/insights/src/components/PriceFeeds/price-feeds-card.tsx index 0dc9d5f282..3e490a9891 100644 --- a/apps/insights/src/components/PriceFeeds/price-feeds-card.tsx +++ b/apps/insights/src/components/PriceFeeds/price-feeds-card.tsx @@ -143,12 +143,7 @@ const ResolvedPriceFeedsCard = ({ priceFeeds, ...props }: Props) => { priceFeedName: , assetClass: , priceFeedId: ( - + ), }, }), diff --git a/apps/insights/src/components/Publisher/layout.tsx b/apps/insights/src/components/Publisher/layout.tsx index 5a24a67f5e..685d5f33c2 100644 --- a/apps/insights/src/components/Publisher/layout.tsx +++ b/apps/insights/src/components/Publisher/layout.tsx @@ -105,7 +105,7 @@ export const PublishersLayout = async ({ children, params }: Props) => { items={[ { href: "/", label: "Home" }, { href: "/publishers", label: "Publishers" }, - { label: }, + { label: }, ]} />
diff --git a/apps/insights/src/components/PublisherKey/index.module.scss b/apps/insights/src/components/PublisherKey/index.module.scss deleted file mode 100644 index aaa125b0a7..0000000000 --- a/apps/insights/src/components/PublisherKey/index.module.scss +++ /dev/null @@ -1,9 +0,0 @@ -@use "@pythnetwork/component-library/theme"; - -.publisherKey { - @each $size, $values in theme.$button-sizes { - &[data-size="#{$size}"] { - margin: 0 -#{theme.button-padding($size, true)}; - } - } -} diff --git a/apps/insights/src/components/PublisherKey/index.tsx b/apps/insights/src/components/PublisherKey/index.tsx index ac6642d636..465183c874 100644 --- a/apps/insights/src/components/PublisherKey/index.tsx +++ b/apps/insights/src/components/PublisherKey/index.tsx @@ -1,7 +1,5 @@ -import clsx from "clsx"; import type { ComponentProps } from "react"; -import styles from "./index.module.scss"; import { CopyButton } from "../CopyButton"; type KeyProps = Omit< @@ -11,17 +9,8 @@ type KeyProps = Omit< publisherKey: string; }; -export const PublisherKey = ({ - publisherKey, - className, - ...props -}: KeyProps) => ( - +export const PublisherKey = ({ publisherKey, ...props }: KeyProps) => ( + {`${publisherKey.slice(0, 4)}...${publisherKey.slice(-4)}`} ); diff --git a/apps/insights/src/components/PublisherTag/index.module.scss b/apps/insights/src/components/PublisherTag/index.module.scss index 9d4c77a1cf..20fb0b99ad 100644 --- a/apps/insights/src/components/PublisherTag/index.module.scss +++ b/apps/insights/src/components/PublisherTag/index.module.scss @@ -43,7 +43,8 @@ align-items: flex-start; .key { - margin-bottom: -#{theme.spacing(2)}; + font-size: theme.font-size("xs"); + margin-bottom: -0.5em; } } diff --git a/apps/insights/src/components/PublisherTag/index.tsx b/apps/insights/src/components/PublisherTag/index.tsx index 15e63ce535..c7648fcb23 100644 --- a/apps/insights/src/components/PublisherTag/index.tsx +++ b/apps/insights/src/components/PublisherTag/index.tsx @@ -68,7 +68,7 @@ const Contents = (props: Props) => { return props.name ? (
{props.name}
) : ( - + ); } else if (props.name) { return ( @@ -77,11 +77,10 @@ const Contents = (props: Props) => { ); } else { - return ; + return ; } };