From 4adc33fde17d05b5e4e565cb454968efbfa74c95 Mon Sep 17 00:00:00 2001 From: Marco Araujo Date: Mon, 24 Oct 2016 16:09:53 -0200 Subject: [PATCH 01/39] Add bulma correctly into app --- app/App.js | 1 + public/index.html | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/App.js b/app/App.js index 3be4078..181e263 100644 --- a/app/App.js +++ b/app/App.js @@ -1,6 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Router, Route, IndexRoute, hashHistory } from 'react-router' +import 'bulma/css/bulma.css' import iClientComponent from 'components/iClient/iClientComponent'; import HomeComponent from 'components/Home/HomeComponent'; diff --git a/public/index.html b/public/index.html index aeec7b8..c2cecbc 100644 --- a/public/index.html +++ b/public/index.html @@ -3,8 +3,6 @@ React Client - -
From 66164bdcb86a7662a4fd82b1e4d9b1e0269bbd8a Mon Sep 17 00:00:00 2001 From: Marco Araujo Date: Tue, 25 Oct 2016 09:48:33 -0200 Subject: [PATCH 02/39] Add font-awesome into app --- app/App.js | 1 + package.json | 5 +++++ webpack.config.js | 9 ++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/App.js b/app/App.js index 181e263..c068f4d 100644 --- a/app/App.js +++ b/app/App.js @@ -2,6 +2,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Router, Route, IndexRoute, hashHistory } from 'react-router' import 'bulma/css/bulma.css' +import 'font-awesome-webpack' import iClientComponent from 'components/iClient/iClientComponent'; import HomeComponent from 'components/Home/HomeComponent'; diff --git a/package.json b/package.json index e5c9beb..d043869 100644 --- a/package.json +++ b/package.json @@ -17,10 +17,15 @@ "babel-preset-es2015": "^6.16.0", "babel-preset-react": "^6.16.0", "css-loader": "^0.25.0", + "file-loader": "^0.9.0", + "font-awesome-webpack": "0.0.4", "http-server": "^0.9.0", + "less": "^2.7.1", + "less-loader": "^2.2.3", "npm-run-all": "^3.1.0", "path": "^0.12.7", "style-loader": "^0.13.1", + "url-loader": "^0.5.7", "webpack": "^1.13.2" }, "scripts": { diff --git a/webpack.config.js b/webpack.config.js index 895cbfd..ac4fbdd 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,11 +3,18 @@ const path = require('path'); module.exports = { entry: "./app/App.js", output: { - filename: "public/dist/bundle.js" + path: 'public/dist/', + publicPath: '/dist/', + filename: "bundle.js", }, module: { loaders: [ + //Bulma loader { test: /\.css$/, loader: "style-loader!css-loader" }, + //Font-awesome loader + { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&minetype=application/font-woff" }, + { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }, + //Jsx loader { test: /\.js$/, exclude: /node_modules/, From 816cfc4e63bc0d77bf47f89a0e5d522b000f919c Mon Sep 17 00:00:00 2001 From: Marco Araujo Date: Tue, 25 Oct 2016 11:20:45 -0200 Subject: [PATCH 03/39] Toggle when mobile view --- app/components/Menu/Menu.js | 40 ++++++++++++++++++++++++++++++++----- public/index.html | 1 + 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/app/components/Menu/Menu.js b/app/components/Menu/Menu.js index 88b7d01..fd1f0e9 100644 --- a/app/components/Menu/Menu.js +++ b/app/components/Menu/Menu.js @@ -6,6 +6,11 @@ class Menu extends React.Component{ super(props, context); this.handleLogout = this.handleLogout.bind(this); this.handleView = this.handleView.bind(this); + this.toggleNav = this.toggleNav.bind(this); + this.handleLink = this.handleLink.bind(this); + this.state = { + toggleNav: '' + }; } handleLogout() { @@ -13,6 +18,18 @@ class Menu extends React.Component{ this.context.router.push("/"); } + toggleNav() { + if (this.state.toggleNav) { + this.setState({toggleNav: ''}); + } else { + this.setState({toggleNav: 'is-active'}); + } + } + + handleLink(e) { + this.setState({toggleNav: ''}); + } + handleView() { return (