-
Notifications
You must be signed in to change notification settings - Fork 215
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
(Feature) UI Improvements in Invest page #341
Conversation
Use the signature for the `buy()` function in the base Crowdsade contract
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.
A few comments, but looks good to me otherwise.
src/components/invest/index.js
Outdated
window.scrollTo(0, 0); | ||
if (this.tokensToInvestOnChange.bind) this.tokensToInvestOnChange = this.tokensToInvestOnChange.bind(this); | ||
if (this.investToTokens.bind) this.investToTokens = this.investToTokens.bind(this); | ||
var state = defaultState; | ||
state.seconds = 0; | ||
state.loading = true; | ||
state.pristineTokenInput = true; | ||
state.investThrough = 'metamask' | ||
state.web3Available = false; | ||
state.crowdsaleAddress = ICOConfig.crowdsaleContractURL || getURLParam("addr") |
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.
Extract lines 21-26 to an object in a constant or util file and use Object.assign to add it to the default state on line 20
src/components/invest/index.js
Outdated
return | ||
}; | ||
|
||
const networkID = ICOConfig.networkID?ICOConfig.networkID:getQueryVariable("networkID"); | ||
const contractType = this.state.contractTypes.whitelistwithcap;// getQueryVariable("contractType"); | ||
checkNetWorkByID(web3, networkID); | ||
newState.contractType = contractType; | ||
newState.web3Available = true; | ||
newState.investThrough = 'metamask'; |
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.
extract string to constant
src/components/invest/index.js
Outdated
<a className="button button_fill" onClick={this.investToTokens}>Invest now</a> | ||
<div className="invest-through-container"> | ||
<select value={this.state.investThrough} className="invest-through" onChange={(e) => this.setState({ investThrough: e.target.value })}> | ||
<option disabled={!this.state.web3Available} value="metamask">Metamask {!this.state.web3Available ? ' (not available)' : null}</option> |
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.
extract ternary to variable
Let's try to merge this as soon as possible, so that we can work on solving the MobX PR conflicts. I will create issues for all the non-critical stuff that is pending. |
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.
- "Contribute" should be instead "Invest" for the button
- Wrong method signature "Send ethers to the crowdsale address with a MethodID: 0xf2fde38b"
|
Fixed, thanks. Just curious, to what method corresponds that hash? |
|
Depends on #199.
This PR builds upon #199 and adds some improvements:
0xa6f2ae3a
, that corresponds tobuy()