Joystream Stats 2 роки тому
батько
коміт
64900fb1ea

+ 4 - 4
src/components/AppBar/config.ts

@@ -11,10 +11,10 @@ export const routes = {
   spending: "Spending",
   transactions: "Transfers",
   burners: "Top Burners",
-  mint: "Mints",
-  kpi: "KPI",
-  faq: "FAQ",
-  survey: "Survey",
+  //mint: "Mints",
+  //kpi: "KPI",
+  //faq: "FAQ",
+  //survey: "Survey",
   issues: "Issues",
   election: "Election",
 } as { [key: string]: string };

+ 4 - 2
src/components/Councils/styles.tsx

@@ -18,6 +18,8 @@ export const electionStyles = makeStyles((theme: Theme) =>
     acc: {
       color: "#fff",
       backgroundColor: "#000",
+      defautExpanded: true,
+      expanded: true,
     },
     grid: {
       textAlign: "center",
@@ -80,11 +82,11 @@ export const electionStyles = makeStyles((theme: Theme) =>
       cursor: "pointer",
     },
     backerInfo: {
-      textAlign: "center"
+      textAlign: "center",
     },
     dividerPrimary: {
       backgroundColor: "#4038FF",
-    }
+    },
   })
 );
 

+ 0 - 21
src/components/KPI/Leaderboard.tsx

@@ -12,27 +12,6 @@ import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
 import { Tokenomics } from "../../types";
 import { Loading } from "..";
 
-interface LeaderboardMember {
-  id: number;
-  handle: string;
-  totalEarnedUsd: number;
-  totalEarnedTjoy: number;
-  timesElected: number;
-  usdPerElection: number;
-  tjoyPerElection: number;
-}
-interface CouncilMember {
-  id: number;
-  handle: string;
-  rewardUsd: 51;
-  rewardTjoy: number;
-}
-interface Kpi {
-  kpi: number;
-  totalPossibleRewardsUsd: 3525;
-  councilMembers: CouncilMember[];
-}
-
 const useStyles = makeStyles((theme: Theme) =>
   createStyles({
     root: {

+ 1 - 2
src/components/KPI/index.tsx

@@ -3,10 +3,9 @@ import { Link } from "react-router-dom";
 import { Button } from "react-bootstrap";
 import { Typography } from "@material-ui/core";
 import { Loading } from "..";
-import axios from "axios";
-
 import Leaderboard from "./Leaderboard";
 import Round from "./Round";
+import axios from "axios";
 
 const baseUrl = `https://joystreamstats.live/static`;
 

+ 0 - 1
src/components/Openings/Applications.tsx

@@ -1,6 +1,5 @@
 import Details from "./Details";
 import InfoTooltip from "../Tooltip";
-import { domain } from "../../config";
 
 const Applications = (props: { applications: Application[] }) => {
   const { applications } = props;

+ 0 - 1
src/components/Openings/Opening.tsx

@@ -7,7 +7,6 @@ import { Opening } from "./types";
 
 const GroupOpening = (props: { group: string; opening: Opening }) => {
   const { group, opening } = props;
-  const { id, type, applications } = opening;
   const details = JSON.parse(opening.human_readable_text);
   return (
     <div>

+ 0 - 1
src/components/Proposals/Spending.tsx

@@ -21,7 +21,6 @@ const Spending = (props: IState) => {
   console.log(spending);
 
   const rounds: ProposalDetail[][] = [];
-  let unknown = 0;
   let sum = 0;
   let sums: number[] = [];
   spending.forEach((p) => {

+ 1 - 3
src/components/Tokenomics/Groups.tsx

@@ -105,9 +105,7 @@ const Group = (props: {
 const Mint = (props: { mint: { capacity: number; total_minted: number } }) => {
   const { mint } = props;
   if (!mint) return <div />;
-  const { capacity, total_minted } = mint;
-  const current = (capacity / 1000000).toFixed(1);
-  const total = (total_minted / 1000000).toFixed(1);
+  const current = (mint.capacity / 1000000).toFixed(1);
   const color = current < 1 ? `danger` : current < 2 ? `warning` : `success`;
   return (
     <Button className="p-1" variant={color} title="Mint Capacity">

+ 0 - 2
src/components/Tokenomics/Overview.tsx

@@ -9,8 +9,6 @@ const mJoy = (joy: number) =>
 const Overview = (props: { groups: any[]; tokenomics: Tokenomics }) => {
   const { groups, tokenomics, proposals } = props;
   const { price, totalIssuance, dollarPool } = tokenomics;
-  const validators = groups.find((g) => g.id === "validators");
-  const council = groups.find((g) => g.id === "council");
   const budget = dollarPool.replenishAmount;
   const proposalsPaid = proposals.reduce((sum, p) => sum + p.amount, 0);
   const bounties = proposals

+ 0 - 1
src/components/Tokenomics/Spending.tsx

@@ -1,6 +1,5 @@
 import React from "react";
 import { Table } from "react-bootstrap";
-import Loading from "../Loading";
 import { RoleSpending } from "../../types";
 
 const mJoy = (joy: number) => (joy / 1000000).toFixed(3);

+ 1 - 2
src/components/Tokenomics/index.tsx

@@ -12,7 +12,6 @@ import {
 import Burns from "./Burns";
 import Overview from "./Overview";
 import DollarPoolChanges from "./DollarPoolChanges";
-import ReportBrowser from "./ReportBrowser";
 import TokenValue from "./TokenValue";
 import Spending from "./Spending";
 import Groups from "./Groups";
@@ -37,7 +36,7 @@ const useStyles = makeStyles((theme: Theme) =>
 
 const TokenomicsPage = (props: IProps) => {
   const classes = useStyles();
-  const { reports, tokenomics, council, proposals, mints, workers } = props;
+  const { tokenomics, council, proposals, mints, workers } = props;
   if (!tokenomics) return <Loading target="tokenomics" />;
   const { exchanges, extecutedBurnsAmount, totalIssuance } = tokenomics;
   const groups = groupsMinting(council, workers, props.validators);

+ 0 - 9
src/components/Validators/MinMax.tsx

@@ -1,15 +1,7 @@
-import { createStyles, makeStyles } from "@material-ui/core";
 import { Table } from "react-bootstrap";
 import { Link } from "react-router-dom";
 import { Stakes } from "../../types";
 
-const useStyles = makeStyles((theme: Theme) =>
-  createStyles({
-    root: { flexGrow: 1, backgroundColor: "#4038FF" },
-    title: { textAlign: "left", flexGrow: 1, padding: "3px" },
-  })
-);
-
 const dollar = (d: number) => (d > 0 ? `$ ${d.toFixed(2)}` : "");
 
 const MinMax = (props: {
@@ -23,7 +15,6 @@ const MinMax = (props: {
   reward: number;
   price: number;
 }) => {
-  const classes = useStyles();
   const { issued, stakes, validators, waiting, reward, price } = props;
   if (!stakes || !Object.values(stakes).length) return <span />;
 

+ 25 - 0
src/types.ts

@@ -407,3 +407,28 @@ export interface RoleSpending {
   earning: { joy: number; dollar: number };
   stake: { joy: number; dollar: number };
 }
+
+// KPI
+
+export interface LeaderboardMember {
+  id: number;
+  handle: string;
+  totalEarnedUsd: number;
+  totalEarnedTjoy: number;
+  timesElected: number;
+  usdPerElection: number;
+  tjoyPerElection: number;
+}
+
+export interface CouncilMember {
+  id: number;
+  handle: string;
+  rewardUsd: 51;
+  rewardTjoy: number;
+}
+
+export interface Kpi {
+  kpi: number;
+  totalPossibleRewardsUsd: 3525;
+  councilMembers: CouncilMember[];
+}