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

Improve disconnection modal messages #7612

Merged
merged 3 commits into from
Dec 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,10 @@
"message": "Disconnect All"
},
"disconnectAllModalDescription": {
"message": "Are you sure? You will no longer be able to interact with any of these sites."
"message": "Are you sure? You will be disconnected from all sites on all accounts."
},
"disconnectAccountModalDescription": {
"message": "Are you sure? You will no longer be able to interact with this site."
"message": "Are you sure? Your account (\"$1\") will be disconnected from this site."
},
"disconnectAccountQuestion": {
"message": "Disconnect account?"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default class DisconnectAccount extends PureComponent {
static propTypes = {
hideModal: PropTypes.func.isRequired,
disconnectAccount: PropTypes.func.isRequired,
accountLabel: PropTypes.string.isRequired,
}

static contextTypes = {
Expand All @@ -16,7 +17,7 @@ export default class DisconnectAccount extends PureComponent {

render () {
const { t } = this.context
const { hideModal, disconnectAccount } = this.props
const { hideModal, disconnectAccount, accountLabel } = this.props

return (
<Modal
Expand All @@ -26,7 +27,7 @@ export default class DisconnectAccount extends PureComponent {
>
<div className="disconnect-account-modal">
<div className="disconnect-account-modal__description">
{ t('disconnectAccountModalDescription') }
{ t('disconnectAccountModalDescription', [ accountLabel ]) }
</div>
<Button
type="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { connect } from 'react-redux'
import { compose } from 'recompose'
import withModalProps from '../../../../helpers/higher-order-components/with-modal-props'
import DisconnectAccount from './disconnect-account.component'
import { getCurrentAccountWithSendEtherInfo } from '../../../../selectors/selectors'
import { removePermissionsFor } from '../../../../store/actions'

const mapStateToProps = state => {
return {
...state.appState.modal.modalState.props || {},
accountLabel: getCurrentAccountWithSendEtherInfo(state).name,
}
}

Expand Down