-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routes and Layout Containers #38
Conversation
@@ -0,0 +1,23 @@ | |||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra semicolon
@@ -0,0 +1,23 @@ | |||
import React from 'react'; | |||
import { Router, Route, Redirect, IndexRoute, browserHistory } from 'react-router'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra semicolon
</Route> | ||
); | ||
|
||
const AppRouter = () => <Router history={browserHistory} routes={routes} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra semicolon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could just export default
that function if you want
|
||
const AppRouter = () => <Router history={browserHistory} routes={routes} />; | ||
|
||
export default AppRouter; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra semicolon
render() { | ||
return ( | ||
<div> | ||
<h1>Community</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad identation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also why is this not a stateless component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, because im developing it in another branch and I think its not going to be stateless
|
||
LayoutContainer.propTypes = {}; | ||
|
||
const mapStateToProps = state => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could just:
const mapStateToProps = () => ({ data: {} })
}; | ||
}; | ||
|
||
const mapDispatchToProps = (dispatch, ownProps) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
const mapDispatchToProps = dispatch => ({ dispatch })
dispatch | ||
}); | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps, null)(LayoutContainer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra semicolon abd probably the third param as null has no effect
@@ -63,7 +62,7 @@ class ModerationQueue extends React.Component { | |||
console.log('moderation queue', styles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this log?
new webpack.DefinePlugin({ | ||
'process.env': { | ||
'NODE_ENV': JSON.stringify('production'), | ||
'VERSION': JSON.stringify(require("./package.json").version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the effect of stringifying a string? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"production"
produces the value production
JSON.stringify("production")
produces the value "production"
It should be the same as writing '"production"'
It's a common practice while using env vars
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, you use that instead of doing
`"${thevalue}"`
makes more sense not to involve a json parser for that IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can update those I wasn't sure about using es6 in webpack config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
node v6 has it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated! @impronunciable
please solve conflicts |
What does this PR do?
How do I test this PR?
npm run start
andnpm run build
http://localhost:3000
@coralproject/tech