Browse Source

Refactoring

develop
Ezerous 6 years ago
parent
commit
16177478dd
  1. 2
      app/package.json
  2. 0
      app/src/assets/images/PageNotFound.jpg
  3. 0
      app/src/assets/images/ipfs_logo.png
  4. 0
      app/src/assets/images/logo.png
  5. 2
      app/src/components/NotFound.js
  6. 2
      app/src/containers/HomeContainer.js
  7. 21
      app/src/containers/NavBarContainer.js
  8. 4
      app/src/routes.js
  9. 2
      contracts/Forum.sol
  10. 2
      contracts/Migrations.sol
  11. 2
      migrations/1_initial_migration.js
  12. 2
      migrations/2_deploy_contracts.js

2
app/package.json

@ -20,7 +20,7 @@
"react-router-dom": "^4.3.1", "react-router-dom": "^4.3.1",
"react-scripts": "^2.1.5", "react-scripts": "^2.1.5",
"redux": "^4.0.1", "redux": "^4.0.1",
"redux-saga": "^0.16.0", "redux-saga": "^0.16.2",
"semantic-ui-react": "^0.85.0" "semantic-ui-react": "^0.85.0"
}, },
"scripts": { "scripts": {

0
app/src/resources/PageNotFound.jpg → app/src/assets/images/PageNotFound.jpg

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

0
app/src/resources/ipfs_logo.png → app/src/assets/images/ipfs_logo.png

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

0
app/src/resources/logo.png → app/src/assets/images/logo.png

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 216 KiB

2
app/src/components/NotFound.js

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import pageNotFound from '../resources/PageNotFound.jpg'; import pageNotFound from '../assets/images/PageNotFound.jpg';
const NotFound = () => { const NotFound = () => {
return ( return (

2
app/src/containers/HomeContainer.js

@ -1,5 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {connect} from "react-redux"; import { connect } from 'react-redux';
class HomeContainer extends Component { class HomeContainer extends Component {
render() { render() {

21
app/src/containers/NavBar.js → app/src/containers/NavBarContainer.js

@ -1,23 +1,17 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import { push } from 'connected-react-router' import { push } from 'connected-react-router'
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Image, Menu } from 'semantic-ui-react' import { Image, Menu } from 'semantic-ui-react'
import logo from '../resources/logo.png'; import logo from '../assets/images/logo.png';
import {bindActionCreators} from "redux";
import {connect} from "react-redux";
class NavBar extends Component { class NavBarContainer extends Component {
constructor(props){ constructor(props){
super(props); super(props);
// this.handleItemClick = this.handleItemClick.bind(this);
this.navRef = React.createRef();
} }
render() { render() {
return ( return (
<Menu fixed='top' inverted> <Menu fixed='top' inverted>
@ -37,7 +31,7 @@ class NavBar extends Component {
} }
} }
NavBar.contextTypes = { NavBarContainer.contextTypes = {
router: PropTypes.object router: PropTypes.object
}; };
@ -45,13 +39,10 @@ const mapDispatchToProps = dispatch => bindActionCreators({
navigateTo: (location) => push(location) navigateTo: (location) => push(location)
}, dispatch); }, dispatch);
const mapStateToProps = state => { const mapStateToProps = state => {
return { return {
hasSignedUp: state.user.hasSignedUp, hasSignedUp: state.user.hasSignedUp,
} }
}; };
//export default drizzleConnect(NavBar, mapStateToProps, mapDispatchToProps); export default connect(mapStateToProps, mapDispatchToProps)(NavBarContainer);
export default connect(mapStateToProps, mapDispatchToProps)(NavBar);

4
app/src/routes.js

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import { Route, Switch } from 'react-router-dom' import { Route, Switch } from 'react-router-dom'
import NavBar from "./containers/NavBar"; import NavBarContainer from "./containers/NavBarContainer";
import HomeContainer from './containers/HomeContainer' import HomeContainer from './containers/HomeContainer'
import SignUpContainer from './containers/SignUpContainer' import SignUpContainer from './containers/SignUpContainer'
import NotFound from './components/NotFound' import NotFound from './components/NotFound'
@ -8,7 +8,7 @@ import NotFound from './components/NotFound'
const routes = ( const routes = (
<div> <div>
<NavBar /> <NavBarContainer />
<Switch> <Switch>
<Route exact path="/" component={HomeContainer} /> <Route exact path="/" component={HomeContainer} />
<Route path="/signup" component={SignUpContainer} /> <Route path="/signup" component={SignUpContainer} />

2
contracts/Forum.sol

@ -1,4 +1,4 @@
pragma solidity ^0.5.4; pragma solidity >=0.5.4 <0.6.0;
contract Forum { contract Forum {

2
contracts/Migrations.sol

@ -1,4 +1,4 @@
pragma solidity ^0.5.4; pragma solidity >=0.5.4 <0.6.0;
contract Migrations { contract Migrations {
address public owner; address public owner;

2
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) { module.exports = function(deployer) {
deployer.deploy(Migrations); deployer.deploy(Migrations);

2
migrations/2_deploy_contracts.js

@ -1,4 +1,4 @@
var Forum = artifacts.require("Forum"); const Forum = artifacts.require("Forum");
module.exports = function(deployer) { module.exports = function(deployer) {
deployer.deploy(Forum); deployer.deploy(Forum);

Loading…
Cancel
Save