-
Notifications
You must be signed in to change notification settings - Fork 63
Fix app layout issues #1257
Fix app layout issues #1257
Changes from 10 commits
c2fe971
3be1239
40b83b9
0c10b27
23b992f
b32edcf
03251a4
0cb7d57
087bea5
e34a05b
172d552
f85cf1e
cac0c0d
aa58a33
75a32d6
7d47472
843b6f4
0780ea1
6e205de
22f5917
5c5033b
4795035
0510040
8969bf6
d36dc66
bb77591
a14144f
2788ad0
3e37bfd
65b2300
64e2ec7
30bf3da
880f216
45cdde5
189beef
40d7614
dd28c44
fab148c
ca3198a
91094d2
2cb96db
c61aa76
3bb8f23
c0599cd
f0359e3
3221063
cf4044e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
<template> | ||
<div class="app grid h-screen overflow-hidden relative"> | ||
<div> | ||
<div class="app grid relative"> | ||
<div class="sticky top-0 block z-40"> | ||
<VTeleportTarget name="skip-to-content" :force-destroy="true" /> | ||
<VMigrationNotice v-show="isReferredFromCc" /> | ||
<VTranslationStatusBanner /> | ||
<VHeader /> | ||
</div> | ||
<main | ||
class="main embedded overflow-x-hidden" | ||
:class="{ 'has-sidebar': isSidebarVisible }" | ||
> | ||
<Nuxt ref="mainContentRef" class="min-w-0 main-page" /> | ||
<VSidebarTarget class="sidebar" /> | ||
<main class="main embedded" :class="{ 'has-sidebar': isSidebarVisible }"> | ||
<Nuxt class="min-w-0 main-page" /> | ||
<VSidebarTarget | ||
class="sidebar fixed pb-20 end-0 bg-dark-charcoal-06 border-s border-dark-charcoal-20 overflow-y-auto" | ||
zackkrida marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/> | ||
</main> | ||
<VModalTarget class="modal" /> | ||
<VGlobalAudioSection /> | ||
|
@@ -20,7 +19,7 @@ | |
<script> | ||
import { computed, provide, ref, watch } from '@nuxtjs/composition-api' | ||
|
||
import { useScroll } from '~/composables/use-scroll' | ||
import { useWindowScroll } from '~/composables/use-window-scroll' | ||
import { useMatchSearchRoutes } from '~/composables/use-match-routes' | ||
import { isMinScreen } from '~/composables/use-media-query' | ||
import { useFilterSidebarVisibility } from '~/composables/use-filter-sidebar-visibility' | ||
|
@@ -51,9 +50,6 @@ const embeddedPage = { | |
return this.$nuxtI18nHead({ addSeoAttributes: true, addDirAttribute: true }) | ||
}, | ||
setup() { | ||
const mainContentRef = ref(null) | ||
const mainRef = ref(null) | ||
|
||
const navStore = useNavStore() | ||
const isReferredFromCc = computed(() => navStore.isReferredFromCc) | ||
|
||
|
@@ -67,13 +63,12 @@ const embeddedPage = { | |
|
||
const isHeaderScrolled = ref(false) | ||
const scrollY = ref(0) | ||
const { isScrolled: isMainContentScrolled, y: mainContentY } = | ||
useScroll(mainContentRef) | ||
const { isScrolled: isMainContentScrolled, y: windowY } = useWindowScroll() | ||
watch([isMainContentScrolled], ([isMainContentScrolled]) => { | ||
isHeaderScrolled.value = isMainContentScrolled | ||
}) | ||
watch([mainContentY], ([mainContentY]) => { | ||
scrollY.value = mainContentY | ||
watch([windowY], ([windowY]) => { | ||
scrollY.value = windowY | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These can probably be |
||
}) | ||
const showScrollButton = computed(() => scrollY.value > 70) | ||
|
||
|
@@ -92,14 +87,20 @@ const embeddedPage = { | |
isSidebarVisible, | ||
isSearchRoute, | ||
headerHasTwoRows, | ||
mainContentRef, | ||
mainRef, | ||
} | ||
}, | ||
} | ||
export default embeddedPage | ||
</script> | ||
|
||
<style scoped> | ||
.sidebar { | ||
obulat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
height: calc(100vh - var(--header-height, 81px)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: while the variable fallback is nice, it could be a little confusing for someone reading this for the first time to discover that the variable isn't actually defined anywhere. My vote would be to either ditch the variable, given it's only used in a single place, or to define the variable in the base layout like is done for the filter sidebar width. I think I prefer the second as it's nice to not have a random "magic" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Considering that the header height can vary based on the scrolled/non-scrolled status (which I remembered very late in the process of reviewing, sorry!), I think we should define There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be good to define in CSS and update it in JS (otherwise it'll cause more jumpiness 🙁) |
||
} | ||
.has-sidebar .sidebar { | ||
width: 325px; | ||
zackkrida marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
.app { | ||
grid-template-rows: auto 1fr; | ||
} | ||
|
@@ -111,7 +112,6 @@ export default embeddedPage | |
display: grid; | ||
grid-template-columns: 1fr 336px; | ||
} | ||
|
||
/** Make the main content area span both grid columns when the sidebar is closed... **/ | ||
.main > *:first-child { | ||
grid-column: span 2; | ||
|
@@ -121,12 +121,4 @@ export default embeddedPage | |
grid-column: 1; | ||
} | ||
} | ||
|
||
.main { | ||
overflow: hidden; | ||
} | ||
.main > *:not(:empty) { | ||
overflow-y: scroll; | ||
height: 100%; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Styles specific to the search filter sidebar have been moved up in the component tree.