Skip to content

Commit

Permalink
Improve disconnection modal messages (#7612)
Browse files Browse the repository at this point in the history
* Improve disconnectAccountModalDescription and disconnectAllModalDescription messages

* Update disconnectAccountModalDescription app/_locales/en/messages.json

Co-Authored-By: Mark Stacey <markjstacey@gmail.com>

* Improve disconnectAccount modal message clarity
  • Loading branch information
danjm authored and danfinlay committed Dec 2, 2019
1 parent 323bd9b commit be288f4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
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

0 comments on commit be288f4

Please sign in to comment.