Skip to content

Commit

Permalink
Adjust mobile navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
AtanasKrondev committed Jun 14, 2021
1 parent 454709b commit f1cc974
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 52 deletions.
16 changes: 16 additions & 0 deletions src/components/layout/FooterSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ export default {
.footer-btns {
margin-bottom: 8px;
@include mobile {
display: flex;
flex-direction: column;
.outlined-button {
width: 100%;
margin-bottom: 8px;
}
}
}
.venture {
Expand Down Expand Up @@ -171,6 +181,12 @@ export default {
}
}
}
a {
@include mobile {
display: block;
}
}
}
p {
Expand Down
134 changes: 84 additions & 50 deletions src/components/layout/MobileNavigation.vue
Original file line number Diff line number Diff line change
@@ -1,52 +1,55 @@
<template>
<!-- TODO: Extract overlay to a separate component -->
<div
v-if="showOverlay"
class="mobile-navigation-overlay"
>
<ButtonPlain
class="close-button"
@click="showOverlay = false"
>
<!--eslint-disable-line vue-i18n/no-raw-text-->
&#x2715;
</ButtonPlain>
<Navigation mobile />
<FooterSection />
</div>
<SearchFeed
v-else-if="isTipsRoute && showSearchFeed"
class="mobile-navigation-sticky"
@close="showSearchFeed = false"
/>
<div
v-else
class="mobile-navigation-sticky mobile-navigation"
>
<RouterLink
class="logo"
to="/"
>
<img src="../../assets/headerLogo.svg">
</RouterLink>

<div class="separator" />

<a
v-if="!useSdkWallet && isTipsRoute"
:href="tipDeepLink"
>
<IconWallet />
</a>
<ButtonPlain
v-if="isTipsRoute"
@click="showSearchFeed = true"
>
<IconSearch />
</ButtonPlain>
<ButtonPlain @click="showOverlay = true">
<IconMobileMenu />
</ButtonPlain>
<div class="mobile-navigation-sticky mobile-navigation">
<Transition name="slide">
<Modal
v-if="showOverlay"
@close="showOverlay = false"
>
<div class="mobile-navigation-overlay">
<ButtonPlain
class="close-button"
@click="showOverlay = false"
>
<!--eslint-disable-line vue-i18n/no-raw-text-->
&#x2715;
</ButtonPlain>
<Navigation mobile />
<FooterSection />
</div>
</Modal>
</Transition>
<SearchFeed
v-if="isTipsRoute && showSearchFeed"
class="mobile-navigation-sticky"
@close="showSearchFeed = false"
/>
<template v-else>
<RouterLink
class="logo"
to="/"
>
<img src="../../assets/headerLogo.svg">
</RouterLink>

<div class="separator" />

<a
v-if="!useSdkWallet && isTipsRoute"
:href="tipDeepLink"
>
<IconWallet />
</a>
<ButtonPlain
v-if="isTipsRoute"
@click="showSearchFeed = true"
>
<IconSearch />
</ButtonPlain>
<ButtonPlain @click="showOverlay = true">
<IconMobileMenu />
</ButtonPlain>
</template>
</div>
</template>

Expand All @@ -60,6 +63,7 @@ import IconWallet from '../../assets/iconWallet.svg?icon-component';
import IconSearch from '../../assets/iconSearch.svg?icon-component';
import IconMobileMenu from '../../assets/iconMobileMenu.svg?icon-component';
import ButtonPlain from '../ButtonPlain.vue';
import Modal from '../Modal.vue';
export default {
components: {
Expand All @@ -70,6 +74,7 @@ export default {
IconSearch,
IconMobileMenu,
ButtonPlain,
Modal,
},
data: () => ({
showOverlay: false,
Expand Down Expand Up @@ -101,9 +106,9 @@ export default {
color: $light_font_color;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
left: 50%;
padding: 1rem;
.close-button {
Expand All @@ -117,8 +122,8 @@ export default {
}
.mobile-navigation {
padding-right: 0.6rem;
padding-left: 1rem;
padding-right: 8px;
padding-left: 8px;
display: flex;
align-items: center;
Expand Down Expand Up @@ -159,4 +164,33 @@ export default {
width: 100%;
}
}
::v-deep .not-bootstrap-modal {
.overlay {
background-color: rgba($background_color, 0.6);
}
&.slide-enter-active,
&.slide-enter-active .mobile-navigation-overlay,
&.slide-enter-active .mobile-navigation-overlay .navi,
&.slide-leave-active,
&.slide-leave-active .mobile-navigation-overlay {
transition-duration: 0.3s;
transition-timing-function: ease;
}
&.slide-leave-active,
&.slide-leave-active .mobile-navigation-overlay {
transition-duration: 0.2s;
}
&.slide-enter .mobile-navigation-overlay,
&.slide-leave-to .mobile-navigation-overlay {
transform: translateX(100%);
}
&.slide-leave-to .mobile-navigation-overlay {
opacity: 0;
}
}
</style>
4 changes: 2 additions & 2 deletions src/components/layout/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ export default {
}
&.mobile a:not(.logo) {
font-size: 0.95rem;
margin-bottom: 1rem;
font-size: 14px;
margin-bottom: 8px;
}
}
</style>

0 comments on commit f1cc974

Please sign in to comment.