Ver código fonte

AppBar: remove drawer

Joystream Stats 2 anos atrás
pai
commit
cf3fb95aeb
4 arquivos alterados com 11 adições e 36 exclusões
  1. 3 3
      src/App.tsx
  2. 4 32
      src/components/AppBar/index.tsx
  3. 3 1
      src/lib/groups.ts
  4. 1 0
      src/lib/queries.ts

+ 3 - 3
src/App.tsx

@@ -55,7 +55,7 @@ class App extends React.Component<IProps, IState> {
   async updateStatus(api: ApiPromise, id: number): Promise<Status> {
     console.debug(`#${id}: Updating status`);
     this.updateActiveProposals();
-    getMints(api).then((mints) => this.save(`mints`, mints));
+    //getMints(api).then((mints) => this.save(`mints`, mints));
     getTokenomics().then((tokenomics) => this.save(`tokenomics`, tokenomics));
 
     let { status, councils } = this.state;
@@ -157,7 +157,7 @@ class App extends React.Component<IProps, IState> {
     return era;
   }
 
-  async updateWorkingGroups(api: ApiPromise) {
+  async updateWorkingGroups(api: ApiPromise): Promise<void> {
     const { members, openings, workers } = this.state;
     updateWorkers(api, workers, members).then((workers) => {
       this.save("workers", workers);
@@ -165,7 +165,7 @@ class App extends React.Component<IProps, IState> {
         this.save("openings", openings)
       );
     });
-    return this.save("council", await api.query.council.activeCouncil());
+    //return this.save("council", await api.query.council.activeCouncil());
   }
 
   updateValidators(api: ApiPromise) {

+ 4 - 32
src/components/AppBar/index.tsx

@@ -1,47 +1,19 @@
-import { useState } from "react";
+//import { useState } from "react";
 import { Link } from "react-router-dom";
-import { AppBar, Button, SwipeableDrawer, Toolbar } from "@material-ui/core";
-import SelectLanguage from "./SelectLanguage";
+import { AppBar, Button, Toolbar } from "@material-ui/core";
 import joystream from "../../joystream.svg";
-import MenuIcon from "@material-ui/icons/Menu";
-import { routes, useStyles } from "./config";
+import { useStyles } from "./config";
 
 const Bar = () => {
   const classes = useStyles();
-  const [menuOpen, setMenuOpen] = useState(false);
+  //const [menuOpen, setMenuOpen] = useState(false);
 
   return (
     <AppBar position="static" className={classes.appBar}>
       <Toolbar>
-        <Button className={classes.menuButton} onClick={() => setMenuOpen(true)}>
-          <MenuIcon />
-        </Button>
         <Button fullWidth className={classes.appLogo} component={Link} to="/">
           <img src={joystream} alt="Joystream logo" />
         </Button>
-        <SwipeableDrawer
-          anchor={"left"}
-          open={menuOpen}
-          onOpen={() => setMenuOpen(true)}
-          onClose={() => setMenuOpen(false)}
-          className={classes.drawer}
-        >
-          <Button className={classes.appLogo} component={Link} to="/">
-            <img src={joystream} alt="Joystream logo" />
-          </Button>
-          {Object.keys(routes).map((route) => (
-            <Button
-              key={route}
-              className={classes.root}
-              component={Link}
-              onClick={() => setMenuOpen(false)}
-              to={"/" + route}
-            >
-              {routes[route]}
-            </Button>
-          ))}
-          <SelectLanguage />
-        </SwipeableDrawer>
       </Toolbar>
     </AppBar>
   );

+ 3 - 1
src/lib/groups.ts

@@ -1,6 +1,5 @@
 import moment from "moment";
 import { Openings } from "./types";
-import { Mint } from "@joystream/types/mint";
 
 // mapping: key = pioneer route, value: chain section
 export const groups = {
@@ -13,6 +12,7 @@ export const groups = {
 };
 
 export const getMints = async (api: Api): Promise<Mint[]> => {
+  return;
   console.debug(`Fetching mints`);
   const getMint = (id: number) => api.query.minting.mints(id);
   const promises = Object.values(groups).map((group) =>
@@ -74,6 +74,7 @@ const getGroupWorkers = async (
     let stake: Stake;
     let reward: RewardRelationship;
 
+    /**
     if (worker.role_stake_profile.isSome) {
       const roleStakeProfile = worker.role_stake_profile.unwrap();
       const stakeId = roleStakeProfile.stake_id;
@@ -89,6 +90,7 @@ const getGroupWorkers = async (
         await api.query.recurringRewards.rewardRelationships(rewardId)
       ).toJSON();
     }
+    **/
     workers.push({
       id,
       memberId,

+ 1 - 0
src/lib/queries.ts

@@ -68,6 +68,7 @@ const getGithubDir = async (url: string) => {
 };
 
 export const bootstrap = (save: (key: string, data: any) => {}) => {
+  return;
   [
     { tokenomics: () => getTokenomics() },
     //{ faq: () => getFAQ() },