From a8e013bd6517edb3a81eb5001e6ab948cb87bedb Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 26 May 2020 23:58:55 +0300 Subject: Move modal frame parts away from modal-content into modal, improve error handling --- src/components/settings_modal/settings_modal.js | 16 +- src/components/settings_modal/settings_modal.scss | 28 +++- src/components/settings_modal/settings_modal.vue | 45 +++++- .../settings_modal/settings_modal_content.js | 8 - .../settings_modal/settings_modal_content.scss | 30 +--- .../settings_modal/settings_modal_content.vue | 166 ++++++++------------- 6 files changed, 145 insertions(+), 148 deletions(-) (limited to 'src/components/settings_modal') diff --git a/src/components/settings_modal/settings_modal.js b/src/components/settings_modal/settings_modal.js index 84d673a8..32ef38d6 100644 --- a/src/components/settings_modal/settings_modal.js +++ b/src/components/settings_modal/settings_modal.js @@ -1,6 +1,6 @@ import Modal from 'src/components/modal/modal.vue' -import BigSpinner from 'src/components/big_spinner/big_spinner.vue' -import ErrorWindow from 'src/components/error_window/error_window.vue' +import PanelLoading from 'src/components/panel_loading/panel_loading.vue' +import AsyncComponentError from 'src/components/async_component_error/async_component_error.vue' import getResettableAsyncComponent from 'src/services/resettable_async_component.js' const SettingsModal = { @@ -9,12 +9,20 @@ const SettingsModal = { SettingsModalContent: getResettableAsyncComponent( () => import('./settings_modal_content.vue'), { - loading: BigSpinner, - error: ErrorWindow, + loading: PanelLoading, + error: AsyncComponentError, delay: 0 } ) }, + methods: { + closeModal () { + this.$store.dispatch('closeSettingsModal') + }, + peekModal () { + this.$store.dispatch('togglePeekSettingsModal') + } + }, computed: { modalActivated () { return this.$store.state.interface.settingsModalState !== 'hidden' diff --git a/src/components/settings_modal/settings_modal.scss b/src/components/settings_modal/settings_modal.scss index ece96364..833ff89a 100644 --- a/src/components/settings_modal/settings_modal.scss +++ b/src/components/settings_modal/settings_modal.scss @@ -3,7 +3,7 @@ overflow: hidden; &.peek { - .modal-panel { + .settings-modal-panel { /* Explanation: * Modal is positioned vertically centered. * 100vh - 100% = Distance between modal's top+bottom boundaries and screen @@ -15,4 +15,30 @@ transform: translateY(calc(((100vh - 100%) / 2 + 100%) - 50px)); } } + + .settings-modal-panel { + overflow: hidden; + transition: transform; + transition-timing-function: ease-in-out; + transition-duration: 300ms; + width: 1000px; + max-width: 90vw; + height: 90vh; + + @media all and (max-width: 800px) { + max-width: 100vw; + height: 100vh; + } + + .panel-body { + height: 100%; + overflow-y: hidden; + + .btn { + min-height: 28px; + min-width: 10em; + padding: 0 2em; + } + } + } } diff --git a/src/components/settings_modal/settings_modal.vue b/src/components/settings_modal/settings_modal.vue index b6ca5c6b..ded02f4a 100644 --- a/src/components/settings_modal/settings_modal.vue +++ b/src/components/settings_modal/settings_modal.vue @@ -5,10 +5,47 @@ :class="{ peek: modalPeeked }" :no-background="modalPeeked" > - +
+
+ + {{ $t('settings.settings') }} + + + + + + +
+
+ +
+
diff --git a/src/components/settings_modal/settings_modal_content.js b/src/components/settings_modal/settings_modal_content.js index b842ec7d..b27fbd28 100644 --- a/src/components/settings_modal/settings_modal_content.js +++ b/src/components/settings_modal/settings_modal_content.js @@ -31,14 +31,6 @@ const SettingsModalContent = { isLoggedIn () { return !!this.$store.state.users.currentUser } - }, - methods: { - closeModal () { - this.$store.dispatch('closeSettingsModal') - }, - peekModal () { - this.$store.dispatch('togglePeekSettingsModal') - } } } diff --git a/src/components/settings_modal/settings_modal_content.scss b/src/components/settings_modal/settings_modal_content.scss index 92e167a2..f80306c6 100644 --- a/src/components/settings_modal/settings_modal_content.scss +++ b/src/components/settings_modal/settings_modal_content.scss @@ -1,32 +1,6 @@ @import 'src/_variables.scss'; - -.settings-modal-panel { - overflow: hidden; - transition: transform; - transition-timing-function: ease-in-out; - transition-duration: 300ms; - width: 1000px; - max-width: 90vw; - height: 90vh; - - @media all and (max-width: 800px) { - max-width: 100vw; - height: 100vh; - } - - .settings_tab-switcher { - height: 100%; - } - .panel-body { - height: 100%; - overflow-y: hidden; - - .btn { - min-height: 28px; - min-width: 10em; - padding: 0 2em; - } - } +.settings_tab-switcher { + height: 100%; .full-height { height: 100%; diff --git a/src/components/settings_modal/settings_modal_content.vue b/src/components/settings_modal/settings_modal_content.vue index 865a2adf..3e06148f 100644 --- a/src/components/settings_modal/settings_modal_content.vue +++ b/src/components/settings_modal/settings_modal_content.vue @@ -1,112 +1,72 @@ -- cgit v1.2.3-70-g09d2