From 8ee50f9f160cab1a0eec3dfddd31de26c3993092 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 7 Oct 2019 00:05:21 +0300 Subject: [PATCH] replace checkboxes in user-settings with Checkbox component --- src/components/checkbox/checkbox.vue | 33 ++++- src/components/user_settings/user_settings.js | 4 +- .../user_settings/user_settings.vue | 118 ++++++------------ 3 files changed, 69 insertions(+), 86 deletions(-) diff --git a/src/components/checkbox/checkbox.vue b/src/components/checkbox/checkbox.vue index 2b822ec3..441f815c 100644 --- a/src/components/checkbox/checkbox.vue +++ b/src/components/checkbox/checkbox.vue @@ -1,13 +1,22 @@ @@ -17,7 +26,11 @@ export default { prop: 'checked', event: 'change' }, - props: ['checked', 'indeterminate'] + props: [ + 'checked', + 'indeterminate', + 'disabled' + ] } @@ -54,6 +67,17 @@ export default { box-sizing: border-box; } + &.disabled { + .checkbox-indicator::before, + .label { + opacity: .5; + } + .label { + color: $fallback--faint; + color: var(--faint, $fallback--faint); + } + } + input[type=checkbox] { display: none; @@ -68,9 +92,6 @@ export default { color: var(--text, $fallback--text); } - &:disabled + .checkbox-indicator::before { - opacity: .5; - } } & > span { diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index f12cccae..32eb802e 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -17,6 +17,7 @@ import Autosuggest from '../autosuggest/autosuggest.vue' import Importer from '../importer/importer.vue' import Exporter from '../exporter/exporter.vue' import withSubscription from '../../hocs/with_subscription/with_subscription' +import Checkbox from '../checkbox/checkbox.vue' import Mfa from './mfa.vue' const BlockList = withSubscription({ @@ -82,7 +83,8 @@ const UserSettings = { ProgressButton, Importer, Exporter, - Mfa + Mfa, + Checkbox }, computed: { user () { diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index ef75ac52..423589fa 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -53,12 +53,9 @@ />

- - + + {{ $t('settings.lock_account_description') }} +

@@ -75,69 +72,52 @@

- - + + {{ $t('settings.no_rich_text_description') }} +

- - + + {{ $t('settings.hide_follows_description') }} +

- - + > + {{ $t('settings.hide_follows_count_description') }} +

- - + > + {{ $t('settings.hide_followers_description') }} +

- - + {{ $t('settings.hide_followers_count_description') }} +

- - - + + + +

- - + + {{ $t('settings.discoverable') }} +