{"size": 1501, "ext": "js", "max_stars_repo_path": "js/packages/web/src/atlas-components/Layout.js", "max_stars_repo_name": "NayviMorales75/Atlas-frontend-metaplex", "max_stars_repo_stars_event_min_datetime": "2021-11-11T02:46:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-11T02:46:24.000Z", "max_issues_repo_path": "js/packages/web/src/atlas-components/Layout.js", "max_issues_repo_name": "devexpert127/nft-marketplace-ui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/packages/web/src/atlas-components/Layout.js", "max_forks_repo_name": "devexpert127/nft-marketplace-ui", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.4029850746, "max_line_length": 75, "alphanum_fraction": 0.5749500333}
import { Backdrop, CircularProgress, makeStyles } from "@material-ui/core";
import { useWeb3React } from "@web3-react/core";
import React, { useEffect } from "react";
import { useSelector } from "react-redux";
import { useDispatch } from "react-redux";
import { initializeWeb3 } from "../contract/functions/functions";
import { setSolanaInstance } from "../redux";

import Header from "./Header";

const DRAWER_WIDTH = 250;

const useStyles = makeStyles((theme) => {
  return {
    page: {
      padding: "5rem 8rem",

      [theme.breakpoints.down("1500")]: {
        padding: "4rem 6rem",
      },

      [theme.breakpoints.down("1100")]: {
        padding: "4rem",
      },
    },
    root: {
      // display: "flex",background: "#000",
      background: "#000",
      height: "100vh",
    },

    toolbar: theme.mixins.toolbar,

    backdrop: {
      zIndex: theme.zIndex.drawer + 1,
      color: "#fff",
    },
  };
});

const Layout = ({ children }) => {
  const classes = useStyles();

  useEffect(() => {}, [window["solana"]]);
  const dispatch = useDispatch();

  // window.onload = () => {
  //   dispatch(setSolanaInstance(window["solana"]));
  // };

  return (
    <div className={classes.root}>
      <Backdrop open={false} className={classes.backdrop}>
        <CircularProgress color="inherit" />
      </Backdrop>
      {children && (
        <div className={classes.page}>
          <Header />
          {children}
        </div>
      )}
    </div>
  );
};

export default Layout;
