Quellcode durchsuchen

drop Back Button

Joystream Stats vor 3 Jahren
Ursprung
Commit
0731cb53ac

+ 10 - 19
src/components/Calendar/index.tsx

@@ -5,7 +5,6 @@ import Timeline from "react-calendar-timeline";
 import "react-calendar-timeline/lib/Timeline.css";
 import "../../index.css";
 import moment from "moment";
-import Back from "../Back";
 import Loading from "../Loading";
 
 import {
@@ -157,24 +156,16 @@ class Calendar extends Component<IProps, IState> {
     );
 
     return (
-      <>
-        <Link className="back left" to={"/"}>
-          <Back history={history} />
-        </Link>
-
-        <div>
-          <Timeline
-            groups={groups.filter((g) => !hide[g.id])}
-            items={items}
-            sidebarWidth={220}
-            sidebarContent={filters}
-            stackItems={true}
-            defaultTimeStart={moment(status.startTime).add(-1, "day")}
-            defaultTimeEnd={moment().add(15, "day")}
-            onItemSelect={this.openItem}
-          />
-        </div>
-      </>
+      <Timeline
+        groups={groups.filter((g) => !hide[g.id])}
+        items={items}
+        sidebarWidth={220}
+        sidebarContent={filters}
+        stackItems={true}
+        defaultTimeStart={moment(status.startTime).add(-1, "day")}
+        defaultTimeEnd={moment().add(15, "day")}
+        onItemSelect={this.openItem}
+      />
     );
   }
 }

+ 0 - 4
src/components/Councils/index.tsx

@@ -2,7 +2,6 @@ import React from "react";
 import { Table } from "react-bootstrap";
 import LeaderBoard from "./Leaderboard";
 import CouncilVotes from "./CouncilVotes";
-import Back from "../Back";
 import { Member, ProposalDetail, Seat, Status } from "../../types";
 
 const Rounds = (props: {
@@ -18,9 +17,6 @@ const Rounds = (props: {
   const stage = status.council.durations;
   return (
     <div className="w-100">
-      <div className="position-fixed" style={{ right: "0", top: "0" }}>
-        <Back history={props.history} />
-      </div>
       <Table className="w-100 text-light">
         <thead>
           <tr>

+ 0 - 1
src/components/Dashboard/index.tsx

@@ -72,7 +72,6 @@ const Dashboard = (props: IProps) => {
             lg={6}
           >
             <Validators
-              hideBackButton={true}
               toggleStar={toggleStar}
               councils={councils}
               handles={handles}

+ 0 - 2
src/components/Members/Member.tsx

@@ -6,7 +6,6 @@ import Posts from "./MemberPosts";
 import Proposals from "./MemberProposals";
 import Loading from "../Loading";
 import NotFound from "./NotFound";
-import Back from "../Back";
 
 const MemberBox = (props: {
   match: { params: { handle: string } };
@@ -39,7 +38,6 @@ const MemberBox = (props: {
 
   return (
     <div>
-      <Back history={props.history} />
       <div className="box">
         {isCouncilMember && <div>council member</div>}
         <a href={`${domain}/#/members/${member.handle}`}>

+ 0 - 2
src/components/Members/index.tsx

@@ -2,7 +2,6 @@ import React from "react";
 import { Handles, Member, Post, ProposalDetail, Seat } from "../../types";
 import MemberBox from "./MemberBox";
 import Loading from "../Loading";
-import Back from "../Back";
 
 interface IProps {
   councils: Seat[][];
@@ -48,7 +47,6 @@ class Members extends React.Component<IProps, IState> {
 
     return (
       <div>
-        <Back history={this.props.history} />
         <h1 className="text-center text-white">Joystream Members</h1>
         <div className="d-flex flew-row justify-content-between">
           {cols.map((col, index: number) => (

+ 0 - 4
src/components/Mint/index.tsx

@@ -1,6 +1,5 @@
 import React from "react";
 import ValidatorRewards from "./ValidatorRewards";
-import Back from "../Back";
 import Loading from "../Loading";
 
 // TODO OPTIMIZE fetch live
@@ -188,9 +187,6 @@ class Mint extends React.Component<IProps, IState> {
           payout={payout}
           price={this.props.tokenomics ? this.props.tokenomics.price : 0}
         />
-        <div className="position-fixed" style={{ right: "0px", top: "0px" }}>
-          <Back history={this.props.history} />
-        </div>
       </div>
     );
   }

+ 4 - 4
src/components/Proposals/Proposal.tsx

@@ -1,9 +1,10 @@
 import React from "react";
-import htmr from "htmr";
-import { ProposalDetail } from "../../types";
-import { Back, VotesTooltip } from "..";
 import Markdown from "react-markdown";
 import gfm from "remark-gfm";
+import htmr from "htmr";
+
+import { VotesTooltip } from "..";
+import { ProposalDetail } from "../../types";
 import { domain } from "../../config";
 
 const Proposal = (props: {
@@ -18,7 +19,6 @@ const Proposal = (props: {
   const { description, title, message, votes, votesByAccount } = proposal;
   return (
     <div>
-      <Back history={props.history} />
       <div className="d-flex flex-row">
         <div className="box col-6 ml-3">
           <h3>{title}</h3>

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

@@ -1,7 +1,6 @@
 import React from "react";
 import { Link } from "react-router-dom";
 import { IState, ProposalDetail } from "../../types";
-import Back from "../Back";
 
 const amount = (amount: number) => (amount / 1000000).toFixed(2);
 
@@ -37,9 +36,6 @@ const Spending = (props: IState) => {
 
   return (
     <div className="box text-left">
-      <div className="back position-fixed">
-        <Back history={props.history} />
-      </div>
       <h1 className="text-left">
         Total: {amount(sum)}
         {unknown ? `*` : ``} M tJOY

+ 0 - 3
src/components/Storage/index.tsx

@@ -1,7 +1,6 @@
 import React from "react";
 import { Button } from "react-bootstrap";
 import Ranking from "./Ranking";
-import Back from "../Back";
 
 import moment from "moment";
 import Test from "./Test";
@@ -175,8 +174,6 @@ class Storage extends React.Component<IProps, IState> {
             />
           ))}
         </div>
-
-        <Back />
       </div>
     );
   }

+ 7 - 14
src/components/Timeline/index.tsx

@@ -1,6 +1,5 @@
 import React from "react";
 import TimelineItem from "./Item";
-import { Back } from "..";
 
 import { Event, Post, ProposalDetail } from "../../types";
 
@@ -49,19 +48,13 @@ const Timeline = (props: {
   if (!events.length) return <div />;
 
   return (
-    <>
-      <div className="back">
-        <Back history={props.history} />
-      </div>
-
-      <div className="timeline-container">
-        {events
-          .sort((a, b) => b.date - a.date)
-          .map((event: Event, i) => (
-            <TimelineItem event={event} key={i} startTime={status.startTime} />
-          ))}
-      </div>
-    </>
+    <div className="timeline-container">
+      {events
+        .sort((a, b) => b.date - a.date)
+        .map((event: Event, i) => (
+          <TimelineItem event={event} key={i} startTime={status.startTime} />
+        ))}
+    </div>
   );
 };
 

+ 0 - 4
src/components/Tokenomics/index.tsx

@@ -3,7 +3,6 @@ import Burns from "./Burns";
 import Overview from "./Overview";
 import ReportBrowser from "./ReportBrowser";
 import Loading from "../Loading";
-import Back from "../Back";
 
 import { Tokenomics } from "../../types";
 
@@ -20,9 +19,6 @@ const CouncilReports = (props: IProps) => {
 
   return (
     <div className="h-100 py-3 d-flex flex-row justify-content-center pb-5">
-      <div className="back">
-        <Back history={props.history} />
-      </div>
       <div className="d-flex flex-column text-right  align-items-right">
         <div className="box">
           <h3>Tokenomics</h3>

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

@@ -41,7 +41,6 @@ interface IProps {
   stakes?: { [key: string]: Stakes };
   rewardPoints?: RewardPoints;
   tokenomics?: Tokenomics;
-  hideBackButton?: boolean;
   status: Status;
 }
 
@@ -134,7 +133,7 @@ const Validators = (iProps: IProps) => {
 
   const classes = useStyles();
 
-  if (!status || !status.block) return <Loading gridSize={12}/>;
+  if (!status || !status.block) return <Loading gridSize={12} />;
 
   const { lastReward, block, era, startTime } = status;