Added markdown pages for privacy policy and credits

This commit is contained in:
2021-02-12 06:03:41 +11:00
parent 0b6c372c55
commit 1c456e70b6
9 changed files with 937 additions and 8 deletions
+2 -1
View File
@@ -1,9 +1,10 @@
import React from 'react';
import { Link } from 'react-router-dom';
const Footer = () => {
return (
<footer>
<p className='centered'>MERN template designed by Kayne Ruse, KR Game Studios</p>
<p className='centered'>MERN template designed by <a href='https://krgamestudios.com'>Kayne Ruse, KR Game Studios</a> - <Link to='/privacypolicy'>Privacy Policy</Link> - <Link to='/credits'>Credits</Link></p>
</footer>
);
};
+34
View File
@@ -0,0 +1,34 @@
import React, { useState, useEffect } from 'react';
import ReactMarkdown from 'react-markdown/with-html';
const Markdown = props => {
//content?
let [contentHook, setContentHook] = useState(null);
//check arguments
if (!props.content) {
if (!props.uri) {
throw 'Markdown requires either content or uri prop';
}
//once
useEffect(() => {
fetch(props.uri)
.then(blob => blob.text())
.then(blob => setContentHook(blob))
.catch(e => console.error(e))
;
}, []);
} else
//assume raw info
if (!contentHook) {
setContentHook(props.content);
}
return (
<ReactMarkdown escapeHtml={false} props={{...props}}>{contentHook}</ReactMarkdown>
);
};
export default Markdown;