on master help sign in
- show gas price in eth, not gwei

- add gas price show/toggle functions to each view

commited9c990d87f66192b71c94db6bcec32c155af206 authorChris Johnson <chris@cjohnson.io> dateMon 11 Mar 2019, 14:19 (8 years ago) parenta3a6828
7 files changed+59−1
src/components/StatelessTransaction.js+1−1 src/views/AcceptTransfer.js+10 src/views/CancelTransfer.js+10 src/views/CreateGalaxy.js+10 src/views/IssueChild.js+10 src/views/SetKeys.js+9 src/views/Transfer.js+9
src/components/StatelessTransaction.js+1−1
@@ -65,7 +65,7 @@ const StatelessTransaction = props => {
6565
6666 const gasPriceRangeDialogue = (
6767 <React.Fragment>
68− <div className="mt-8">Gas Price: <span className="ml-4 text-700 text-sm">{gasPrice} gwei</span></div>
68+ <div className="mt-8">Gas Price: <span className="ml-4 text-700 text-sm">{(gasPrice / 1000000000).toFixed('9')} eth</span></div>
6969
7070 <input
7171 className="mt-4"
src/views/AcceptTransfer.js+10
@@ -38,6 +38,7 @@ class AcceptTransfer extends React.Component {
3838 userApproval: false,
3939 nonce: '',
4040 gasPrice: '5',
41+ showGasDetails: false,
4142 chainId: '',
4243 gasLimit: '600000',
4344 stx: Nothing(),
@@ -53,6 +54,13 @@ class AcceptTransfer extends React.Component {
5354 this.handleSetChainId = this.handleSetChainId.bind(this)
5455 this.handleSetGasPrice = this.handleSetGasPrice.bind(this)
5556 this.handleSetGasLimit = this.handleSetGasLimit.bind(this)
57+ this.toggleGasDetails = this.toggleGasDetails.bind(this)
58+ }
59+
60+ toggleGasDetails() {
61+ this.setState({
62+ showGasDetails: !this.state.showGasDetails
63+ })
5664 }
5765
5866 componentDidMount() {
@@ -260,6 +268,8 @@ class AcceptTransfer extends React.Component {
260268 gasPrice={state.gasPrice}
261269 chainId={state.chainId}
262270 gasLimit={state.gasLimit}
271+ showGasDetails={state.showGasDetails}
272+ toggleGasDetails={state.toggleGasDetails}
263273 // Checks
264274 userApproval={state.userApproval}
265275 canGenerate={ canGenerate }
src/views/CancelTransfer.js+10
@@ -38,6 +38,7 @@ class CancelTransfer extends React.Component {
3838 userApproval: false,
3939 nonce: '',
4040 gasPrice: '5',
41+ showGasDetails: false,
4142 chainId: '',
4243 gasLimit: '600000',
4344 stx: Maybe.Nothing(),
@@ -52,6 +53,13 @@ class CancelTransfer extends React.Component {
5253 this.handleSetChainId = this.handleSetChainId.bind(this)
5354 this.handleSetGasPrice = this.handleSetGasPrice.bind(this)
5455 this.handleSetGasLimit = this.handleSetGasLimit.bind(this)
56+ this.toggleGasDetails = this.toggleGasDetails.bind(this)
57+ }
58+
59+ toggleGasDetails() {
60+ this.setState({
61+ showGasDetails: !this.state.showGasDetails
62+ })
5563 }
5664
5765 componentDidMount() {
@@ -242,6 +250,8 @@ class CancelTransfer extends React.Component {
242250 gasPrice={state.gasPrice}
243251 chainId={state.chainId}
244252 gasLimit={state.gasLimit}
253+ showGasDetails={state.showGasDetails}
254+ toggleGasDetails={state.toggleGasDetails}
245255 // Checks
246256 userApproval={state.userApproval}
247257 canGenerate={ canGenerate }
src/views/CreateGalaxy.js+10
@@ -64,6 +64,7 @@ class CreateGalaxy extends React.Component {
6464 txApproval: false,
6565 nonce: '',
6666 gasPrice: '5',
67+ showGasDetails: false,
6768 chainId: '',
6869 txInfo: '',
6970 gasLimit: '600000',
@@ -75,6 +76,13 @@ class CreateGalaxy extends React.Component {
7576 this.handleGalaxyNameInput = this.handleGalaxyNameInput.bind(this)
7677 this.confirmAvailability = this.confirmAvailability.bind(this)
7778 this.handleSubmit = this.handleSubmit.bind(this)
79+ this.toggleGasDetails = this.toggleGasDetails.bind(this)
80+ }
81+
82+ toggleGasDetails() {
83+ this.setState({
84+ showGasDetails: !this.state.showGasDetails
85+ })
7886 }
7987
8088 componentDidMount() {
@@ -266,6 +274,8 @@ class CreateGalaxy extends React.Component {
266274 stx={state.stx}
267275 nonce={state.nonce}
268276 gasPrice={state.gasPrice}
277+ showGasDetails={state.showGasDetails}
278+ toggleGasDetails={state.toggleGasDetails}
269279 chainId={state.chainId}
270280 gasLimit={state.gasLimit}
271281 canGenerate={
src/views/IssueChild.js+10
@@ -51,6 +51,7 @@ class IssueChild extends React.Component {
5151 userApproval: false,
5252 nonce: '',
5353 gasPrice: '5',
54+ showGasDetails: false,
5455 chainId: '',
5556 gasLimit: '600000',
5657 txn: Nothing(),
@@ -70,6 +71,13 @@ class IssueChild extends React.Component {
7071 this.handleSetChainId = this.handleSetChainId.bind(this)
7172 this.handleSetGasPrice = this.handleSetGasPrice.bind(this)
7273 this.handleSetGasLimit = this.handleSetGasLimit.bind(this)
74+ this.toggleGasDetails = this.toggleGasDetails.bind(this)
75+ }
76+
77+ toggleGasDetails() {
78+ this.setState({
79+ showGasDetails: !this.state.showGasDetails
80+ })
7381 }
7482
7583 componentDidMount() {
@@ -478,6 +486,8 @@ class IssueChild extends React.Component {
478486 // Tx details
479487 nonce={state.nonce}
480488 gasPrice={state.gasPrice}
489+ showGasDetails={state.showGasDetails}
490+ toggleGasDetails={state.toggleGasDetails}
481491 chainId={state.chainId}
482492 gasLimit={state.gasLimit}
483493 // Checks
src/views/SetKeys.js+9
@@ -45,6 +45,7 @@ class SetKeys extends React.Component {
4545 userApproval: false,
4646 nonce: '',
4747 gasPrice: '5',
48+ showGasDetails: false,
4849 chainId: '',
4950 gasLimit: '600000',
5051 stx: Maybe.Nothing(),
@@ -61,8 +62,14 @@ class SetKeys extends React.Component {
6162 this.handleSetChainId = this.handleSetChainId.bind(this)
6263 this.handleSetGasPrice = this.handleSetGasPrice.bind(this)
6364 this.handleSetGasLimit = this.handleSetGasLimit.bind(this)
65+ this.toggleGasDetails = this.toggleGasDetails.bind(this)
6466 }
6567
68+ toggleGasDetails() {
69+ this.setState({
70+ showGasDetails: !this.state.showGasDetails
71+ })
72+ }
6673
6774 componentDidMount() {
6875 const { props } = this
@@ -338,6 +345,8 @@ class SetKeys extends React.Component {
338345 gasPrice={state.gasPrice}
339346 chainId={state.chainId}
340347 gasLimit={state.gasLimit}
348+ showGasDetails={state.showGasDetails}
349+ toggleGasDetails={state.toggleGasDetails}
341350 // Checks
342351 userApproval={state.userApproval}
343352 canGenerate={ canGenerate }
src/views/Transfer.js+9
@@ -39,6 +39,7 @@ class Transfer extends React.Component {
3939 userApproval: false,
4040 nonce: '',
4141 gasPrice: '5',
42+ showGasDetails: false,
4243 chainId: '',
4344 gasLimit: '600000',
4445 txn: Maybe.Nothing(),
@@ -55,8 +56,14 @@ class Transfer extends React.Component {
5556 this.handleSetChainId = this.handleSetChainId.bind(this)
5657 this.handleSetGasPrice = this.handleSetGasPrice.bind(this)
5758 this.handleSetGasLimit = this.handleSetGasLimit.bind(this)
59+ this.toggleGasDetails = this.toggleGasDetails.bind(this)
5860 }
5961
62+ toggleGasDetails() {
63+ this.setState({
64+ showGasDetails: !this.state.showGasDetails
65+ })
66+ }
6067
6168 componentDidMount() {
6269 const { props } = this
@@ -311,6 +318,8 @@ class Transfer extends React.Component {
311318 gasPrice={state.gasPrice}
312319 chainId={state.chainId}
313320 gasLimit={state.gasLimit}
321+ showGasDetails={state.showGasDetails}
322+ toggleGasDetails={state.toggleGasDetails}
314323 // Checks
315324 userApproval={state.userApproval}
316325 canGenerate={ canGenerate }