mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
fix(webapp): better settings ux (#8347)
* Scroll to notification settings when opened (for mobile) * scroll to settings content when clicking on menu entry * Scroll to settings content on mobile and fix weird loading state * Add fail-safety * Fix linting
This commit is contained in:
parent
4509633248
commit
fb12a139bc
@ -5,14 +5,14 @@
|
||||
</ds-space>
|
||||
<ds-space margin="large" />
|
||||
<ds-flex gutter="small">
|
||||
<ds-flex-item :width="{ base: '100%', md: '200px' }">
|
||||
<div class="menu-container">
|
||||
<ds-menu :routes="routes" :is-exact="() => true" />
|
||||
</ds-flex-item>
|
||||
<ds-flex-item :width="{ base: '100%', md: 1 }">
|
||||
</div>
|
||||
<div class="settings-content" id="settings-content">
|
||||
<transition name="slide-up" appear>
|
||||
<nuxt-child />
|
||||
</transition>
|
||||
</ds-flex-item>
|
||||
</div>
|
||||
</ds-flex>
|
||||
</div>
|
||||
</template>
|
||||
@ -87,3 +87,24 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.menu-container {
|
||||
width: 100%;
|
||||
}
|
||||
.settings-content {
|
||||
flex: 1;
|
||||
padding: 0 24px;
|
||||
margin-top: 32px;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 600px) {
|
||||
.settings-content {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.menu-container {
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -75,8 +75,10 @@
|
||||
<script>
|
||||
import { blockedUsers, unblockUser } from '~/graphql/settings/BlockedUsers'
|
||||
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
ProfileAvatar,
|
||||
},
|
||||
|
||||
@ -26,8 +26,10 @@ import { mapGetters } from 'vuex'
|
||||
import { userDataQuery } from '~/graphql/User'
|
||||
import BaseButton from '~/components/_new/generic/BaseButton/BaseButton.vue'
|
||||
import isEmpty from 'lodash/isEmpty'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
BaseButton,
|
||||
},
|
||||
|
||||
@ -4,8 +4,10 @@
|
||||
|
||||
<script>
|
||||
import DeleteData from '~/components/DeleteData/DeleteData.vue'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
DeleteData,
|
||||
},
|
||||
|
||||
@ -39,8 +39,10 @@
|
||||
import axios from 'axios'
|
||||
import { mapGetters, mapMutations } from 'vuex'
|
||||
import { updateUserMutation } from '~/graphql/User.js'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
head() {
|
||||
return {
|
||||
title: this.$t('settings.embeds.name'),
|
||||
|
||||
@ -47,10 +47,12 @@ import { mapGetters, mapMutations } from 'vuex'
|
||||
import UniqueSlugForm from '~/components/utils/UniqueSlugForm'
|
||||
import { updateUserMutation } from '~/graphql/User'
|
||||
import { queryLocations } from '~/graphql/location'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
let timeout
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
name: 'NewsFeed',
|
||||
data() {
|
||||
return {
|
||||
|
||||
@ -7,8 +7,10 @@
|
||||
|
||||
<script>
|
||||
import HcEmpty from '~/components/Empty/Empty'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
HcEmpty,
|
||||
},
|
||||
|
||||
@ -7,8 +7,10 @@
|
||||
|
||||
<script>
|
||||
import HcEmpty from '~/components/Empty/Empty'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
HcEmpty,
|
||||
},
|
||||
|
||||
@ -72,8 +72,10 @@
|
||||
<script>
|
||||
import { mutedUsers, unmuteUser } from '~/graphql/settings/MutedUsers'
|
||||
import ProfileAvatar from '~/components/_new/generic/ProfileAvatar/ProfileAvatar'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
ProfileAvatar,
|
||||
},
|
||||
|
||||
@ -31,8 +31,10 @@ import { mapGetters } from 'vuex'
|
||||
import { AddEmailAddressMutation } from '~/graphql/EmailAddress.js'
|
||||
import { SweetalertIcon } from 'vue-sweetalert-icons'
|
||||
import normalizeEmail from '~/components/utils/NormalizeEmail'
|
||||
import scrollToContent from '../scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
SweetalertIcon,
|
||||
},
|
||||
|
||||
@ -7,8 +7,10 @@
|
||||
|
||||
<script>
|
||||
import HcEmpty from '~/components/Empty/Empty'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
HcEmpty,
|
||||
},
|
||||
|
||||
@ -35,8 +35,10 @@ import {
|
||||
} from '~/graphql/SocialMedia.js'
|
||||
import MySomethingList from '~/components/_new/features/MySomethingList/MySomethingList.vue'
|
||||
import SocialMediaListItem from '~/components/_new/features/SocialMedia/SocialMediaListItem.vue'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
MySomethingList,
|
||||
SocialMediaListItem,
|
||||
|
||||
@ -29,8 +29,10 @@
|
||||
<script>
|
||||
import { mapGetters, mapMutations } from 'vuex'
|
||||
import { updateUserMutation } from '~/graphql/User'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
data() {
|
||||
return {
|
||||
emailNotificationSettings: [],
|
||||
|
||||
@ -12,8 +12,10 @@
|
||||
<script>
|
||||
import { mapGetters, mapMutations } from 'vuex'
|
||||
import { updateUserMutation } from '~/graphql/User'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
data() {
|
||||
return {
|
||||
shoutsAllowed: false,
|
||||
|
||||
13
webapp/pages/settings/scroll-to-content.js
Normal file
13
webapp/pages/settings/scroll-to-content.js
Normal file
@ -0,0 +1,13 @@
|
||||
export default {
|
||||
mounted() {
|
||||
if (document.documentElement.clientWidth >= 600) return
|
||||
|
||||
const content = document.getElementById('settings-content')
|
||||
|
||||
if (!content) return
|
||||
|
||||
content.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
})
|
||||
},
|
||||
}
|
||||
@ -7,8 +7,10 @@
|
||||
|
||||
<script>
|
||||
import ChangePassword from '~/components/Password/Change'
|
||||
import scrollToContent from './scroll-to-content.js'
|
||||
|
||||
export default {
|
||||
mixins: [scrollToContent],
|
||||
components: {
|
||||
ChangePassword,
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user