Skip to content
Merged
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
16 changes: 16 additions & 0 deletions apps/insights/src/components/Explanations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ import { useMemo } from "react";
import { Explain } from "../Explain";
import { FormattedDate } from "../FormattedDate";

export const ExplainRanking = ({
scoreTime,
}: {
scoreTime?: Date | undefined;
}) => {
return (
<Explain size="xs" title="Permissioned Feeds">
<p>
The publisher{"'"}s <b>ranking</b> is determined by the number of{" "}
<b>Price Feeds</b> that publisher has permissions to publish to.
</p>
{scoreTime && <EvaluationTime scoreTime={scoreTime} />}
</Explain>
);
};

export const ExplainPermissioned = ({
scoreTime,
}: {
Expand Down
2 changes: 0 additions & 2 deletions apps/insights/src/components/Publishers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ const toTableRow = ({
key,
rank,
permissionedFeeds,
inactiveFeeds,
activeFeeds,
averageScore,
}: Awaited<ReturnType<typeof getPublishers>>[number]) => {
Expand All @@ -158,7 +157,6 @@ const toTableRow = ({
ranking: rank,
permissionedFeeds,
activeFeeds,
inactiveFeeds,
averageScore,
...(knownPublisher && {
name: knownPublisher.name,
Expand Down
38 changes: 9 additions & 29 deletions apps/insights/src/components/Publishers/publishers-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { EntityList } from "../EntityList";
import {
ExplainPermissioned,
ExplainActive,
ExplainInactive,
ExplainRanking,
} from "../Explanations";
import { NoResults } from "../NoResults";
import { PublisherTag } from "../PublisherTag";
Expand All @@ -49,7 +49,6 @@ type Publisher = {
ranking: number;
permissionedFeeds: number;
activeFeeds: number;
inactiveFeeds: number;
averageScore: number;
} & (
| { name: string; icon: ReactNode }
Expand Down Expand Up @@ -106,7 +105,6 @@ const ResolvedPublishersCard = ({
case "ranking":
case "permissionedFeeds":
case "activeFeeds":
case "inactiveFeeds":
case "averageScore": {
return (
(direction === "descending" ? -1 : 1) * (a[column] - b[column])
Expand Down Expand Up @@ -139,7 +137,6 @@ const ResolvedPublishersCard = ({
averageScore,
permissionedFeeds,
activeFeeds,
inactiveFeeds,
...publisher
}) => ({
id,
Expand All @@ -165,14 +162,6 @@ const ResolvedPublishersCard = ({
{activeFeeds}
</Link>
),
inactiveFeeds: (
<Link
href={`/publishers/${cluster}/${id}/price-feeds?status=Inactive`}
invert
>
{inactiveFeeds}
</Link>
),
averageScore: (
<Score score={averageScore} width={PUBLISHER_SCORE_WIDTH} />
),
Expand Down Expand Up @@ -236,7 +225,6 @@ type PublishersCardContentsProps = Pick<Props, "className" | "explainAverage"> &
| "name"
| "permissionedFeeds"
| "activeFeeds"
| "inactiveFeeds"
| "averageScore"
> & { textValue: string })[];
}
Expand Down Expand Up @@ -314,7 +302,6 @@ const PublishersCardContents = ({
{ id: "averageScore", name: "Average Score" },
{ id: "permissionedFeeds", name: "Permissioned Feeds" },
{ id: "activeFeeds", name: "Active Feeds" },
{ id: "inactiveFeeds", name: "Inactive Feeds" },
]}
isLoading={props.isLoading}
rows={
Expand All @@ -340,7 +327,12 @@ const PublishersCardContents = ({
columns={[
{
id: "ranking",
name: "RANKING",
name: (
<>
RANKING
<ExplainRanking />
</>
),
width: 25,
loadingSkeleton: <Ranking isLoading />,
allowsSorting: true,
Expand All @@ -357,7 +349,7 @@ const PublishersCardContents = ({
id: "permissionedFeeds",
name: (
<>
FEEDS
PERMISSIONED
<ExplainPermissioned />
</>
),
Expand All @@ -374,19 +366,7 @@ const PublishersCardContents = ({
</>
),
alignment: "center",
width: 30,
allowsSorting: true,
},
{
id: "inactiveFeeds",
name: (
<>
INACTIVE
<ExplainInactive />
</>
),
alignment: "center",
width: 30,
width: 24,
allowsSorting: true,
},
{
Expand Down
7 changes: 7 additions & 0 deletions apps/insights/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
"DISABLE_ACCESSIBILITY_REPORTING"
]
},
"start:dev": {
"dependsOn": [
"//#install:modules",
"pull:env",
"@pythnetwork/solana-utils#build"
]
},
"fix:lint": {
"dependsOn": [
"//#install:modules",
Expand Down