From 16177478dde94584c164f8071bd0d41a8ce68b48 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Tue, 19 Feb 2019 13:33:30 +0200 Subject: [PATCH] Refactoring --- app/package.json | 2 +- .../images}/PageNotFound.jpg | Bin .../images}/ipfs_logo.png | Bin app/src/{resources => assets/images}/logo.png | Bin app/src/components/NotFound.js | 2 +- app/src/containers/HomeContainer.js | 2 +- .../{NavBar.js => NavBarContainer.js} | 21 +++++------------- app/src/routes.js | 4 ++-- contracts/Forum.sol | 2 +- contracts/Migrations.sol | 2 +- migrations/1_initial_migration.js | 2 +- migrations/2_deploy_contracts.js | 2 +- 12 files changed, 15 insertions(+), 24 deletions(-) rename app/src/{resources => assets/images}/PageNotFound.jpg (100%) rename app/src/{resources => assets/images}/ipfs_logo.png (100%) rename app/src/{resources => assets/images}/logo.png (100%) rename app/src/containers/{NavBar.js => NavBarContainer.js} (74%) diff --git a/app/package.json b/app/package.json index 9e5f11d..5edff98 100644 --- a/app/package.json +++ b/app/package.json @@ -20,7 +20,7 @@ "react-router-dom": "^4.3.1", "react-scripts": "^2.1.5", "redux": "^4.0.1", - "redux-saga": "^0.16.0", + "redux-saga": "^0.16.2", "semantic-ui-react": "^0.85.0" }, "scripts": { diff --git a/app/src/resources/PageNotFound.jpg b/app/src/assets/images/PageNotFound.jpg similarity index 100% rename from app/src/resources/PageNotFound.jpg rename to app/src/assets/images/PageNotFound.jpg diff --git a/app/src/resources/ipfs_logo.png b/app/src/assets/images/ipfs_logo.png similarity index 100% rename from app/src/resources/ipfs_logo.png rename to app/src/assets/images/ipfs_logo.png diff --git a/app/src/resources/logo.png b/app/src/assets/images/logo.png similarity index 100% rename from app/src/resources/logo.png rename to app/src/assets/images/logo.png diff --git a/app/src/components/NotFound.js b/app/src/components/NotFound.js index eee996f..f711d44 100644 --- a/app/src/components/NotFound.js +++ b/app/src/components/NotFound.js @@ -1,5 +1,5 @@ import React from 'react'; -import pageNotFound from '../resources/PageNotFound.jpg'; +import pageNotFound from '../assets/images/PageNotFound.jpg'; const NotFound = () => { return ( diff --git a/app/src/containers/HomeContainer.js b/app/src/containers/HomeContainer.js index 8f6f319..f706b18 100644 --- a/app/src/containers/HomeContainer.js +++ b/app/src/containers/HomeContainer.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import {connect} from "react-redux"; +import { connect } from 'react-redux'; class HomeContainer extends Component { render() { diff --git a/app/src/containers/NavBar.js b/app/src/containers/NavBarContainer.js similarity index 74% rename from app/src/containers/NavBar.js rename to app/src/containers/NavBarContainer.js index 23b2d6e..2bb4b1a 100644 --- a/app/src/containers/NavBar.js +++ b/app/src/containers/NavBarContainer.js @@ -1,23 +1,17 @@ import React, { Component } from 'react'; +import {bindActionCreators} from 'redux'; +import {connect} from 'react-redux'; import { push } from 'connected-react-router' import PropTypes from 'prop-types'; - import { Image, Menu } from 'semantic-ui-react' -import logo from '../resources/logo.png'; -import {bindActionCreators} from "redux"; -import {connect} from "react-redux"; +import logo from '../assets/images/logo.png'; -class NavBar extends Component { +class NavBarContainer extends Component { constructor(props){ super(props); - - // this.handleItemClick = this.handleItemClick.bind(this); - - this.navRef = React.createRef(); } - render() { return ( @@ -37,7 +31,7 @@ class NavBar extends Component { } } -NavBar.contextTypes = { +NavBarContainer.contextTypes = { router: PropTypes.object }; @@ -45,13 +39,10 @@ const mapDispatchToProps = dispatch => bindActionCreators({ navigateTo: (location) => push(location) }, dispatch); - const mapStateToProps = state => { return { hasSignedUp: state.user.hasSignedUp, } }; -//export default drizzleConnect(NavBar, mapStateToProps, mapDispatchToProps); - -export default connect(mapStateToProps, mapDispatchToProps)(NavBar); +export default connect(mapStateToProps, mapDispatchToProps)(NavBarContainer); diff --git a/app/src/routes.js b/app/src/routes.js index 79f6628..0f25112 100644 --- a/app/src/routes.js +++ b/app/src/routes.js @@ -1,6 +1,6 @@ import React from 'react' import { Route, Switch } from 'react-router-dom' -import NavBar from "./containers/NavBar"; +import NavBarContainer from "./containers/NavBarContainer"; import HomeContainer from './containers/HomeContainer' import SignUpContainer from './containers/SignUpContainer' import NotFound from './components/NotFound' @@ -8,7 +8,7 @@ import NotFound from './components/NotFound' const routes = (
- + diff --git a/contracts/Forum.sol b/contracts/Forum.sol index 457cf41..2bae986 100644 --- a/contracts/Forum.sol +++ b/contracts/Forum.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.4; +pragma solidity >=0.5.4 <0.6.0; contract Forum { diff --git a/contracts/Migrations.sol b/contracts/Migrations.sol index b03edf0..fc57836 100644 --- a/contracts/Migrations.sol +++ b/contracts/Migrations.sol @@ -1,4 +1,4 @@ -pragma solidity ^0.5.4; +pragma solidity >=0.5.4 <0.6.0; contract Migrations { address public owner; diff --git a/migrations/1_initial_migration.js b/migrations/1_initial_migration.js index 4d5f3f9..36a949b 100644 --- a/migrations/1_initial_migration.js +++ b/migrations/1_initial_migration.js @@ -1,4 +1,4 @@ -var Migrations = artifacts.require("./Migrations.sol"); +const Migrations = artifacts.require("./Migrations.sol"); module.exports = function(deployer) { deployer.deploy(Migrations); diff --git a/migrations/2_deploy_contracts.js b/migrations/2_deploy_contracts.js index feafc71..adb1955 100644 --- a/migrations/2_deploy_contracts.js +++ b/migrations/2_deploy_contracts.js @@ -1,4 +1,4 @@ -var Forum = artifacts.require("Forum"); +const Forum = artifacts.require("Forum"); module.exports = function(deployer) { deployer.deploy(Forum);