mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-09-30 05:09:21 +02:00
8ffc3eeb5b
* 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
34 lines
855 B
TypeScript
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; |