Browse Source

AppBar: remove drawer

Joystream Stats 2 years ago
parent
commit
cf3fb95aeb
4 changed files with 11 additions and 36 deletions
  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> {
   async updateStatus(api: ApiPromise, id: number): Promise<Status> {
     console.debug(`#${id}: Updating status`);
     console.debug(`#${id}: Updating status`);
     this.updateActiveProposals();
     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));
     getTokenomics().then((tokenomics) => this.save(`tokenomics`, tokenomics));
 
 
     let { status, councils } = this.state;
     let { status, councils } = this.state;
@@ -157,7 +157,7 @@ class App extends React.Component<IProps, IState> {
     return era;
     return era;
   }
   }
 
 
-  async updateWorkingGroups(api: ApiPromise) {
+  async updateWorkingGroups(api: ApiPromise): Promise<void> {
     const { members, openings, workers } = this.state;
     const { members, openings, workers } = this.state;
     updateWorkers(api, workers, members).then((workers) => {
     updateWorkers(api, workers, members).then((workers) => {
       this.save("workers", workers);
       this.save("workers", workers);
@@ -165,7 +165,7 @@ class App extends React.Component<IProps, IState> {
         this.save("openings", openings)
         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) {
   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 { 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 joystream from "../../joystream.svg";
-import MenuIcon from "@material-ui/icons/Menu";
-import { routes, useStyles } from "./config";
+import { useStyles } from "./config";
 
 
 const Bar = () => {
 const Bar = () => {
   const classes = useStyles();
   const classes = useStyles();
-  const [menuOpen, setMenuOpen] = useState(false);
+  //const [menuOpen, setMenuOpen] = useState(false);
 
 
   return (
   return (
     <AppBar position="static" className={classes.appBar}>
     <AppBar position="static" className={classes.appBar}>
       <Toolbar>
       <Toolbar>
-        <Button className={classes.menuButton} onClick={() => setMenuOpen(true)}>
-          <MenuIcon />
-        </Button>
         <Button fullWidth className={classes.appLogo} component={Link} to="/">
         <Button fullWidth className={classes.appLogo} component={Link} to="/">
           <img src={joystream} alt="Joystream logo" />
           <img src={joystream} alt="Joystream logo" />
         </Button>
         </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>
       </Toolbar>
     </AppBar>
     </AppBar>
   );
   );

+ 3 - 1
src/lib/groups.ts

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

+ 1 - 0
src/lib/queries.ts

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