Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
263 changes: 167 additions & 96 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"react-dev-utils": "^6.1.1",
"react-dom": "^16.6.3",
"react-element-to-jsx-string": "^14.0.2",
"react-helmet-async": "^0.2.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@greg-a-smith does this need to be in regular dependencies or is dev deps ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like it could just live in dev dependencies.

"react-markdown": "^4.0.6",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
Expand Down
9 changes: 6 additions & 3 deletions src/_playground/App.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import './App.scss';
import '@babel/polyfill';
import { HelmetProvider } from 'react-helmet-async';
import { Routes } from './Routes';
import React, { Component } from 'react';

class App extends Component {
render() {
return (
<div className='frDocs-App'>
<Routes />
</div>
<HelmetProvider>
<div className='frDocs-App'>
<Routes />
</div>
</HelmetProvider>
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/_playground/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export class Routes extends Component {
<a
aria-label='Home'
className='frDocs-Menu__logo'
href='/'>
href='/home'>
Fundamental <span className='frDocs-Menu__logo--library'>React</span>
</a>
<span className='frDocs-Menu__spacer' />
Expand Down
1 change: 1 addition & 0 deletions src/_playground/documentation/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Readme from './README.md';
export const Home = () => {
return (
<MarkdownPage
description='Fundamental React Homepage'
sourceFile={Readme}
title='Home' />
);
Expand Down
3 changes: 2 additions & 1 deletion src/_playground/documentation/Template/ComponentPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import tocbot from 'tocbot';
import { Contents, Description, Header, Heading, Import, Properties, Separator } from '..';
import { Contents, Description, Header, Heading, Import, Properties, Separator, SetMeta } from '..';

class ComponentPage extends React.Component {
componentDidMount() {
Expand All @@ -26,6 +26,7 @@ class ComponentPage extends React.Component {

return (
<React.Fragment>
<SetMeta description={description} title={title} />
<Header>{title}</Header>
<Description>{description}</Description>
<Import sourceModulePath={sourceModulePath} />
Expand Down
3 changes: 2 additions & 1 deletion src/_playground/documentation/Template/MarkdownPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import MarkdownImporter from '../Markdown/MarkdownImporter';
import PropTypes from 'prop-types';
import React from 'react';
import tocbot from 'tocbot';
import { Contents, Description, Header, Heading, Separator } from '../';
import { Contents, Description, Header, Heading, Separator, SetMeta } from '../';

class MarkdownPage extends React.Component {
componentDidMount() {
Expand Down Expand Up @@ -31,6 +31,7 @@ class MarkdownPage extends React.Component {
// we will pass our own heading renderer so we can inject id values for the TOC
return (
<React.Fragment>
<SetMeta description={description} title={title} />
{title && <Header>{title}</Header>}
{description && <Description>{description}</Description>}
<Contents />
Expand Down
1 change: 1 addition & 0 deletions src/_playground/documentation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export { default as Properties } from './Properties/Properties';
export { default as Separator } from './Separator/Separator';
export { default as DocsText } from './DocsText/DocsText';
export { default as DocsTile } from './DocsTile/DocsTile';
export { default as SetMeta } from './utils/SetMeta';
19 changes: 19 additions & 0 deletions src/_playground/documentation/utils/SetMeta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Helmet from 'react-helmet-async';
import PropTypes from 'prop-types';
import React from 'react';

const SetMeta = ({ title, description }) => {
return (
<Helmet>
<title>{title}</title>
<meta content={description} name='description' />
</Helmet>
);
};

SetMeta.propTypes = {
description: PropTypes.string.isRequired,
title: PropTypes.string.isRequired
};

export default SetMeta;