doc.silverstripe.org/src/components/DocsPage.tsx
Aaron Carlino 8ffc3eeb5b
WIP: Add userhelp to new site (#216)
* Docs/userguide switching

* Initial commit of userdocs merge

* Remove service worker, fix rendering

* Remove limited sources

* UX improvements per Paul design

* Tweak version select for FF

* Fix mobile view

* Final tweaks to UI

* Tweaks to search bar, clean up conflicts

* Fix icons

* Hide search if no API key
2019-12-19 11:54:23 +13:00

34 lines
855 B
TypeScript

import React, { StatelessComponent } from 'react';
import SEO from './SEO';
import parseHTML from '../utils/parseHTML';
interface DocsPageProps {
title: string;
html: string;
relPath: string;
branch: string;
gitURL: string;
};
const DocsPage: StatelessComponent<DocsPageProps> = ({ title, html, branch, relPath, gitURL }): ReactElement => {
const editLink = `${gitURL.replace(/\.git$/, '')}/edit/${branch}/${relPath}`;
return (
<>
<SEO title={title} />
{parseHTML(html)}
{editLink &&
<div className="github-edit">
<a target="_blank" href={editLink} title="Edit on Github">
<i className="fas fa-pen fa-fw" />{` `}
Edit on Github
</a>
</div>
}
</>
);
};
export default DocsPage;