Skip to content
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

Loading network screen #5893

Merged
merged 5 commits into from
Dec 13, 2018
Merged

Loading network screen #5893

merged 5 commits into from
Dec 13, 2018

Conversation

danjm
Copy link
Contributor

@danjm danjm commented Dec 8, 2018

fixes #3776
fixes #5609

peek 2018-12-07 21-14

Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

A couple of small nitpicky things. Also should we write LoadingNetworkError as a class for consistency sake?

constructor (props) {
super(props)

this.state = {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can move this out of the ctor and onto the class as a property

import Spinner from '../spinner'
import Button from '../button'

class LoadingNetworkScreen extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use PureComponent here?

}
}

LoadingNetworkScreen.propTypes = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we can move this into the class a property?

@metamaskbot
Copy link
Collaborator

Builds ready [9b4d61a]: mascara, chrome, firefox, edge, opera

@@ -0,0 +1,2 @@
const LoadingNetworksScreen = require('./loading-network-screen.container')
module.exports = LoadingNetworksScreen
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you choose to use module.exports over export here?


}

module.exports = LoadingNetworkScreen
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use export default here?

}
}

LoadingNetworkScreen.propTypes = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use static propTypes in the class definition similarly to contextTypes.

import Spinner from '../spinner'
import Button from '../button'

class LoadingNetworkScreen extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we extend PureComponent to reduce rendering assuming the props aren't being mutated?

t: PropTypes.func,
}

componentWillMount = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use componentDidMount here instead, since componentWillMount will be deprecated in the future?

showNetworkDropdown()
}}
>
{ 'Switch Networks' }
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this and "Try Again" below be translated strings?

submitText={t('tryAgain')}
>
<ModalContent
description={'Oops! Something went wrong.'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be translated text?

@@ -40,7 +40,7 @@ export default class TransactionList extends PureComponent {
shouldShowRetry = transaction => {
const { transactionToRetry } = this.props
const { id, submittedTime } = transaction
return id === transactionToRetry.id && Date.now() - submittedTime > 30000
return id === transactionToRetry.id && Date.now() - submittedTime > 3000
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this change be committed? Or was the time reduced to 3 seconds for testing purposes?

const { metamask: { provider: { type, nickname, rpcTarget } } } = state

return nickname || rpcTarget || type

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove newline

@danjm
Copy link
Contributor Author

danjm commented Dec 10, 2018

@alextsg @whymarrh Addressed your comments in latest commit

@metamaskbot
Copy link
Collaborator

Builds ready [caa69be]: mascara, chrome, firefox, edge, opera

@bdresser
Copy link
Contributor

seeing a little funky text display [SWITCHNETWORKS], maybe due to the translations?

screen shot 2018-12-11 at 10 53 14 am

@danjm
Copy link
Contributor Author

danjm commented Dec 12, 2018

@bdresser the translation issue has been fixed

screenshot from 2018-12-12 13-51-47

@danjm
Copy link
Contributor Author

danjm commented Dec 12, 2018

@alextsg the other translation you pointed out "Oops! Something Went Wrong" has also been fixed

Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

One small issue (I think)

@@ -1215,6 +1221,8 @@
},
"speedUpTransaction": {
"message": "Speed up this transaction"
"switchNetworks": {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a formatting error?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think there should be a closing brace on the line above

@metamaskbot
Copy link
Collaborator

Builds ready [04cc98d]: mascara, chrome, firefox, edge, opera

@danjm danjm merged commit c5861c8 into develop Dec 13, 2018
@whymarrh whymarrh deleted the loading-network-screen branch December 13, 2018 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants