Skip to content

Commit

Permalink
fix: replace isIndex with isBasicLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrtsky committed Jun 12, 2023
1 parent 36d3c76 commit 9b37069
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
24 changes: 19 additions & 5 deletions components/app/AppFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const textLinks = computed(() => config.value?.footer?.textLinks || [])
const socialIconsCount = computed(() => Object.entries(config.value?.socials || {}).filter(([, v]) => v).length)
const nbSocialIcons = computed(() => (socialIcons.value ? socialIconsCount.value : 0))
const isIndex = computed(() => route.path === '/')
const isBasicLayout = computed(() => route.meta.layout === 'basic')
watch(isIndex, (value) => {
watch(isBasicLayout, (value) => {
updateAppConfig({
docus: {
footer: {
Expand All @@ -22,11 +22,25 @@ watch(isIndex, (value) => {

<template>
<footer>
<Container :fluid="config?.footer?.fluid" padded class="footer-layout">
<Container
:fluid="config?.footer?.fluid"
padded
class="footer-layout"
>
<!-- Left -->
<div class="left">
<a v-if="config?.footer?.credits" :href="config?.footer?.credits?.href || '#'" rel="noopener" target="_blank" class="footer-credits">
<Component :is="config?.footer?.credits?.icon" v-if="config?.footer?.credits?.icon" class="credits-icon" />
<a
v-if="config?.footer?.credits"
:href="config?.footer?.credits?.href || '#'"
rel="noopener"
target="_blank"
class="footer-credits"
>
<Component
:is="config?.footer?.credits?.icon"
v-if="config?.footer?.credits?.icon"
class="credits-icon"
/>
<p v-if="config?.footer?.credits?.text">{{ config.footer.credits.text }}</p>
</a>
</div>
Expand Down
8 changes: 4 additions & 4 deletions components/app/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const route = useRoute()
const hasDrawer = computed(() => navigation.value?.length > 1 || navigation.value?.[0]?.children?.length)
const isIndex = computed(() => route.path === '/')
const isBasicLayout = computed(() => route.meta.layout === 'basic')
watch(isIndex, (value) => {
watch(isBasicLayout, (value) => {
updateAppConfig({
docus: {
header: {
Expand All @@ -21,7 +21,7 @@ watch(isIndex, (value) => {
</script>

<template>
<header :class="{ 'has-drawer': hasDrawer, 'has-doc-search': hasDocSearch, 'is-index': isIndex, 'on-top': y === 0 }">
<header :class="{ 'has-drawer': hasDrawer, 'has-doc-search': hasDocSearch, 'is-basic-layout': isBasicLayout, 'on-top': y === 0 }">
<Container :fluid="config?.header?.fluid ">
<div class="header-layout">
<div class="section left">
Expand Down Expand Up @@ -87,7 +87,7 @@ css({
backgroundColor: '{docus.app.header.backgroundColor}',
height: '{docus.app.header.height}',
'&.is-index.on-top': {
'&.is-basic-layout.on-top': {
background: 'transparent',
borderColor: 'transparent',
backdropFilter: 'none',
Expand Down

0 comments on commit 9b37069

Please sign in to comment.