-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for loading CMS Pages from Magento
- Loading branch information
Showing
9 changed files
with
53 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@graphcommerce/magento-cms': patch | ||
--- | ||
|
||
Added support for loading CMS Pages from Magento |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
10 changes: 5 additions & 5 deletions
10
packages/magento-cms/CmsPageContent.tsx → ...ponents/CmsPageContent/CmsPageContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import { Container, Typography } from '@mui/material' | ||
import type { CmsPageContentFragment } from './CmsPageContent.gql' | ||
|
||
export type CmsPageContentProps = CmsPageContentFragment | ||
export type CmsPageContentProps = { cmsPage: CmsPageContentFragment } | ||
|
||
export function CmsPageContent(props: CmsPageContentProps) { | ||
const { content_heading, content } = props | ||
const { cmsPage } = props | ||
return ( | ||
<Container> | ||
{content_heading && ( | ||
{cmsPage.content_heading && ( | ||
<Typography variant='h2' component='h1'> | ||
{content_heading} | ||
{cmsPage.content_heading} | ||
</Typography> | ||
)} | ||
{/* eslint-disable-next-line react/no-danger */} | ||
{content && <div dangerouslySetInnerHTML={{ __html: content }} />} | ||
{cmsPage.content && <div dangerouslySetInnerHTML={{ __html: cmsPage.content }} />} | ||
</Container> | ||
) | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
query CmsPage($url: String!) { | ||
cmsPage(identifier: $url) { | ||
identifier | ||
...CmsPageMeta | ||
...CmsPageContent | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
export * from './CmsPageContent' | ||
export * from './CmsPageMeta' | ||
export * from './components/CmsPageContent/CmsPageContent' | ||
export * from './components/CmsPageContent/CmsPageContent.gql' | ||
export * from './components/CmsPageMeta/CmsPageMeta' | ||
export * from './components/CmsPageMeta/CmsPageMeta.gql' | ||
export * from './graphql/CmsPage.gql' |