Skip to content
Open
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
7 changes: 0 additions & 7 deletions apps/insights/src/components/Cards/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,4 @@
max-width: unset;
}
}

.publishersChart,
.priceFeedsChart {
& svg {
cursor: pointer;
}
}
}
7 changes: 7 additions & 0 deletions apps/insights/src/components/Overview/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,11 @@
}
}
}

.publishersChart,
.priceFeedsChart {
& svg {
cursor: pointer;
}
}
}
95 changes: 47 additions & 48 deletions apps/insights/src/components/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,41 +42,23 @@ export const Overview = async () => {

return (
<div className={styles.overview}>
<h1 className={styles.header}>Overview</h1>
<Cards>
<ChartCard
header="Total Volume Traded"
header="Price Feeds"
variant="primary"
data={totalVolumeTraded.map(({ date, volume }) => ({
x: date,
displayX: <FormattedDate value={date} />,
y: volume,
displayY: (
<FormattedNumber
value={volume}
currency="usd"
style="currency"
notation="compact"
/>
),
}))}
href="/price-feeds"
chartClassName={styles.priceFeedsChart}
data={feedCounts}
miniStat={
<ChangePercent
previousValue={totalVolumeTraded.at(-2)?.volume ?? 0}
currentValue={totalVolumeTraded.at(-1)?.volume ?? 0}
/>
}
stat={
<FormattedNumber
value={totalVolumeTraded.at(-1)?.volume ?? 0}
currency="usd"
style="currency"
notation="compact"
previousValue={feedCounts.at(-2)?.y ?? 0}
currentValue={feedCounts.at(-1)?.y ?? 0}
/>
}
stat={feedCounts.at(-1)?.y}
/>
<ChartCard
header="Publishers Onboarded"
header="Publishers"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should remain "Publishers Onboarded" -- we have 2 different numbers for publishers that we highlight in different places:

  • "Publishers Onboarded" refers to the number of publishers who can publish / be permissioned
  • "Active Publishers" refers to the number of publishers who are actively permissioned in pythnet and are pushing data

We used to just have the word "Publishers" here but it was confusing because people would see different counts in different places.

Obviously I don't care about the exact terminology, but the distinction needs to exist.

href="/publishers"
chartClassName={styles.publishersChart}
data={activePublishers.map(({ date, numPublishers }) => ({
Expand All @@ -93,32 +75,49 @@ export const Overview = async () => {
stat={activePublishers.at(-1)?.numPublishers}
/>
<ChartCard
header="Price Feeds (Active + Coming Soon)"
href="/price-feeds"
chartClassName={styles.priceFeedsChart}
data={feedCounts}
header="Chains"
data={activeChains.map(({ date, chains }) => ({
x: date,
displayX: <FormattedDate value={date} />,
y: chains,
}))}
miniStat={
<ChangePercent
previousValue={feedCounts.at(-2)?.y ?? 0}
currentValue={feedCounts.at(-1)?.y ?? 0}
previousValue={activeChains.at(-2)?.chains ?? 0}
currentValue={activeChains.at(-1)?.chains ?? 0}
/>
}
stat={feedCounts.at(-1)?.y}
stat={activeChains.at(-1)?.chains}
/>
<ChartCard
header="Active Chains"
data={activeChains.map(({ date, chains }) => ({
header="Total Volume Traded"
data={totalVolumeTraded.map(({ date, volume }) => ({
x: date,
displayX: <FormattedDate value={date} />,
y: chains,
y: volume,
displayY: (
<FormattedNumber
value={volume}
currency="usd"
style="currency"
notation="compact"
/>
),
}))}
miniStat={
<ChangePercent
previousValue={activeChains.at(-2)?.chains ?? 0}
currentValue={activeChains.at(-1)?.chains ?? 0}
previousValue={totalVolumeTraded.at(-2)?.volume ?? 0}
currentValue={totalVolumeTraded.at(-1)?.volume ?? 0}
/>
}
stat={
<FormattedNumber
value={totalVolumeTraded.at(-1)?.volume ?? 0}
currency="usd"
style="currency"
notation="compact"
/>
}
stat={activeChains.at(-1)?.chains}
/>
</Cards>
<Tabs orientation="vertical" className={styles.overviewMainContent ?? ""}>
Expand Down Expand Up @@ -158,24 +157,24 @@ export const Overview = async () => {
label="test"
className={styles.tabList ?? ""}
items={[
{
id: "publishers",
header: "Publishers",
body: "Get insights about quality, ranking, and performance of each Publisher contributing to the network.",
},
{
id: "price feeds",
header: "Price Feeds",
body: "See information about every price feed's price, performance, components, and technical aspects all in one place for a better integration experience.",
},
{
id: "publishers",
header: "Publishers",
body: "Get insights about quality, ranking, and performance of each Publisher contributing to the network.",
},
]}
/>
<div className={styles.buttons}>
<Button href="/publishers" variant="solid" size="md">
Publishers
<Button href="/price-feeds" variant="solid" size="md">
Explore Price Feeds
</Button>
<Button href="/price-feeds" variant="outline" size="md">
Price Feeds
<Button href="/publishers" variant="ghost" size="md">
View Publishers
</Button>
</div>
</Tabs>
Expand Down
4 changes: 2 additions & 2 deletions apps/insights/src/components/Root/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { PriceFeedIcon } from "../PriceFeedIcon";
import { PublisherIcon } from "../PublisherIcon";

export const TABS = [
{ segment: "", children: "Overview" },
{ segment: "publishers", children: "Publishers" },
{ segment: "", children: "Home" },
{ segment: "price-feeds", children: "Price Feeds" },
{ segment: "publishers", children: "Publishers" },
];

type Props = {
Expand Down
6 changes: 3 additions & 3 deletions packages/component-library/src/Card/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,23 @@
background: theme.color("background", "card-highlight");

&[data-hovered] {
@include theme.elevation("primary", 2);
@include theme.elevation("primary", 1);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I preferred elevation 2 here...

}
}

&[data-variant="secondary"] {
background: theme.color("background", "secondary");

&[data-hovered] {
@include theme.elevation("default", 2);
@include theme.elevation("default", 1);
}
}

&[data-variant="tertiary"] {
background: theme.color("background", "primary");

&[data-hovered] {
@include theme.elevation("default", 2);
@include theme.elevation("default", 1);
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/component-library/src/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,10 @@ $max-width-padding: var(--max-width-padding);

$elevations: (
primary: (
1: (
0px 4px 6px -4px rgb(112 66 206 / 10%),
0px 10px 15px -3px rgb(112 66 206 / 10%),
),
2: (
0px 66px 18px 0px rgb(112 66 206 / 0%),
0px 42px 17px 0px rgb(112 66 206 / 3%),
Expand Down
Loading