Skip to content

Commit

Permalink
Fixes formatting for YT on shields page
Browse files Browse the repository at this point in the history
Resolves brave#12271

Auditors:

Test Plan:
  • Loading branch information
NejcZdovc committed Dec 15, 2017
1 parent f23effc commit 9ad2f80
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
8 changes: 7 additions & 1 deletion app/renderer/components/common/sitePermissionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ class SitePermissionsList extends ImmutableComponent {
<ul className={css(styles.sitePermissions__list)}>
{
this.props.siteSettings.map((value, hostPattern) => {
let siteName = `${hostPattern} :`

if (value.has('siteName')) {
siteName = `${value.get('siteName')} :`
}

if (!value.size) {
return null
}
Expand Down Expand Up @@ -126,7 +132,7 @@ class SitePermissionsList extends ImmutableComponent {
custom={styles.sitePermissions__list__item__button}
onClick={this.deletePermission.bind(this, name, hostPattern)}
/>
<span>{hostPattern + ':'}</span>
<span>{siteName}</span>
<span
className={css(styles.sitePermissions__list__item__status)}
data-l10n-id={statusText}
Expand Down
5 changes: 3 additions & 2 deletions app/renderer/components/preferences/payment/ledgerTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ class LedgerTable extends ImmutableComponent {
return synopsis.get('pinPercentage')
}

banSite (hostPattern) {
banSite (hostPattern, siteName) {
aboutActions.changeSiteSetting(hostPattern, 'ledgerPaymentsShown', false)
aboutActions.changeSiteSetting(hostPattern, 'siteName', siteName)
}

togglePinSite (hostPattern, pinned, percentage) {
Expand Down Expand Up @@ -238,7 +239,7 @@ class LedgerTable extends ImmutableComponent {
styles.actionIcons__icon,
styles.actionIcons__icon_remove
)}
onClick={this.banSite.bind(this, this.getHostPattern(synopsis))}
onClick={this.banSite.bind(this, this.getHostPattern(synopsis), siteName)}
/>
</div>,
value: ''
Expand Down
12 changes: 12 additions & 0 deletions js/actions/appActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,18 @@ const appActions = {
})
},

/**
* Dispatches an event to the renderer process to remove all site settings
*
* @param {string} key - The settings key to remove
*/
clearSiteSettings: function (key) {
dispatch({
actionType: appConstants.APP_CLEAR_SITE_SETTINGS,
key
})
},

/**
* Changes the skipSync flag on an appState path.
* @param {Array.<string>} path
Expand Down

0 comments on commit 9ad2f80

Please sign in to comment.