Added markdown pages for privacy policy and credits
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user