Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/mighty-pans-stick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/magento-storyblok': patch
---

Fixed empty footer on blog pages
4 changes: 3 additions & 1 deletion examples/magento-storyblok/pages/blog/[...url].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { BlogList, LayoutDocument, LayoutNavigation } from '../../components'
import type { LayoutNavigationProps } from '../../components'
import { RowRenderer } from '../../components/Storyblok/RowRenderer'
import { graphqlSharedClient, graphqlSsrClient } from '../../lib/graphql/graphqlSsrClient'
import { useStoryblokState } from '../../lib/storyblok'
import { fetchGlobalConfig, useStoryblokState } from '../../lib/storyblok'

type Props = { story: StoryblokStory | null; related: StoryblokStory[] }
type RouteProps = { url: string[] }
Expand Down Expand Up @@ -140,6 +140,7 @@ export const getStaticProps: GetPageStaticProps = async (context) => {
fetchPolicy: cacheFirst(staticClient),
})

const globalConfig = fetchGlobalConfig(context)
const storyPage = fetchStory(slug, context, staticClient)
const related = fetchStories({
starts_with: 'blog/',
Expand All @@ -156,6 +157,7 @@ export const getStaticProps: GetPageStaticProps = async (context) => {
story,
related: (await related).stories,
...(await layout).data,
globalConfig: (await globalConfig)?.content ?? null,
up: { href: '/blog', title: t`Blog` },
apolloState: await conf.then(() => client.cache.extract()),
},
Expand Down
4 changes: 3 additions & 1 deletion examples/magento-storyblok/pages/blog/page/[page].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { BlogList, LayoutDocument, LayoutNavigation } from '../../../components'
import type { LayoutNavigationProps } from '../../../components'
import { RowRenderer } from '../../../components/Storyblok/RowRenderer'
import { graphqlSharedClient, graphqlSsrClient } from '../../../lib/graphql/graphqlSsrClient'
import { useStoryblokState } from '../../../lib/storyblok'
import { fetchGlobalConfig, useStoryblokState } from '../../../lib/storyblok'

type Props = {
story: StoryblokStory | null
Expand Down Expand Up @@ -116,6 +116,7 @@ export const getStaticProps: GetPageStaticProps = async (context) => {
fetchPolicy: cacheFirst(staticClient),
})

const globalConfig = fetchGlobalConfig(context)
const landingStory = fetchStory('blog', context, staticClient)
const blogList = fetchStories({
starts_with: 'blog/',
Expand All @@ -136,6 +137,7 @@ export const getStaticProps: GetPageStaticProps = async (context) => {
total,
perPage,
...(await layout).data,
globalConfig: (await globalConfig)?.content ?? null,
apolloState: await conf.then(() => client.cache.extract()),
},
revalidate: revalidate(),
Expand Down
3 changes: 3 additions & 0 deletions examples/magento-storyblok/pages/blog/tagged/[url].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type { GetStaticPaths } from 'next'
import { BlogList, LayoutDocument, LayoutNavigation } from '../../../components'
import type { LayoutNavigationProps } from '../../../components'
import { graphqlSharedClient, graphqlSsrClient } from '../../../lib/graphql/graphqlSsrClient'
import { fetchGlobalConfig } from '../../../lib/storyblok'

type Props = { tag: string; stories: StoryblokStory[] }
type RouteProps = { url: string }
Expand Down Expand Up @@ -98,6 +99,7 @@ export const getStaticProps: GetPageStaticProps = async (context) => {
fetchPolicy: cacheFirst(staticClient),
})

const globalConfig = fetchGlobalConfig(context)
const stories = await fetchAllStories({
starts_with: 'blog/',
excluding_slugs: 'blog/,blog/tagged/*',
Expand All @@ -113,6 +115,7 @@ export const getStaticProps: GetPageStaticProps = async (context) => {
tag,
stories,
...(await layout).data,
globalConfig: (await globalConfig)?.content ?? null,
up: { href: '/blog', title: t`Blog` },
apolloState: await conf.then(() => client.cache.extract()),
},
Expand Down
Loading