diff --git a/public/content/patron_list.md b/public/content/patron_list.md new file mode 100644 index 0000000..9780ef4 --- /dev/null +++ b/public/content/patron_list.md @@ -0,0 +1,3 @@ +$5 +--- +* Seth Robinson \ No newline at end of file diff --git a/public/content/task_list.md b/public/content/task_list.md index 0724efd..8ad0c74 100644 --- a/public/content/task_list.md +++ b/public/content/task_list.md @@ -18,6 +18,7 @@ Patch --- * Game Balance. +* Images to social media instead of links. Wishlist --- diff --git a/src/components/app.jsx b/src/components/app.jsx index af1f96d..f8423cb 100644 --- a/src/components/app.jsx +++ b/src/components/app.jsx @@ -72,6 +72,7 @@ export default class App extends React.Component { import('./pages/equipment.jsx')} /> import('./pages/task_list.jsx')} /> + import('./pages/patron_list.jsx')} /> import('./pages/page_not_found.jsx')} /> diff --git a/src/components/pages/patron_list.jsx b/src/components/pages/patron_list.jsx new file mode 100644 index 0000000..b996194 --- /dev/null +++ b/src/components/pages/patron_list.jsx @@ -0,0 +1,69 @@ +import React from 'react'; +import ReactMarkdown from 'react-markdown/with-html'; + +//panels +import CommonLinks from '../panels/common_links.jsx'; + +class PatronList extends React.Component { + constructor(props) { + super(props); + this.state = { + data: '', + warning: '' + }; + + this.sendRequest('/content/patron_list.md'); + } + + render() { + let warningStyle = { + display: this.state.warning.length > 0 ? 'flex' : 'none' + }; + + return ( +
+
+
+ +
+ +
+
+

{this.state.warning}

+
+ +

My Patrons On Patreon

+

You can become a patron here.

+ {this.state ? :

Loading patron list...

} +
+
+
+ ); + } + + sendRequest(url, args = {}) { + //build the XHR + let xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + + xhr.onreadystatechange = () => { + if (xhr.readyState === 4) { + if (xhr.status === 200) { + //on success + this.setState({ data: xhr.responseText }); + } + else { + this.setWarning(xhr.responseText); + } + } + }; + + xhr.send(); + } + + setWarning(s) { + this.setState({ warning: s }); + } +}; + +export default PatronList; \ No newline at end of file diff --git a/src/components/panels/common_links.jsx b/src/components/panels/common_links.jsx index a2b935b..148baf3 100644 --- a/src/components/panels/common_links.jsx +++ b/src/components/panels/common_links.jsx @@ -35,6 +35,7 @@ class CommonLinks extends React.Component {

Combat Log

Change Password

Task List

+

Patron List

@@ -50,6 +51,7 @@ class CommonLinks extends React.Component {

Recover Password

Game Ladder

Task List

+

Patron List