Working on the card tables

This commit is contained in:
2018-12-08 22:43:15 +11:00
parent 62e6d31692
commit 057fa7697d
9 changed files with 400 additions and 8 deletions
+22 -1
View File
@@ -1,14 +1,35 @@
import React from "react";
import ReactMarkdown from "react-markdown";
class Rules extends React.Component {
constructor(props) {
super(props);
this.state = {
body: "Loading..."
};
}
componentDidMount() {
fetch("/content/rules.md")
.then(result => result.text())
.then((result) => {
this.setState({
body: result
});
},
//handle errors here instead of a catch block because internet said so
(error) => {
this.setState({
body: error
});
});
}
render() {
return (
<div>
<p>Rules</p>
<ReactMarkdown source={this.state.body} escapeHtml={false} />
</div>
);
}