Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

move verification store into modal #3951

Merged
merged 2 commits into from Dec 23, 2016
Merged

Conversation

derhuerst
Copy link
Contributor

Fixes #3917. Moves the MobX store into the modal component.

@derhuerst derhuerst added A0-pleasereview 🤓 Pull request needs code review. M7-ui labels Dec 22, 2016
onSelectMethod: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired
onClose: PropTypes.func.isRequired,
isTestnet: PropTypes.bool.isRequired
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer consistency. It comes in as isTest, so keep it as isTest (We are doing things in 2 different ways now, some has the one others have the other)

In addition, consider keeping alphabetical order here. (i before o)

@@ -69,11 +75,12 @@ export default class Verification extends Component {
}

state = {
method: 'sms'
method: 'sms',
store: null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the store in the state and not on the class itself?

When passed as either a prop or when created on the class it is consistent with what we have elsewhere. Feels really weird having a state in a state. (When done properly, the state should not be on the class using mobx stores at all)

} else if (name === 'email') {
store = new EmailVerificationStore(api, account, isTestnet);
}
this.setState({ store });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blank line after the block and before the set would greatly aid readability.

selectMethod = (choice, i) => {
this.setState({ method: choice.value });
}
}

const mapStateToProps = (state) => ({
isTestnet: state.nodeStatus.isTest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per above. Have no strong feelings either way, but do have strong feelings about keeping consistency everywhere.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 85.539% when pulling d075f7b on jr-move-verification-store into be75cbf on master.

@jacogr jacogr added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 23, 2016
@jacogr jacogr merged commit db6964a into master Dec 23, 2016
@jacogr jacogr deleted the jr-move-verification-store branch December 23, 2016 14:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants