From 63946f7561e336a35311adbc1e599ecace03e1f1 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Sat, 24 Sep 2022 11:12:11 +0200 Subject: [PATCH] Add a settings section component to reduce duplicate code (#2609) --- .../components/data-settings/data-settings.js | 2 + .../data-settings/data-settings.sass | 1 - .../data-settings/data-settings.vue | 13 ++-- .../distraction-settings.js | 2 + .../distraction-settings.sass | 1 - .../distraction-settings.vue | 30 ++------ .../download-settings/download-settings.js | 2 + .../download-settings/download-settings.sass | 6 -- .../download-settings/download-settings.vue | 14 ++-- .../external-player-settings.js | 2 + .../external-player-settings.sass | 1 - .../external-player-settings.vue | 15 ++-- .../ft-settings-section.js | 11 +++ .../ft-settings-section.sass} | 68 ++++++++++--------- .../ft-settings-section.vue | 14 ++++ .../ft-sponsor-block-category.sass | 1 - .../general-settings/general-settings.js | 2 + .../general-settings/general-settings.sass | 2 - .../general-settings/general-settings.vue | 14 ++-- .../parental-control-settings.js | 2 + .../parental-control-settings.sass | 1 - .../parental-control-settings.vue | 13 ++-- .../player-settings/player-settings.js | 2 + .../player-settings/player-settings.sass | 2 - .../player-settings/player-settings.vue | 12 ++-- .../privacy-settings/privacy-settings.js | 2 + .../privacy-settings/privacy-settings.sass | 1 - .../privacy-settings/privacy-settings.vue | 13 ++-- .../proxy-settings/proxy-settings.js | 2 + .../proxy-settings/proxy-settings.sass | 5 -- .../proxy-settings/proxy-settings.vue | 15 ++-- .../sponsor-block-settings.js | 2 + .../sponsor-block-settings.sass | 5 -- .../sponsor-block-settings.vue | 17 ++--- .../subscription-settings.js | 2 + .../subscription-settings.sass | 6 -- .../subscription-settings.vue | 15 ++-- .../theme-settings/theme-settings.js | 2 + .../theme-settings/theme-settings.sass | 1 - .../theme-settings/theme-settings.vue | 13 ++-- 40 files changed, 140 insertions(+), 194 deletions(-) delete mode 100644 src/renderer/components/data-settings/data-settings.sass delete mode 100644 src/renderer/components/distraction-settings/distraction-settings.sass delete mode 100644 src/renderer/components/external-player-settings/external-player-settings.sass create mode 100644 src/renderer/components/ft-settings-section/ft-settings-section.js rename src/renderer/{sass-partials/_settings.sass => components/ft-settings-section/ft-settings-section.sass} (52%) create mode 100644 src/renderer/components/ft-settings-section/ft-settings-section.vue delete mode 100644 src/renderer/components/parental-control-settings/parental-control-settings.sass delete mode 100644 src/renderer/components/privacy-settings/privacy-settings.sass delete mode 100644 src/renderer/components/proxy-settings/proxy-settings.sass delete mode 100644 src/renderer/components/sponsor-block-settings/sponsor-block-settings.sass delete mode 100644 src/renderer/components/subscription-settings/subscription-settings.sass delete mode 100644 src/renderer/components/theme-settings/theme-settings.sass diff --git a/src/renderer/components/data-settings/data-settings.js b/src/renderer/components/data-settings/data-settings.js index 63bd50f4..c77e830f 100644 --- a/src/renderer/components/data-settings/data-settings.js +++ b/src/renderer/components/data-settings/data-settings.js @@ -1,4 +1,5 @@ import Vue from 'vue' +import FtSettingsSection from '../ft-settings-section/ft-settings-section.vue' import { mapActions, mapMutations } from 'vuex' import FtCard from '../ft-card/ft-card.vue' import FtButton from '../ft-button/ft-button.vue' @@ -16,6 +17,7 @@ import ytch from 'yt-channel-info' export default Vue.extend({ name: 'DataSettings', components: { + 'ft-settings-section': FtSettingsSection, 'ft-card': FtCard, 'ft-button': FtButton, 'ft-toggle-switch': FtToggleSwitch, diff --git a/src/renderer/components/data-settings/data-settings.sass b/src/renderer/components/data-settings/data-settings.sass deleted file mode 100644 index 05cb0dfb..00000000 --- a/src/renderer/components/data-settings/data-settings.sass +++ /dev/null @@ -1 +0,0 @@ -@use "../../sass-partials/settings" diff --git a/src/renderer/components/data-settings/data-settings.vue b/src/renderer/components/data-settings/data-settings.vue index ae9fa730..aa65ee28 100644 --- a/src/renderer/components/data-settings/data-settings.vue +++ b/src/renderer/components/data-settings/data-settings.vue @@ -1,11 +1,7 @@