mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Merge pull request #5524 from Ocelot-Social-Community/4732-Put-Footer-Content-In-The-Menu-On-Mobil-Phones
feat: 🍰 Mobile Footer Menu To Header Menu
This commit is contained in:
commit
23dbab9427
@ -112,16 +112,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.notifications-menu {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.base-button {
|
||||
overflow: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.notifications-menu-popover {
|
||||
max-width: 500px;
|
||||
margin-bottom: $size-height-base;
|
||||
|
||||
@ -50,4 +50,9 @@ export default {
|
||||
margin-left: 0.2rem;
|
||||
margin-right: 0.2rem;
|
||||
}
|
||||
@media only screen and (max-width: 810px) {
|
||||
.ds-footer {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
export default {
|
||||
MENU: [
|
||||
// {
|
||||
// nameIdent: 'ocelotRebranding.newsFeed',
|
||||
// nameIdent: 'nameIdent',
|
||||
// path: '/',
|
||||
// },
|
||||
// {
|
||||
// nameIdent: 'ocelotRebranding.about',
|
||||
// url: 'https://ocelot.org',
|
||||
// nameIdent: 'nameIdent',
|
||||
// url: 'https://ocelot.social',
|
||||
// },
|
||||
],
|
||||
}
|
||||
|
||||
@ -3,7 +3,9 @@
|
||||
<div class="main-navigation">
|
||||
<ds-container class="main-navigation-container" style="padding: 10px 10px">
|
||||
<div>
|
||||
<ds-flex class="main-navigation-flex">
|
||||
<!-- header menu -->
|
||||
<ds-flex v-if="!showMobileMenu" class="main-navigation-flex">
|
||||
<!-- logo -->
|
||||
<ds-flex-item :width="{ base: LOGOS.LOGO_HEADER_WIDTH }" style="margin-right: 20px">
|
||||
<a
|
||||
v-if="LOGOS.LOGO_HEADER_CLICK.externalLink"
|
||||
@ -19,11 +21,12 @@
|
||||
<logo logoType="header" />
|
||||
</nuxt-link>
|
||||
</ds-flex-item>
|
||||
|
||||
<!-- dynamic-brand-menu -->
|
||||
<ds-flex-item
|
||||
v-for="item in menu"
|
||||
:key="item.name"
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
class="branding-menu"
|
||||
:width="{ base: 'auto' }"
|
||||
style="margin-right: 20px"
|
||||
>
|
||||
@ -38,26 +41,26 @@
|
||||
</ds-text>
|
||||
</nuxt-link>
|
||||
</ds-flex-item>
|
||||
|
||||
<!-- search-field -->
|
||||
<ds-flex-item
|
||||
:width="{ base: '40%', sm: '40%', md: '40%', lg: '0%' }"
|
||||
class="mobile-hamburger-menu"
|
||||
>
|
||||
<base-button icon="bars" @click="toggleMobileMenuView" circle />
|
||||
</ds-flex-item>
|
||||
<ds-flex-item
|
||||
v-if="isLoggedIn"
|
||||
id="nav-search-box"
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
class="header-search"
|
||||
:width="{
|
||||
base: '45%',
|
||||
sm: '45%',
|
||||
md: isHeaderMenu ? 'auto' : '45%',
|
||||
sm: '40%',
|
||||
md: isHeaderMenu ? 'auto' : '40%',
|
||||
lg: isHeaderMenu ? 'auto' : '50%',
|
||||
}"
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
style="flex-shrink: 0; flex-grow: 1"
|
||||
id="nav-search-box"
|
||||
v-if="isLoggedIn"
|
||||
>
|
||||
<search-field />
|
||||
</ds-flex-item>
|
||||
<!-- filter-menu
|
||||
TODO: Filter is only visible on index
|
||||
-->
|
||||
<ds-flex-item
|
||||
v-if="isLoggedIn"
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
@ -67,6 +70,7 @@
|
||||
<filter-menu v-show="showFilterMenuDropdown" />
|
||||
</client-only>
|
||||
</ds-flex-item>
|
||||
<!-- locale-switch -->
|
||||
<ds-flex-item
|
||||
style="flex-basis: auto"
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
@ -82,20 +86,120 @@
|
||||
<locale-switch class="topbar-locale-switch" placement="top" offset="8" />
|
||||
<template v-if="isLoggedIn">
|
||||
<client-only>
|
||||
<!-- notification-menu -->
|
||||
<notification-menu placement="top" />
|
||||
</client-only>
|
||||
<div v-if="inviteRegistration">
|
||||
<client-only>
|
||||
<!-- invite-button -->
|
||||
<invite-button placement="top" />
|
||||
</client-only>
|
||||
</div>
|
||||
<client-only>
|
||||
<!-- avatar-menu -->
|
||||
<avatar-menu placement="top" />
|
||||
</client-only>
|
||||
</template>
|
||||
</div>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
|
||||
<!-- mobile header menu -->
|
||||
<div v-else>
|
||||
<!-- logo, hamburger-->
|
||||
<ds-flex>
|
||||
<ds-flex-item :width="{ base: LOGOS.LOGO_HEADER_WIDTH }" style="margin-right: 20px">
|
||||
<nuxt-link :to="{ name: 'index' }" v-scroll-to="'.main-navigation'">
|
||||
<logo logoType="header" />
|
||||
</nuxt-link>
|
||||
</ds-flex-item>
|
||||
|
||||
<!-- hamburger button -->
|
||||
<ds-flex-item class="mobile-hamburger-menu">
|
||||
<client-only>
|
||||
<div style="display: inline-flex; padding-right: 20px">
|
||||
<notification-menu />
|
||||
</div>
|
||||
</client-only>
|
||||
<base-button icon="bars" @click="toggleMobileMenuView" circle />
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
<!-- search, filter-->
|
||||
<ds-flex class="mobile-menu">
|
||||
<!-- search-field mobile-->
|
||||
<ds-flex-item
|
||||
v-if="isLoggedIn"
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
style="padding: 20px"
|
||||
>
|
||||
<search-field />
|
||||
</ds-flex-item>
|
||||
<!-- filter menu mobile-->
|
||||
<ds-flex-item
|
||||
v-if="isLoggedIn"
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
style="flex-grow: 0; flex-basis: auto; padding: 20px 0"
|
||||
>
|
||||
<client-only>
|
||||
<filter-menu v-show="showFilterMenuDropdown" />
|
||||
</client-only>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
<!-- switch language, notification, invite, profil -->
|
||||
<ds-flex style="margin: 0 20px">
|
||||
<!-- locale-switch mobile-->
|
||||
<ds-flex-item :class="{ 'hide-mobile-menu': !toggleMobileMenu }">
|
||||
<locale-switch class="topbar-locale-switch" placement="top" offset="8" />
|
||||
</ds-flex-item>
|
||||
<!-- invite-button mobile-->
|
||||
<ds-flex-item
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
style="text-align: center"
|
||||
>
|
||||
<client-only>
|
||||
<invite-button placement="top" />
|
||||
</client-only>
|
||||
</ds-flex-item>
|
||||
<ds-flex-item
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
style="text-align: end"
|
||||
>
|
||||
<client-only>
|
||||
<!-- avatar-menu mobile-->
|
||||
<avatar-menu placement="top" />
|
||||
</client-only>
|
||||
</ds-flex-item>
|
||||
</ds-flex>
|
||||
<div
|
||||
:class="{ 'hide-mobile-menu': !toggleMobileMenu }"
|
||||
class="mobile-menu footer-mobile"
|
||||
>
|
||||
<!-- dynamic branding menu -->
|
||||
<ul v-if="isHeaderMenu" class="dynamic-branding-mobil">
|
||||
<li v-for="item in menu" :key="item.name">
|
||||
<a v-if="item.url" :href="item.url" target="_blank">
|
||||
<ds-text size="large" bold>
|
||||
{{ $t(item.nameIdent) }}
|
||||
</ds-text>
|
||||
</a>
|
||||
<nuxt-link v-else :to="item.path">
|
||||
<ds-text size="large" bold>
|
||||
{{ $t(item.nameIdent) }}
|
||||
</ds-text>
|
||||
</nuxt-link>
|
||||
</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<!-- dynamic footer menu in header -->
|
||||
<ul class="dynamic-footer-mobil">
|
||||
<li v-for="pageParams in links.FOOTER_LINK_LIST" :key="pageParams.name">
|
||||
<page-params-link :pageParams="pageParams">
|
||||
{{ $t(pageParams.internalPage.footerIdent) }}
|
||||
</page-params-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ds-container>
|
||||
</div>
|
||||
@ -126,6 +230,8 @@ import SearchField from '~/components/features/SearchField/SearchField.vue'
|
||||
import Modal from '~/components/Modal'
|
||||
import NotificationMenu from '~/components/NotificationMenu/NotificationMenu'
|
||||
import PageFooter from '~/components/PageFooter/PageFooter'
|
||||
import links from '~/constants/links.js'
|
||||
import PageParamsLink from '~/components/_new/features/PageParamsLink/PageParamsLink.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -137,11 +243,14 @@ export default {
|
||||
Modal,
|
||||
NotificationMenu,
|
||||
PageFooter,
|
||||
PageParamsLink,
|
||||
SearchField,
|
||||
},
|
||||
mixins: [seo],
|
||||
data() {
|
||||
return {
|
||||
windowWidth: null,
|
||||
links,
|
||||
LOGOS,
|
||||
isHeaderMenu: headerMenu.MENU.length > 0,
|
||||
menu: headerMenu.MENU,
|
||||
@ -159,12 +268,22 @@ export default {
|
||||
const [firstRoute] = this.$route.matched
|
||||
return firstRoute && firstRoute.name === 'index'
|
||||
},
|
||||
showMobileMenu() {
|
||||
if (!this.windowWidth) return false
|
||||
return this.windowWidth < 810
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toggleMobileMenuView() {
|
||||
this.toggleMobileMenu = !this.toggleMobileMenu
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.windowWidth = window.innerWidth
|
||||
window.addEventListener('resize', () => {
|
||||
this.windowWidth = window.innerWidth
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -206,18 +325,38 @@ export default {
|
||||
margin-left: auto;
|
||||
text-align: right;
|
||||
}
|
||||
@media only screen and (min-width: 730px) {
|
||||
.mobile-hamburger-menu {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mobile-menu {
|
||||
margin: 0 20px;
|
||||
}
|
||||
@media only screen and (max-width: 730px) {
|
||||
.mobile-search {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.dynamic-branding-mobil,
|
||||
.dynamic-footer-mobil {
|
||||
line-height: 30px;
|
||||
font-size: large;
|
||||
}
|
||||
.dynamic-branding-mobil li {
|
||||
margin: 17px 0;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 810px) {
|
||||
#nav-search-box,
|
||||
.main-navigation-right {
|
||||
margin: 10px 0px;
|
||||
}
|
||||
.main-navigation-right {
|
||||
width: 100%;
|
||||
}
|
||||
.hide-mobile-menu {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 810px) {
|
||||
.main-navigation-right {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user