Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default debug dialog for all CMS pages #2803

Merged
merged 1 commit into from
Jul 18, 2023
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
10 changes: 10 additions & 0 deletions apps/store/src/components/DebugDialog/DefaultDebugDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { DebugDialog } from '@/components/DebugDialog/DebugDialog'
import { DebugShopSessionSection } from '@/components/DebugDialog/DebugShopSessionSection'

export const DefaultDebugDialog = () => {
return (
<DebugDialog>
<DebugShopSessionSection />
</DebugDialog>
)
}
2 changes: 2 additions & 0 deletions apps/store/src/pages/[[...slug]].tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { StoryblokComponent, useStoryblokState } from '@storyblok/react'
import { type GetStaticPaths, type GetStaticProps, type NextPageWithLayout } from 'next'
import { DefaultDebugDialog } from '@/components/DebugDialog/DefaultDebugDialog'
import { HeadSeoInfo } from '@/components/HeadSeoInfo/HeadSeoInfo'
import { fetchBreadcrumbs } from '@/components/LayoutWithMenu/fetchBreadcrumbs'
import { getLayoutWithMenuProps } from '@/components/LayoutWithMenu/getLayoutWithMenuProps'
Expand Down Expand Up @@ -48,6 +49,7 @@ const NextStoryblokPage = (props: NextContentPageProps) => {
<BlogContext.Provider value={parseBlogContext(props)}>
<HeadSeoInfo story={abTestOriginStory || story} robots={robots} />
<StoryblokComponent blok={story.content} />
<DefaultDebugDialog />
</BlogContext.Provider>
)
}
Expand Down
2 changes: 2 additions & 0 deletions apps/store/src/pages/manypets/[[...slug]].tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { StoryblokComponent, useStoryblokState } from '@storyblok/react'
import { GetStaticPaths, GetStaticProps } from 'next'
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { DefaultDebugDialog } from '@/components/DebugDialog/DefaultDebugDialog'
import { HeadSeoInfo } from '@/components/HeadSeoInfo/HeadSeoInfo'
import { STORYBLOK_MANYPETS_FOLDER_SLUG } from '@/features/manyPets/manyPets.constants'
import { getStoryBySlug, PageStory, StoryblokQueryParams } from '@/services/storyblok/storyblok'
Expand All @@ -18,6 +19,7 @@ const ManyPetsCmsPage = ({ story: initialStory }: PageProps) => {
<>
<HeadSeoInfo story={story} />
<StoryblokComponent blok={story.content} />
<DefaultDebugDialog />
</>
)
}
Expand Down