From 55c6d29ff7f9ea3032f7ce562b2cdcd1ad770c14 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Thu, 31 Dec 2020 12:41:16 -0500 Subject: [PATCH] Working tests --- src/App.js | 7 ++++--- static/js/main.67033e8f.chunk.js | 2 -- static/js/main.67033e8f.chunk.js.map | 1 - static/loggedIn.tpl | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) delete mode 100644 static/js/main.67033e8f.chunk.js delete mode 100644 static/js/main.67033e8f.chunk.js.map diff --git a/src/App.js b/src/App.js index e66cc1b..045abab 100644 --- a/src/App.js +++ b/src/App.js @@ -61,8 +61,9 @@ class Card extends React.Component{ } function UserDetail(data, verification) { - data = data.data - verification = data.verification + data = data.data; + verification = data.verification; + console.log(data.verification); return (

{data.Nick !== null ? data.Nick : data.user.Username}

@@ -75,7 +76,7 @@ function UserDetail(data, verification) {

{data.user.id}

- ) + ); } class Pending extends React.Component { diff --git a/static/js/main.67033e8f.chunk.js b/static/js/main.67033e8f.chunk.js deleted file mode 100644 index 9714739..0000000 --- a/static/js/main.67033e8f.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this.webpackJsonpthanos=this.webpackJsonpthanos||[]).push([[0],{15:function(t,e,n){},16:function(t,e,n){},17:function(t,e,n){"use strict";n.r(e);var a=n(0),s=n(1),c=n.n(s),i=n(9),r=n.n(i),o=(n(15),n(8)),h=n(3),j=n(4),d=n(2),l=n(6),u=n(5),b=(n(16),function(t){Object(l.a)(n,t);var e=Object(u.a)(n);function n(t){var a;return Object(h.a)(this,n),(a=e.call(this,t)).state={data:{},details:{},expand:!1},a.state.data=t,a.state.details={},a.state.expand=!1,a.onClick=a.onClick.bind(Object(d.a)(a)),a}return Object(j.a)(n,[{key:"onClick",value:function(t){var e=this;fetch("https://thanos.nightmare.haus/api/user?userID=".concat(this.state.data.UserID)).then((function(t){return t.json()})).then((function(t){e.setState({data:e.state.data,expand:!e.state.expand,details:t})})).catch((function(t){return console.log(t)}))}},{key:"render",value:function(){return this.state.expand&&null!=this.state.details?Object(a.jsx)("div",{onClick:this.onClick,children:Object(a.jsx)(p,{data:this.state.details,verification:this.state.data.Photo})}):Object(a.jsxs)("div",{className:"card",onClick:this.onClick,children:[Object(a.jsx)("h4",{children:Object(a.jsxs)("b",{children:[this.state.data.Username,null==this.state.details?" (Invalid)":""]})}),Object(a.jsxs)("div",{className:"container",children:[Object(a.jsx)("p",{children:this.state.data.Closed}),Object(a.jsx)("p",{children:this.state.data.UserID}),Object(a.jsx)("p",{children:Object(a.jsx)("a",{href:this.state.data.Photo,children:"Verification Photo"})})]})]})}}]),n}(c.a.Component));function O(t){return Object(a.jsxs)("div",{className:"card-img",children:[Object(a.jsx)("h4",{children:Object(a.jsxs)("b",{children:["Pend: ",t.Username]})}),Object(a.jsx)("img",{src:void 0!==t.Photo?t.Photo:"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(a.jsx)("div",{className:"container",children:Object(a.jsx)("p",{children:t.UserID})})]})}function p(t,e){return e=(t=t.data).verification,Object(a.jsxs)("div",{className:"card-img",children:[Object(a.jsx)("h4",{children:Object(a.jsx)("b",{children:null!==t.Nick?t.Nick:t.user.Username})}),Object(a.jsx)("img",{src:void 0!==t.user.avatar?"https://cdn.discordapp.com/avatars/".concat(t.user.id,"/").concat(t.user.avatar,".png?size=64"):"https://thiscatdoesnotexist.com/",alt:"Avatar"}),Object(a.jsxs)("div",{className:"container",children:[Object(a.jsx)("img",{src:void 0!==e?e:"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(a.jsx)("p",{children:t.joined_at}),Object(a.jsx)("p",{children:t.user.id})]})]})}var v=function(t){Object(l.a)(n,t);var e=Object(u.a)(n);function n(){var t;Object(h.a)(this,n);for(var a=arguments.length,s=new Array(a),c=0;c res.json())\n .then(response => {\n this.setState({data: this.state.data, expand: !this.state.expand, details: response});\n })\n .catch(error => console.log(error));\n }\n render() {\n if (this.state.expand && this.state.details != null) {\n return (\n
\n \n
\n \n )\n }\n return (\n
\n

{this.state.data.Username}{this.state.details == null ? \" (Invalid)\" : \"\"}

\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(data, verification) {\n data = data.data\n verification = data.verification\n return (\n
\n

{data.Nick !== null ? data.Nick : data.user.Username}

\n \"Avatar\"\n \n
\n \n \"Avatar\"\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 aeca58a..8e3d708 100644 --- a/static/loggedIn.tpl +++ b/static/loggedIn.tpl @@ -3,6 +3,6 @@
- +
\ No newline at end of file