-
Notifications
You must be signed in to change notification settings - Fork 364
Conversation
Deployed to: http://staging.quran.com:32771 |
Deployed to: http://staging.quran.com:32772 |
import debug from '../../helpers/debug'; | ||
const styles = require('./style.scss'); | ||
|
||
function LastVisit(props) { |
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.
why not es6 ;)
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.
const LastVisit = ({ lastVisit, surahs }) => {...}
Woot! This is awesome :) |
Deployed to: http://staging.quran.com:32802 |
Deployed to: http://staging.quran.com:32811 |
Deployed to: http://staging.quran.com:32812 |
Deployed to: http://staging.quran.com:32813 |
Deployed to: http://staging.quran.com:32814 |
e05b15f
to
ae9cb74
Compare
Deployed to: http://staging.quran.com:32815 |
|
||
function mapDispatchToProps(dispatch) { | ||
return { | ||
push: bindActionCreators(push, dispatch) |
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.
bindActionCreators
is actually not needed and is implicit when you return an object with the actions. So { push }
does the same as push: bindActionCreators(push, dispatch)
no?
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.
From react-redux docs:
[mapDispatchToProps(dispatch, [ownProps]): dispatchProps](Object or Function): If an object is passed, each function inside it will be assumed to be a Redux action creator. An object with the same function names, but with every action creator wrapped into a dispatch call so they may be invoked directly, will be merged into the component’s props. If a function is passed, it will be given dispatch. It’s up to you to return an object that somehow uses dispatch to bind action creators in your own way. (Tip: you may use the bindActionCreators() helper from Redux.) If you omit it, the default implementation just injects dispatch into your component’s props. If ownProps is specified as a second argument, its value will be the props passed to your component, and mapDispatchToProps will be re-invoked whenever the component receives new props.
|
||
it("Should render QuickSurahs component", () => { | ||
let component = shallow(<TopOptions | ||
options={{ |
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.
weird alignment?
@sabeurthabti this is awesome mashallah! Just few comments :) |
@mmahalwy all fixed. |
Deployed to: http://staging.quran.com:32817 |
Deployed to: http://staging.quran.com:32818 |
@sabeurthabti sweet! Let's merge it :) You have merge capabilities right? |
@mmahalwy Yeah I do. Merging |
Part of the work to slim down our components and make them state-less whenever possible.