From 5039d8b4149148c3de57e1f1f3ec3b0dc403fea5 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Tue, 7 Aug 2018 09:06:11 +0100 Subject: [PATCH] Adding home container --- embark-ui/src/components/Console.js | 27 ++++++++++ embark-ui/src/components/Home.js | 7 --- embark-ui/src/components/Status.js | 61 +++++++++++++++++++++++ embark-ui/src/containers/HomeContainer.js | 23 +++++++++ embark-ui/src/routes.js | 4 +- lib/modules/webserver/server.js | 1 - 6 files changed, 113 insertions(+), 10 deletions(-) create mode 100644 embark-ui/src/components/Console.js delete mode 100644 embark-ui/src/components/Home.js create mode 100644 embark-ui/src/components/Status.js create mode 100644 embark-ui/src/containers/HomeContainer.js diff --git a/embark-ui/src/components/Console.js b/embark-ui/src/components/Console.js new file mode 100644 index 000000000..12460ac0d --- /dev/null +++ b/embark-ui/src/components/Console.js @@ -0,0 +1,27 @@ +import React from 'react'; +import {Grid, Card} from 'tabler-react'; + +const Console = () => ( + + + + + Console + + +
+

Welcome!

+
+
+
+ +
+
+
+
+
+
+); + +export default Console; diff --git a/embark-ui/src/components/Home.js b/embark-ui/src/components/Home.js deleted file mode 100644 index 84c19966c..000000000 --- a/embark-ui/src/components/Home.js +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; - -const Home = () => ( -

Home

-); - -export default Home; diff --git a/embark-ui/src/components/Status.js b/embark-ui/src/components/Status.js new file mode 100644 index 000000000..144879ba8 --- /dev/null +++ b/embark-ui/src/components/Status.js @@ -0,0 +1,61 @@ +import React from 'react'; +import {Grid, Card} from 'tabler-react'; + +const Status = () => ( + + + +
+ + + +
+

IPFS

+ version 2.5 +
+
+
+
+ + +
+ + + +
+

Ethereum

+ Geth 1.6.7-stable +
+
+
+
+ + +
+ + + +
+

Whisper

+ V5 +
+
+
+
+ + +
+ + + +
+

Webserver

+ http://localhost:8000 +
+
+
+
+
+); + +export default Status; diff --git a/embark-ui/src/containers/HomeContainer.js b/embark-ui/src/containers/HomeContainer.js new file mode 100644 index 000000000..9b8e88911 --- /dev/null +++ b/embark-ui/src/containers/HomeContainer.js @@ -0,0 +1,23 @@ +import React, {Component} from 'react'; +import {connect} from 'react-redux'; +import {Page} from "tabler-react"; + +import Status from '../components/Status'; +import Console from '../components/Console'; + +class HomeContainer extends Component { + render() { + return ( + + Dashboard + + + + ); + } +} + +export default connect( + null, + null, +)(HomeContainer); diff --git a/embark-ui/src/routes.js b/embark-ui/src/routes.js index c7cee5aad..62a0dd60a 100644 --- a/embark-ui/src/routes.js +++ b/embark-ui/src/routes.js @@ -1,7 +1,7 @@ import React from 'react'; import {Route, Switch} from 'react-router-dom'; -import Home from './components/Home'; +import HomeContainer from './containers/HomeContainer'; import NoMatch from './components/NoMatch'; import ExplorerLayout from './components/ExplorerLayout'; import ProcessesLayout from './components/ProcessesLayout'; @@ -9,7 +9,7 @@ import ProcessesLayout from './components/ProcessesLayout'; const routes = ( - + diff --git a/lib/modules/webserver/server.js b/lib/modules/webserver/server.js index 98e32c4db..07f1a919c 100644 --- a/lib/modules/webserver/server.js +++ b/lib/modules/webserver/server.js @@ -71,7 +71,6 @@ class Server { this.app.use(express.static(path.join(fs.dappPath(this.dist)), {'index': ['index.html', 'index.htm']})); this.app.use('/embark', express.static(path.join(__dirname, '../../../embark-ui/build'))); - this.app.use(cors()); app.use(bodyParser.json()); // support json encoded bodies app.use(bodyParser.urlencoded({extended: true})); // support encoded bodies