Преглед изворни кода

Merge pull request #2548 from pyth-network/cprussin/publisher-table-improvements

feat(insights): publisher table improvements
Connor Prussin пре 7 месеци
родитељ
комит
a1ad7f3850

+ 16 - 0
apps/insights/src/components/Explanations/index.tsx

@@ -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,
 }: {

+ 0 - 2
apps/insights/src/components/Publishers/index.tsx

@@ -148,7 +148,6 @@ const toTableRow = ({
   key,
   rank,
   permissionedFeeds,
-  inactiveFeeds,
   activeFeeds,
   averageScore,
 }: Awaited<ReturnType<typeof getPublishers>>[number]) => {
@@ -158,7 +157,6 @@ const toTableRow = ({
     ranking: rank,
     permissionedFeeds,
     activeFeeds,
-    inactiveFeeds,
     averageScore,
     ...(knownPublisher && {
       name: knownPublisher.name,

+ 9 - 29
apps/insights/src/components/Publishers/publishers-card.tsx

@@ -27,7 +27,7 @@ import { EntityList } from "../EntityList";
 import {
   ExplainPermissioned,
   ExplainActive,
-  ExplainInactive,
+  ExplainRanking,
 } from "../Explanations";
 import { NoResults } from "../NoResults";
 import { PublisherTag } from "../PublisherTag";
@@ -49,7 +49,6 @@ type Publisher = {
   ranking: number;
   permissionedFeeds: number;
   activeFeeds: number;
-  inactiveFeeds: number;
   averageScore: number;
 } & (
   | { name: string; icon: ReactNode }
@@ -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])
@@ -139,7 +137,6 @@ const ResolvedPublishersCard = ({
           averageScore,
           permissionedFeeds,
           activeFeeds,
-          inactiveFeeds,
           ...publisher
         }) => ({
           id,
@@ -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} />
             ),
@@ -236,7 +225,6 @@ type PublishersCardContentsProps = Pick<Props, "className" | "explainAverage"> &
           | "name"
           | "permissionedFeeds"
           | "activeFeeds"
-          | "inactiveFeeds"
           | "averageScore"
         > & { textValue: string })[];
       }
@@ -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={
@@ -340,7 +327,12 @@ const PublishersCardContents = ({
       columns={[
         {
           id: "ranking",
-          name: "RANKING",
+          name: (
+            <>
+              RANKING
+              <ExplainRanking />
+            </>
+          ),
           width: 25,
           loadingSkeleton: <Ranking isLoading />,
           allowsSorting: true,
@@ -357,7 +349,7 @@ const PublishersCardContents = ({
           id: "permissionedFeeds",
           name: (
             <>
-              FEEDS
+              PERMISSIONED
               <ExplainPermissioned />
             </>
           ),
@@ -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,
         },
         {

+ 7 - 0
apps/insights/turbo.json

@@ -14,6 +14,13 @@
         "DISABLE_ACCESSIBILITY_REPORTING"
       ]
     },
+    "start:dev": {
+      "dependsOn": [
+        "//#install:modules",
+        "pull:env",
+        "@pythnetwork/solana-utils#build"
+      ]
+    },
     "fix:lint": {
       "dependsOn": [
         "//#install:modules",