From 87b6fdfadbf426500ca6a07bcbf4accb28f4f670 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Mon, 6 Jul 2020 09:29:43 -0700 Subject: [PATCH] build successful. Manually porting Andre's code --- gatsby-node.js | 28 ++--- package.json | 1 - src/components/admin-lte/index.js | 167 +++++++++++++----------------- src/components/menu-components.js | 5 + 4 files changed, 83 insertions(+), 118 deletions(-) create mode 100644 src/components/menu-components.js diff --git a/gatsby-node.js b/gatsby-node.js index f72d342..3a87b65 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -4,6 +4,7 @@ exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => { fs: "empty", }, }) + //Ignore css order if (stage === "build-javascript") { const config = getConfig() @@ -17,25 +18,10 @@ exports.onCreateWebpackConfig = ({ stage, actions, getConfig }) => { } } -exports.sourceNodes = ({ actions, createNodeId, createContentDigest }) => { - const { createNode } = actions - const defaultMenuItems = [ - { - title: "Audit", - icon: "fas-cog", - component: "./audit" - } - ] - - createNode({ - menuItems: defaultMenuItems, - id: `bch-wallet-plugins`, - parent: null, - children: [], - internal: { - type: `BchWalletPlugins`, - contentDigest: createContentDigest({}) - } - }) +exports.createPages = async ({ actions }, themeOptions) => { + const basePath = "/" + actions.createPage({ + path: basePath, + component: require.resolve("./src/pages/index.js"), + }) } - diff --git a/package.json b/package.json index 668c63a..423c454 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "version": "1.0.0", "author": "Chris Troutner ", "dependencies": { - "@loadable/component": "^5.13.0", "adminlte-2-react": "^0.1.27", "gatsby": "^2.22.15", "gatsby-image": "^2.4.5", diff --git a/src/components/admin-lte/index.js b/src/components/admin-lte/index.js index e8938c4..064ff38 100644 --- a/src/components/admin-lte/index.js +++ b/src/components/admin-lte/index.js @@ -3,6 +3,7 @@ import PropTypes from "prop-types" import Configure from "./configure" import Tokens from "./tokens" import Wallet from "./wallet" +// import Audit from "./audit" import AdminLTE, { Sidebar, Navbar } from "adminlte-2-react" import ScannerModal from "../qr-scanner/modal" @@ -12,9 +13,7 @@ import "./admin-lte.css" import BchWallet from "minimal-slp-wallet" import VersionStatus from "../version-status" import { BrowserRouter as Router } from "react-router-dom" - -import { StaticQuery, graphql } from "gatsby" -import loadable from "@loadable/component" +// import menuComponents from "../menu-components.js" import SendReceive from "./send-receive" @@ -24,10 +23,6 @@ const { Item } = Sidebar const MENU_HIDE_WIDTH = 770 let _this -const MenuItemComponent = ({ component }) => { - const RenderedComponent = loadable(() => import("./audit")) - return -} class AdminLTEPage extends React.Component { constructor(props) { @@ -48,101 +43,81 @@ class AdminLTEPage extends React.Component { , , , - + , ] render() { return ( - ( - <> - - - -
-
-

BCH Balance

+ <> + + + +
+
+

BCH Balance

-

{_this.state.bchBalance}

-
-
-
- - {_this.sidebar} - {data.bchWalletPlugins.menuItems.map(item => ( - - ))} -
- - - - -
- {_this.state.section === "Send/Receive" && ( - - )} - {_this.state.section === "Tokens" && ( - - )} - {_this.state.section === "Wallet" && ( - - )} - - {_this.state.section === "Configure" && ( - - )} - {data.bchWalletPlugins.menuItems.map( - item => - _this.state.section === item.title && ( - - ) - )} +

{_this.state.bchBalance}

-
-
- - - - - )} - /> +
+ + + {_this.sidebar} + + + + + + + + +
+ {_this.state.section === "Send/Receive" && ( + + )} + + {_this.state.section === "Tokens" && ( + + )} + + {_this.state.section === "Wallet" && ( + + )} + + {_this.state.section === "Configure" && ( + + )} + + + +
+
+ + + + + ) } // Get wallet balance diff --git a/src/components/menu-components.js b/src/components/menu-components.js new file mode 100644 index 0000000..a97529e --- /dev/null +++ b/src/components/menu-components.js @@ -0,0 +1,5 @@ +const MenuComponents = () => { + +} + +export default MenuComponents;