Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
make verify-locales pass
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Dec 11, 2019
1 parent c7656ee commit 05e6848
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
6 changes: 0 additions & 6 deletions app/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
"confirmClearPlugins": {
"message": "Are you sure you want to remove all Snaps and their associated permissions?"
},
"clearPluginsSuccess": {
"message": "Snaps cleared successfully."
},
"pluginsSettings": {
"message": "Manage Snaps"
},
Expand Down Expand Up @@ -68,9 +65,6 @@
"confirmClearPermissions": {
"message": "Are you sure you want to remove all dapp/website permissions?"
},
"clearPermissionsSuccess": {
"message": "Permissions cleared successfully."
},
"updatePermissions": {
"message": "Update Permissions"
},
Expand Down
19 changes: 11 additions & 8 deletions ui/app/pages/settings/permissions-tab/permissions-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ export default class PermissionsTab extends Component {
t: PropTypes.func,
}

renderClearButton (messageKey, clickHandler, isDisabled) {
const { t } = this.context
renderClearButton (mainMessage, descriptionMessage, clickHandler, isDisabled) {
return (
<div className="settings-page__content-row">
<div className="settings-page__content-item">
<span>{ t(messageKey) }</span>
<span>{ mainMessage }</span>
<span className="settings-page__content-description">
{ t(`${messageKey}Description`) }
{ descriptionMessage }
</span>
</div>
<div className="settings-page__content-item">
Expand All @@ -46,7 +45,7 @@ export default class PermissionsTab extends Component {
clickHandler()
}}
>
{ t(messageKey) }
{ mainMessage }
</Button>
</div>
</div>
Expand All @@ -55,6 +54,7 @@ export default class PermissionsTab extends Component {
}

render () {
const { t } = this.context
const { warning } = this.props
const hasPermissions = Object.keys(this.props.permissions).length > 0
const hasPermissionsActivity = this.props.permissionsLog.length > 0
Expand All @@ -71,7 +71,8 @@ export default class PermissionsTab extends Component {
/>
{
this.renderClearButton(
'clearPermissions',
t('clearPermissions'),
t('clearPermissionsDescription'),
this.props.showClearPermissionsModal,
!hasPermissions
)
Expand All @@ -81,7 +82,8 @@ export default class PermissionsTab extends Component {
/>
{
this.renderClearButton(
'clearPermissionsHistory',
t('clearPermissionsHistory'),
t('clearPermissionsHistoryDescription'),
this.props.showClearPermissionsHistoryModal,
!hasPermissionsHistory
)
Expand All @@ -91,7 +93,8 @@ export default class PermissionsTab extends Component {
/>
{
this.renderClearButton(
'clearPermissionsActivity',
t('clearPermissionsActivity'),
t('clearPermissionsActivityDescription'),
this.props.showClearPermissionsActivityModal,
!hasPermissionsActivity
)
Expand Down
13 changes: 7 additions & 6 deletions ui/app/pages/settings/plugins-tab/plugins-tab.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ export default class PluginsTab extends Component {
t: PropTypes.func,
}

renderClearButton (messageKey, clickHandler, isDisabled) {
const { t } = this.context
renderClearButton (mainMessage, descriptionMessage, clickHandler, isDisabled) {
return (
<div className="settings-page__content-row">
<div className="settings-page__content-item">
<span>{ t(messageKey) }</span>
<span>{ mainMessage }</span>
<span className="settings-page__content-description">
{ t(`${messageKey}Description`) }
{ descriptionMessage }
</span>
</div>
<div className="settings-page__content-item">
Expand All @@ -38,7 +37,7 @@ export default class PluginsTab extends Component {
clickHandler()
}}
>
{ t(messageKey) }
{ mainMessage }
</Button>
</div>
</div>
Expand All @@ -47,6 +46,7 @@ export default class PluginsTab extends Component {
}

render () {
const { t } = this.context
const { warning } = this.props
const hasPlugins = Object.keys(this.props.plugins).length > 0

Expand All @@ -59,7 +59,8 @@ export default class PluginsTab extends Component {
/>
{
this.renderClearButton(
'clearPlugins',
t('clearPlugins'),
t('clearPluginsDescription'),
this.props.showClearPluginsModal,
!hasPlugins
)
Expand Down

0 comments on commit 05e6848

Please sign in to comment.