diff --git a/src/sites/twitch-twilight/modules/chat/viewer_card.jsx b/src/sites/twitch-twilight/modules/chat/viewer_card.jsx index 9a735291..649aea7d 100644 --- a/src/sites/twitch-twilight/modules/chat/viewer_card.jsx +++ b/src/sites/twitch-twilight/modules/chat/viewer_card.jsx @@ -18,10 +18,18 @@ export default class ViewerCards extends Module { this.last_login = null; this.settings.add('chat.viewer-cards.viewer-card-gift-subscribe-button', { - default: false, + requires: ['channel.hide-all-sub-gifting'], + default: null, + process(ctx, val) { + if ( val != null ) + return val; + + return ctx.get('channel.hide-all-sub-gifting') + }, ui: { path: 'Chat > Viewer Cards >> Appearance', title: 'Hide "Gift a Sub" button on viewer cards', + description: 'By default, this inherits its value from [Channel > Appearance > Hide all "Gift a Sub" button](~channel.hide-all-sub-gifting)\'', component: 'setting-check-box' }, }); diff --git a/src/sites/twitch-twilight/modules/css_tweaks/index.js b/src/sites/twitch-twilight/modules/css_tweaks/index.js index 6c436189..802f0f9c 100644 --- a/src/sites/twitch-twilight/modules/css_tweaks/index.js +++ b/src/sites/twitch-twilight/modules/css_tweaks/index.js @@ -407,6 +407,16 @@ export default class CSSTweaks extends Module { changed: val => this.toggle('hide-unfollow-button', val) }); + this.settings.add('channel.hide-all-sub-gifting', { + default: false, + ui: { + path: 'Channel > Appearance >> General', + title: 'Hide all "Gift a Sub" button.', + component: 'setting-check-box' + }, + changed: val => this.toggle('hide-all-sub-gifting', val) + }); + this.settings.add('channel.hide-live-indicator', { requires: ['context.route.name'], process(ctx, val) { @@ -461,6 +471,7 @@ export default class CSSTweaks extends Module { this.toggleHide('prime-offers', !this.settings.get('layout.prime-offers')); this.toggleHide('top-discover', !this.settings.get('layout.discover')); this.toggle('hide-unfollow-button', this.settings.get('channel.hide-unfollow')); + this.toggle('hide-all-sub-gifting', this.settings.get('channel.hide-all-sub-gifting')); this.toggle('square-avatars', ! this.settings.get('channel.round-avatars')); //this.toggleHide('not-live-bar', this.settings.get('channel.hide-not-live-bar')); diff --git a/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-all-sub-gifting.scss b/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-all-sub-gifting.scss new file mode 100644 index 00000000..6a991ad9 --- /dev/null +++ b/src/sites/twitch-twilight/modules/css_tweaks/styles/hide-all-sub-gifting.scss @@ -0,0 +1,4 @@ +.support-panel > div:not(.scrollable-area) button:not(.tw-interactable):not(.tw-purchase-button), +button[data-test-selector="gift-subscribe-button"] { + display: none !important; +} \ No newline at end of file