Skip to content

Commit

Permalink
Merge pull request #50 from nuxt-themes/feat/improve-readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Flosciante authored Aug 3, 2022
2 parents d26aa77 + 1e4b5e7 commit c9db88e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions components/AppLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ defineProps({
</script>

<template>
<div class="px-4 sm:px-0 max-w-sm mx-auto md:max-w-2xl lg:max-w-4xl">
<div class="max-w-sm px-4 mx-auto sm:px-0 md:max-w-2xl lg:max-w-4xl">
<AppLoadingBar />
<Header />
<Header v-if="$theme.value.header" />
<slot />
<Footer v-if="$theme.value.footer" />
</div>
Expand Down
3 changes: 2 additions & 1 deletion components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const placeItems = computed(() => {
})
const rowsNumber = computed(() => {
return [theme.value.footer.navigation, theme.value.footer.title, theme.value.footer.socials, theme.value.footer.socials?.message.length].reduce((acc, val) => {
const footer = theme.value.footer
return [footer.navigation, footer.title, footer.socials, footer.socials?.message.length].reduce((acc, val) => {
return acc + (val ? 1 : 0)
}, 0)
})
Expand Down
9 changes: 1 addition & 8 deletions components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
const { navigation } = useContent()
const theme = useTheme()
const hasHeader = computed(() => {
return theme.value.header
})
const placeItems = computed(() => {
switch (theme.value.header.position) {
case 'left':
Expand All @@ -21,10 +17,7 @@ const placeItems = computed(() => {
</script>

<template>
<header
v-if="hasHeader"
class="relative"
>
<header class="relative">
<ColorModeSwitch class="absolute top-6 md:top-8" :class="{'right-0' : theme.header.position === 'left'}" />
<div
class="grid h-32 grid-cols-1 grid-rows-2 py-6 mb-6 md:h-36 md:py-8 md:mb-8"
Expand Down

0 comments on commit c9db88e

Please sign in to comment.