Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix/update cms component with meta data #2159

Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
94b2776
Update cms.js to output Content Heading and page Title for CMS pages
luke-denton-aligent Feb 6, 2020
2a7a1c6
Merge remote-tracking branch 'upstream/develop' into fix/update_cms_c…
luke-denton-aligent Feb 10, 2020
4ca55e3
Move rendering of Title to only occur for RichContent
luke-denton-aligent Feb 10, 2020
3cdde75
Merge remote-tracking branch 'upstream/develop' into fix/update_cms_c…
luke-denton-aligent Feb 11, 2020
036a806
Run prettier over code
luke-denton-aligent Feb 11, 2020
319d7ac
Merge branch 'develop' into fix/update_cms_component_with_meta_data
luke-denton-aligent Feb 11, 2020
4e90804
Merge remote-tracking branch 'upstream/develop' into fix/update_cms_c…
luke-denton-aligent Feb 23, 2020
be7d4cb
Use return early strategy for when data doesn't exists in cms.js
luke-denton-aligent Feb 23, 2020
649b475
Destructure data.cmsPage properties for ease of readability
luke-denton-aligent Feb 23, 2020
5cb90c0
Extract heading element to a constant
luke-denton-aligent Feb 23, 2020
f940528
Replace shorthand Fragment with actual tags
luke-denton-aligent Feb 23, 2020
24e0ea3
Update cms.js to use CSS Modules
luke-denton-aligent Feb 23, 2020
363201e
Merge branch 'develop' into fix/update_cms_component_with_meta_data
luke-denton-aligent Apr 2, 2020
940021a
Merge branch 'develop' into fix/update_cms_component_with_meta_data
dpatil-magento Apr 7, 2020
20cca3d
Fix reference error and run prettier
tjwiebell Apr 7, 2020
c481fc4
Merge branch 'develop' into fix/update_cms_component_with_meta_data
dpatil-magento Apr 7, 2020
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
18 changes: 7 additions & 11 deletions packages/venia-ui/lib/RootComponents/CMS/cms.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { Fragment } from 'react';
import { shape, string } from 'prop-types';
import { number, shape, string } from 'prop-types';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks!

import { useQuery } from '@apollo/react-hooks';
import cmsPageQuery from '../../queries/getCmsPage.graphql';
import { fullPageLoadingIndicator } from '../../components/LoadingIndicator';
import RichContent from '../../components/RichContent';
import CategoryList from '../../components/CategoryList';
import { Meta, Title } from '../../components/Head';
import { mergeClasses } from "../../classify";
import { mergeClasses } from '../../classify';

import defaultClasses from './cms.css';

Expand Down Expand Up @@ -37,11 +37,10 @@ const CMSPage = props => {

const { content_heading, title } = data.cmsPage;

const headingElement = content_heading !== '' ? (
<h1 className={classes.heading}>
{content_heading}
</h1>
) : null;
const headingElement =
content_heading !== '' ? (
<h1 className={classes.heading}>{content_heading}</h1>
) : null;

let content;
// Only render <RichContent /> if the page isn't empty and doesn't contain the default CMS Page text.
Expand All @@ -63,10 +62,7 @@ const CMSPage = props => {

return (
<Fragment>
<Meta
name="description"
content={data.cmsPage.meta_description}
/>
<Meta name="description" content={data.cmsPage.meta_description} />
{content}
</Fragment>
);
Expand Down