From 2e35289c3376881ca17b9330113c816a3327f245 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 3 May 2020 17:36:12 +0300 Subject: [PATCH] initial work on settings modal --- src/App.js | 5 + src/App.scss | 3 + src/App.vue | 7 +- .../mobile_post_status_button.js | 2 +- .../post_status_modal/post_status_modal.js | 3 - .../post_status_modal/post_status_modal.vue | 1 - .../settings_modal/settings_modal.js | 39 ++ .../settings_modal/settings_modal.scss | 59 ++ .../settings_modal/settings_modal.vue | 31 + .../settings_modal/tabs/data_import_export.js | 65 ++ .../tabs/data_import_export.vue | 43 ++ .../settings_modal/tabs/mutes_and_blocks.js | 124 ++++ .../settings_modal/tabs/mutes_and_blocks.vue | 173 +++++ .../settings_modal/tabs/notifications.js | 27 + .../settings_modal/tabs/notifications.vue | 42 ++ src/components/settings_modal/tabs/profile.js | 179 ++++++ .../settings_modal/tabs/profile.scss | 82 +++ .../settings_modal/tabs/profile.vue | 213 +++++++ .../settings_modal/tabs/security.js | 106 ++++ .../settings_modal/tabs/security.vue | 143 +++++ src/components/tab_switcher/tab_switcher.js | 7 +- src/components/tab_switcher/tab_switcher.scss | 220 +++++-- src/components/user_settings/user_settings.js | 257 +------- .../user_settings/user_settings.vue | 597 ------------------ src/i18n/en.json | 1 + src/modules/interface.js | 28 + 26 files changed, 1530 insertions(+), 927 deletions(-) create mode 100644 src/components/settings_modal/settings_modal.js create mode 100644 src/components/settings_modal/settings_modal.scss create mode 100644 src/components/settings_modal/settings_modal.vue create mode 100644 src/components/settings_modal/tabs/data_import_export.js create mode 100644 src/components/settings_modal/tabs/data_import_export.vue create mode 100644 src/components/settings_modal/tabs/mutes_and_blocks.js create mode 100644 src/components/settings_modal/tabs/mutes_and_blocks.vue create mode 100644 src/components/settings_modal/tabs/notifications.js create mode 100644 src/components/settings_modal/tabs/notifications.vue create mode 100644 src/components/settings_modal/tabs/profile.js create mode 100644 src/components/settings_modal/tabs/profile.scss create mode 100644 src/components/settings_modal/tabs/profile.vue create mode 100644 src/components/settings_modal/tabs/security.js create mode 100644 src/components/settings_modal/tabs/security.vue diff --git a/src/App.js b/src/App.js index 61b5eec1..4d9d50d4 100644 --- a/src/App.js +++ b/src/App.js @@ -6,6 +6,7 @@ import InstanceSpecificPanel from './components/instance_specific_panel/instance import FeaturesPanel from './components/features_panel/features_panel.vue' import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue' import ChatPanel from './components/chat_panel/chat_panel.vue' +import SettingsModal from './components/settings_modal/settings_modal.vue' import MediaModal from './components/media_modal/media_modal.vue' import SideDrawer from './components/side_drawer/side_drawer.vue' import MobilePostStatusButton from './components/mobile_post_status_button/mobile_post_status_button.vue' @@ -29,6 +30,7 @@ export default { SideDrawer, MobilePostStatusButton, MobileNav, + SettingsModal, UserReportingModal, PostStatusModal }, @@ -112,6 +114,9 @@ export default { onSearchBarToggled (hidden) { this.searchBarHidden = hidden }, + openSettingsModal () { + this.$store.dispatch('openSettingsModal') + }, updateMobileState () { const mobileLayout = windowWidth() <= 800 const changed = mobileLayout !== this.isMobileLayout diff --git a/src/App.scss b/src/App.scss index 89aa3215..7db9461c 100644 --- a/src/App.scss +++ b/src/App.scss @@ -860,6 +860,7 @@ nav { } } +// DELETE .setting-item { border-bottom: 2px solid var(--fg, $fallback--fg); margin: 1em 1em 1.4em; @@ -905,6 +906,8 @@ nav { max-width: 6em; } } +// DELETE + .select-multiple { display: flex; .option-list { diff --git a/src/App.vue b/src/App.vue index ff62fc51..db3f981f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -46,15 +46,15 @@ @toggled="onSearchBarToggled" @click.stop.native /> - - + + diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js index 0ad12bb1..ff2d4eaa 100644 --- a/src/components/mobile_post_status_button/mobile_post_status_button.js +++ b/src/components/mobile_post_status_button/mobile_post_status_button.js @@ -52,7 +52,7 @@ const MobilePostStatusButton = { window.removeEventListener('scroll', this.handleScrollEnd) }, openPostForm () { - this.$store.dispatch('openPostStatusModal') + this.$store.dispatch('openSettingsModal') }, handleOSK () { // This is a big hack: we're guessing from changed window sizes if the diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js index b44354db..be945400 100644 --- a/src/components/post_status_modal/post_status_modal.js +++ b/src/components/post_status_modal/post_status_modal.js @@ -13,9 +13,6 @@ const PostStatusModal = { } }, computed: { - isLoggedIn () { - return !!this.$store.state.users.currentUser - }, modalActivated () { return this.$store.state.postStatus.modalActivated }, diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue index dbcd321e..07c58f74 100644 --- a/src/components/post_status_modal/post_status_modal.vue +++ b/src/components/post_status_modal/post_status_modal.vue @@ -1,6 +1,5 @@