Skip to content

Commit b14e115

Browse files
committed
fix(mobile): fix bottom navbar
1 parent dc2660d commit b14e115

File tree

5 files changed

+54
-29
lines changed

5 files changed

+54
-29
lines changed

src/components/AppComponent.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,14 @@ const onBack = () => {
224224
&.reverse {
225225
header {
226226
top: auto;
227-
bottom: 0;
227+
bottom: calc(0% - #{layout.$safe-area-inset-bottom});
228228
flex-direction: column-reverse;
229229
}
230230
231231
main {
232232
min-height: layout.$bottom-content-height;
233-
margin-top: layout.$safe-area-inset-top;
233+
margin-top: 0;
234+
margin-bottom: layout.$safe-navbar-height;
234235
}
235236
236237
footer {

src/components/common/navbar/NavbarSettingsDopdown.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const onSelect: DropdownProps['onSelect'] = async (key: string, { label }) => {
134134
const { dropdown } = NavbarService;
135135
const { floating, reverse } = useAppStateStoreRefs();
136136
const placement = computed(() => {
137-
if (reverse.value) return 'top-end';
137+
if (reverse.value) return 'top';
138138
if (floating.value) return 'bottom';
139139
return 'bottom-start';
140140
});
@@ -187,14 +187,16 @@ const placement = computed(() => {
187187
min-width: max(calc(100vw / var(--tab-count)), 8rem);
188188
max-width: 20rem;
189189
margin-top: 0.75rem;
190+
margin-right: -0.25rem;
190191
text-align: left;
191192
192193
&.floating {
193194
min-width: max(calc(var(--max-header-width) / var(--tab-count)), 8rem);
195+
margin-right: 0;
194196
}
195197
196198
&.reverse {
197-
margin-right: -1rem;
199+
margin-right: -0.5rem;
198200
}
199201
}
200202
</style>

src/components/container/ContainerComponent.ce.vue

+28-20
Original file line numberDiff line numberDiff line change
@@ -148,25 +148,29 @@ onBeforeMount(() => addCustomProgressProperty());
148148
layout.$navbar-transition-delay-visible}
149149
);
150150
151-
&:not(.reverse) {
152-
top: layout.$safe-navbar-height;
151+
top: layout.$safe-navbar-height;
153152
154-
&.drawer-visible {
155-
top: layout.$header-open-drawer-height;
156-
}
153+
&.drawer-visible {
154+
top: layout.$header-open-drawer-height;
155+
}
157156
158-
&.floating {
159-
top: layout.$floating-navbar-height;
157+
&.floating {
158+
top: layout.$floating-navbar-height;
160159
161-
&.drawer-visible {
162-
top: layout.$floating-open-drawer-height;
163-
}
160+
&.drawer-visible {
161+
top: layout.$floating-open-drawer-height;
164162
}
163+
}
165164
165+
&:not(.reverse, .floating) {
166166
&.dropdown-visible {
167167
right: max(calc(100vw / var(--tab-count)), 8rem);
168168
}
169169
}
170+
171+
&.reverse {
172+
top: 0.5rem;
173+
}
170174
}
171175
172176
.message-container.n-message-container.n-message-container {
@@ -179,21 +183,25 @@ onBeforeMount(() => addCustomProgressProperty());
179183
layout.$navbar-transition-delay-visible}
180184
);
181185
182-
&:not(.reverse) {
183-
top: calc(#{layout.$safe-navbar-height} + 12px);
186+
top: calc(#{layout.$safe-navbar-height} + 12px);
184187
185-
&.drawer-visible {
186-
top: calc(#{layout.$header-open-drawer-height} + 12px);
187-
}
188+
&.drawer-visible {
189+
top: calc(#{layout.$header-open-drawer-height} + 12px);
190+
}
188191
189-
&.floating {
190-
top: calc(#{layout.$floating-navbar-height} + 12px);
192+
&.floating {
193+
top: calc(#{layout.$floating-navbar-height} + 12px);
191194
192-
&.drawer-visible {
193-
top: calc(#{layout.$floating-open-drawer-height} + 12px);
194-
}
195+
&.drawer-visible {
196+
top: calc(#{layout.$floating-open-drawer-height} + 12px);
195197
}
198+
}
199+
200+
&.reverse {
201+
top: 0.5rem;
202+
}
196203
204+
&:not(.reverse, .floating) {
197205
&.dropdown-visible {
198206
right: max(calc(100vw / var(--tab-count)), 8rem);
199207
}

src/components/views/settings/SettingsComponent.vue

+18-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const onLeave = (section: Section) => {
103103
104104
const isCompact = watchMedia('(max-width: 600px)');
105105
106-
const { floating } = useAppStateStoreRefs();
106+
const { floating, reverse } = useAppStateStoreRefs();
107107
108108
onDeactivated(() => {
109109
target.value = undefined;
@@ -112,7 +112,7 @@ onDeactivated(() => {
112112
</script>
113113

114114
<template>
115-
<NLayout class="container" :class="{ floating }" has-sider>
115+
<NLayout class="container" :class="{ floating, reverse }" has-sider>
116116
<NLayoutSider
117117
class="menu"
118118
bordered
@@ -226,6 +226,22 @@ onDeactivated(() => {
226226
margin-top: layout.$safe-navbar-height;
227227
}
228228
229+
&.reverse {
230+
margin-top: 0;
231+
232+
.menu {
233+
margin-top: 0;
234+
}
235+
236+
.content {
237+
margin-bottom: layout.$header-navbar-height;
238+
239+
.card:first-child {
240+
margin-top: 0.5rem;
241+
}
242+
}
243+
}
244+
229245
&.floating {
230246
margin-top: calc(0% - #{layout.$safe-area-inset-top});
231247

src/styles/layout.scss

+1-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ $floating-open-drawer-height: calc(#{$floating-navbar-height} + #{$header-drawer
1919
$floating-content-height: $safe-full-height;
2020

2121
// Bottom Navbar
22-
$bottom-safe-navbar-height: calc(#{$header-navbar-height} + #{$safe-area-inset-bottom});
23-
$bottom-open-drawer-height: calc(#{$bottom-safe-navbar-height} + #{$header-drawer-height});
24-
$bottom-content-height: $safe-full-height;
22+
$bottom-content-height: calc(var(--full-height) - #{$header-navbar-height});
2523

2624
// Watching
2725
$watching-height: 1.75rem;

0 commit comments

Comments
 (0)