diff --git a/src/App.js b/static/App.js similarity index 87% rename from src/App.js rename to static/App.js index 6551f43..f90261d 100644 --- a/src/App.js +++ b/static/App.js @@ -4,20 +4,17 @@ import './App.css'; class Card extends React.Component{ state = { - data: [] + data: {} } constructor(props) { super(props); - this.setState({data: props}); + this.state.data = props; } render() { return ( -
+

{this.state.data.Username}

{this.state.data.Closed}

@@ -32,7 +29,7 @@ class Card extends React.Component{ function CardImg(data) { return (
-

{data.Username}

+

Pend: {data.Username}

Avatar

{data.UserID}

@@ -40,7 +37,7 @@ class Card extends React.Component{
) } - +/* function UserDetail(userID, verification) { const [data, setData] = useState([]); useEffect(() => { @@ -67,7 +64,7 @@ function UserDetail(userID, verification) {
) } - +*/ class Pending extends React.Component { state = { pending: [] @@ -76,16 +73,17 @@ class Pending extends React.Component { const apiUrl = 'https://thanos.nightmare.haus/api/pending'; fetch(apiUrl) .then((response) => response.json()) - .then((data) => this.setState({pending: data})); + .then((data) => this.setState({pending: Object.values(data)})); } render() { return (
    - {this.state.pending.map((data) => ( -
  • + {this.state.pending.map((data, i) => ( +
  • ))}
+

); } @@ -107,6 +105,7 @@ class Verification extends React.Component { render() { return (
+
    {this.state.verifications.map((data, i) => (
  • diff --git a/static/header.tpl b/static/header.tpl index 84116fb..45a343c 100644 --- a/static/header.tpl +++ b/static/header.tpl @@ -9,7 +9,7 @@ - + diff --git a/static/js/2.23e2242b.chunk.js b/static/js/2.23e2242b.chunk.js new file mode 100644 index 0000000..d76b33d --- /dev/null +++ b/static/js/2.23e2242b.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.23e2242b.chunk.js.LICENSE.txt */ +(this.webpackJsonpthanos=this.webpackJsonpthanos||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(9)},function(e,t,n){"use strict";e.exports=n(10)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n
\n );\n}\n}\n\n function CardImg(data) {\n return (\n
\n

{data.Username}

\n \"Avatar\"\n
\n

{data.UserID}

\n
\n
\n )\n }\n\nfunction UserDetail(userID, verification) {\n const [data, setData] = useState([]);\n useEffect(() => {\n fetch(\n `https://thanos.nightmare.haus/api/user?userID=${userID}`\n )\n .then(res => res.json())\n .then(response => {\n setData(response);\n })\n .catch(error => console.log(error));\n });\n\n return (\n
\n

{data.Nick}

\n \"Avatar\"\n
\n \"Avatar\"\n \n

{data.joined_at}

\n

{data.user.id}

\n
\n
\n )\n}\n\nclass Pending extends React.Component {\n state = {\n pending: []\n }\n componentDidMount() {\n const apiUrl = 'https://thanos.nightmare.haus/api/pending';\n fetch(apiUrl)\n .then((response) => response.json())\n .then((data) => this.setState({pending: data}));\n }\n render() {\n return (\n
\n
    \n {this.state.pending.map((data) => (\n
  • \n ))}\n
\n
\n );\n }\n}\n\n\n\nclass Verification extends React.Component {\n state = {\n verifications: []\n }\n componentDidMount() {\n const apiUrl = 'https://thanos.nightmare.haus/api/verifications';\n fetch(apiUrl)\n .then((response) => response.json())\n .then((data) => this.setState({verifications: data}));\n }\n\n render() {\n return (\n
\n
    \n {this.state.verifications.map((data, i) => (\n
  • \n ))}\n
\n
\n );\n }\n}\n\nexport {\n Pending,\n Verification,\n}\n\nexport default Verification;","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport Verification from './App';\nimport Pending from './App';\n\nReactDOM.render(\n \n \n \n ,\n document.getElementById('react_app')\n);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/js/main.bf43163b.chunk.js b/static/js/main.bf43163b.chunk.js new file mode 100644 index 0000000..878f6b6 --- /dev/null +++ b/static/js/main.bf43163b.chunk.js @@ -0,0 +1,2 @@ +(this.webpackJsonpthanos=this.webpackJsonpthanos||[]).push([[0],{14:function(t,e,n){},15:function(t,e,n){},16:function(t,e,n){"use strict";n.r(e);var c=n(0),a=n(1),s=n.n(a),r=n(8),i=n.n(r),j=(n(14),n(7)),o=n(2),h=n(3),d=n(5),u=n(4),l=(n(15),function(t){Object(d.a)(n,t);var e=Object(u.a)(n);function n(t){var c;return Object(o.a)(this,n),(c=e.call(this,t)).state={data:{}},c.state.data=t,c}return Object(h.a)(n,[{key:"render",value:function(){return Object(c.jsxs)("div",{className:"card",children:[Object(c.jsx)("h4",{children:Object(c.jsx)("b",{children:this.state.data.Username})}),Object(c.jsxs)("div",{className:"container",children:[Object(c.jsx)("p",{children:this.state.data.Closed}),Object(c.jsx)("p",{children:this.state.data.UserID}),Object(c.jsx)("p",{children:Object(c.jsx)("a",{href:this.state.data.Photo,children:"Verification Photo"})})]})]})}}]),n}(s.a.Component));function b(t){return Object(c.jsxs)("div",{className:"card-img",children:[Object(c.jsx)("h4",{children:Object(c.jsxs)("b",{children:["Pend: ",t.Username]})}),Object(c.jsx)("img",{src:void 0!==t.Photo?t.Photo:"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(c.jsx)("div",{className:"container",children:Object(c.jsx)("p",{children:t.UserID})})]})}var O=function(t){Object(d.a)(n,t);var e=Object(u.a)(n);function n(){var t;Object(o.a)(this,n);for(var c=arguments.length,a=new Array(c),s=0;s\n

{this.state.data.Username}

\n
\n

{this.state.data.Closed}

\n

{this.state.data.UserID}

\n

Verification Photo

\n
\n
\n );\n}\n}\n\n function CardImg(data) {\n return (\n
\n

Pend: {data.Username}

\n \"Avatar\"\n
\n

{data.UserID}

\n
\n
\n )\n }\n/*\nfunction UserDetail(userID, verification) {\n const [data, setData] = useState([]);\n useEffect(() => {\n fetch(\n `https://thanos.nightmare.haus/api/user?userID=${userID}`\n )\n .then(res => res.json())\n .then(response => {\n setData(response);\n })\n .catch(error => console.log(error));\n });\n\n return (\n
\n

{data.Nick}

\n \"Avatar\"\n
\n \"Avatar\"\n \n

{data.joined_at}

\n

{data.user.id}

\n
\n
\n )\n}\n*/\nclass Pending extends React.Component {\n state = {\n pending: []\n }\n componentDidMount() {\n const apiUrl = 'https://thanos.nightmare.haus/api/pending';\n fetch(apiUrl)\n .then((response) => response.json())\n .then((data) => this.setState({pending: Object.values(data)}));\n }\n render() {\n return (\n
\n
    \n {this.state.pending.map((data, i) => (\n
  • \n ))}\n
\n

\n
\n );\n }\n}\n\n\n\nclass Verification extends React.Component {\n state = {\n verifications: []\n }\n componentDidMount() {\n const apiUrl = 'https://thanos.nightmare.haus/api/verifications';\n fetch(apiUrl)\n .then((response) => response.json())\n .then((data) => this.setState({verifications: data}));\n }\n\n render() {\n return (\n
\n \n
    \n {this.state.verifications.map((data, i) => (\n
  • \n ))}\n
\n
\n );\n }\n}\n\nexport {\n Pending,\n Verification,\n}\n\nexport default Verification;","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport Verification from './App';\nimport Pending from './App';\n\nReactDOM.render(\n \n \n \n ,\n document.getElementById('react_app')\n);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/loggedIn.tpl b/static/loggedIn.tpl index 17489dc..fb6e42d 100644 --- a/static/loggedIn.tpl +++ b/static/loggedIn.tpl @@ -1,8 +1,6 @@

-
- - - -
\ No newline at end of file + + +