Browse Source

Updates with React and modal attempt

hkremer/rebranding
Gregory Rudolph 3 years ago
parent
commit
79aa40c476
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 35112
      package-lock.json
  2. 1
      package.json
  3. 67
      src/App.js
  4. 2
      static/header.tpl
  5. 3
      static/js/2.4d5fc99e.chunk.js
  6. 0
      static/js/2.4d5fc99e.chunk.js.LICENSE.txt
  7. 1
      static/js/2.4d5fc99e.chunk.js.map
  8. 3
      static/js/2.f311d910.chunk.js
  9. 1
      static/js/2.f311d910.chunk.js.map
  10. 2
      static/js/main.9753ddf0.chunk.js
  11. 1
      static/js/main.9753ddf0.chunk.js.map
  12. 2
      static/js/main.98705200.chunk.js
  13. 1
      static/js/main.98705200.chunk.js.map
  14. 11
      static/loggedIn.tpl
  15. 3059
      yarn.lock

35112
package-lock.json generated

File diff suppressed because it is too large Load Diff

1
package.json

@ -31,7 +31,6 @@ @@ -31,7 +31,6 @@
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}

67
src/app.js → src/App.js

@ -1,18 +1,34 @@ @@ -1,18 +1,34 @@
import React from 'react';
import React, { useState, useEffect } from "react";
import './App.css';
function Card(data) {
class Card extends React.Component{
state = {
data: []
}
constructor(props) {
super(props);
this.setState({data: props});
}
render() {
return (
<div className="card">
<h4><b>{data.Username}</b></h4>
<div className="card" onClick={UserDetail(
this.state.data.UserID,
this.state.data.Photo,
)}>
<h4><b>{this.state.data.Username}</b></h4>
<div className="container">
<p>{data.Closed}</p>
<p>{data.UserID}</p>
<p><a href={data.Photo}>Verification Photo</a></p>
<p>{this.state.data.Closed}</p>
<p>{this.state.data.UserID}</p>
<p><a href={this.state.data.Photo}>Verification Photo</a></p>
</div>
</div>
)
}
);
}
}
function CardImg(data) {
return (
<div className="card-img">
@ -25,6 +41,33 @@ function Card(data) { @@ -25,6 +41,33 @@ function Card(data) {
)
}
function UserDetail(userID, verification) {
const [data, setData] = useState([]);
useEffect(() => {
fetch(
`https://thanos.nightmare.haus/api/user?userID=${userID}`
)
.then(res => res.json())
.then(response => {
setData(response);
})
.catch(error => console.log(error));
});
return (
<div className="card">
<h4><b>{data.Nick}</b></h4>
<img src={verification !== undefined ? verification : "https://thiscatdoesnotexist.com/"} alt="Avatar" style={{ width: "100%" }} />
<div className="container">
<img src={data.user.avatar !== undefined ? `https://cdn.discordapp.com/avatars/${userID}/${data.user.avatar}.png` : "https://thiscatdoesnotexist.com/"} alt="Avatar" style={{ width: "100%" }} />
<p>{data.joined_at}</p>
<p>{data.user.id}</p>
</div>
</div>
)
}
class Pending extends React.Component {
state = {
pending: []
@ -40,9 +83,7 @@ class Pending extends React.Component { @@ -40,9 +83,7 @@ class Pending extends React.Component {
<div className="App">
<ul>
{this.state.pending.map((data) => (
data.map((actualData) => (
<li key={actualData.UserID}> <CardImg {...actualData} /></li>
))
<li key={Object.keys(data)}> <CardImg {...Object.values(data)} /></li>
))}
</ul>
</div>
@ -51,6 +92,7 @@ class Pending extends React.Component { @@ -51,6 +92,7 @@ class Pending extends React.Component {
}
class Verification extends React.Component {
state = {
verifications: []
@ -61,6 +103,7 @@ class Verification extends React.Component { @@ -61,6 +103,7 @@ class Verification extends React.Component {
.then((response) => response.json())
.then((data) => this.setState({verifications: data}));
}
render() {
return (
<div className="App">

2
static/header.tpl

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<link href="/static/css/main.5c7015b9.chunk.css" rel="stylesheet">
<link href="/static/css/main.5c7015b9.chunk.css" rel="stylesheet">

3
static/js/2.4d5fc99e.chunk.js

File diff suppressed because one or more lines are too long

0
static/js/2.f311d910.chunk.js.LICENSE.txt → static/js/2.4d5fc99e.chunk.js.LICENSE.txt

1
static/js/2.4d5fc99e.chunk.js.map

File diff suppressed because one or more lines are too long

3
static/js/2.f311d910.chunk.js

File diff suppressed because one or more lines are too long

1
static/js/2.f311d910.chunk.js.map

File diff suppressed because one or more lines are too long

2
static/js/main.9753ddf0.chunk.js

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
(this.webpackJsonpthanos=this.webpackJsonpthanos||[]).push([[0],{15:function(t,e,c){},16:function(t,e,c){},17:function(t,e,c){"use strict";c.r(e);var n=c(0),a=c(1),s=c.n(a),i=c(8),r=c.n(i),o=(c(15),c(7)),h=c(9),j=c(2),d=c(3),l=c(5),u=c(4),b=(c(16),function(t){Object(l.a)(c,t);var e=Object(u.a)(c);function c(t){var n;return Object(j.a)(this,c),(n=e.call(this,t)).state={data:[]},n.setState({data:t}),n}return Object(d.a)(c,[{key:"render",value:function(){return Object(n.jsxs)("div",{className:"card",onClick:p(this.state.data.UserID,this.state.data.Photo),children:[Object(n.jsx)("h4",{children:Object(n.jsx)("b",{children:this.state.data.Username})}),Object(n.jsxs)("div",{className:"container",children:[Object(n.jsx)("p",{children:this.state.data.Closed}),Object(n.jsx)("p",{children:this.state.data.UserID}),Object(n.jsx)("p",{children:Object(n.jsx)("a",{href:this.state.data.Photo,children:"Verification Photo"})})]})]})}}]),c}(s.a.Component));function O(t){return Object(n.jsxs)("div",{className:"card-img",children:[Object(n.jsx)("h4",{children:Object(n.jsx)("b",{children:t.Username})}),Object(n.jsx)("img",{src:void 0!==t.Photo?t.Photo:"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(n.jsx)("div",{className:"container",children:Object(n.jsx)("p",{children:t.UserID})})]})}function p(t,e){var c=Object(a.useState)([]),s=Object(h.a)(c,2),i=s[0],r=s[1];return Object(a.useEffect)((function(){fetch("https://thanos.nightmare.haus/api/user?userID=".concat(t)).then((function(t){return t.json()})).then((function(t){r(t)})).catch((function(t){return console.log(t)}))})),Object(n.jsxs)("div",{className:"card",children:[Object(n.jsx)("h4",{children:Object(n.jsx)("b",{children:i.Nick})}),Object(n.jsx)("img",{src:void 0!==e?e:"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(n.jsxs)("div",{className:"container",children:[Object(n.jsx)("img",{src:void 0!==i.user.avatar?"https://cdn.discordapp.com/avatars/".concat(t,"/").concat(i.user.avatar,".png"):"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(n.jsx)("p",{children:i.joined_at}),Object(n.jsx)("p",{children:i.user.id})]})]})}s.a.Component;var v=function(t){Object(l.a)(c,t);var e=Object(u.a)(c);function c(){var t;Object(j.a)(this,c);for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return(t=e.call.apply(e,[this].concat(a))).state={verifications:[]},t}return Object(d.a)(c,[{key:"componentDidMount",value:function(){var t=this;fetch("https://thanos.nightmare.haus/api/verifications").then((function(t){return t.json()})).then((function(e){return t.setState({verifications:e})}))}},{key:"render",value:function(){return Object(n.jsx)("div",{className:"App",children:Object(n.jsx)("ul",{children:this.state.verifications.map((function(t,e){return Object(n.jsxs)("li",{children:[" ",Object(n.jsx)(b,Object(o.a)({},t))]},e)}))})})}}]),c}(s.a.Component);r.a.render(Object(n.jsxs)(s.a.StrictMode,{children:[Object(n.jsx)(v,{}),Object(n.jsx)(v,{})]}),document.getElementById("react_app"))}},[[17,1,2]]]);
//# sourceMappingURL=main.9753ddf0.chunk.js.map

1
static/js/main.9753ddf0.chunk.js.map

File diff suppressed because one or more lines are too long

2
static/js/main.98705200.chunk.js

@ -1,2 +0,0 @@ @@ -1,2 +0,0 @@
(this.webpackJsonpthanos=this.webpackJsonpthanos||[]).push([[0],{14:function(e,t,n){},15:function(e,t,n){},16:function(e,t,n){"use strict";n.r(t);var c=n(0),s=n(1),i=n.n(s),r=n(8),a=n.n(r),o=(n(14),n(6)),j=n(3),h=n(4),d=n(7),l=n(5);n(15);function b(e){return Object(c.jsxs)("div",{className:"card",children:[Object(c.jsx)("h4",{children:Object(c.jsx)("b",{children:e.Username})}),Object(c.jsxs)("div",{className:"container",children:[Object(c.jsx)("p",{children:e.Closed}),Object(c.jsx)("p",{children:e.UserID}),Object(c.jsx)("p",{children:Object(c.jsx)("a",{href:e.Photo,children:"Verification Photo"})})]})]})}function u(e){return Object(c.jsxs)("div",{className:"card-img",children:[Object(c.jsx)("h4",{children:Object(c.jsx)("b",{children:e.Username})}),Object(c.jsx)("img",{src:void 0!==e.Photo?e.Photo:"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(c.jsx)("div",{className:"container",children:Object(c.jsx)("p",{children:e.UserID})})]})}i.a.Component;var O=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(){var e;Object(j.a)(this,n);for(var c=arguments.length,s=new Array(c),i=0;i<c;i++)s[i]=arguments[i];return(e=t.call.apply(t,[this].concat(s))).state={verifications:[]},e}return Object(h.a)(n,[{key:"componentDidMount",value:function(){var e=this;fetch("https://thanos.nightmare.haus/api/verifications").then((function(e){return e.json()})).then((function(t){return e.setState({verifications:t})}))}},{key:"render",value:function(){return Object(c.jsx)("div",{className:"App",children:Object(c.jsx)("ul",{children:this.state.verifications.map((function(e,t){return Object(c.jsxs)("li",{children:[" ",Object(c.jsx)(b,Object(o.a)({},e))]},t)}))})})}}]),n}(i.a.Component);a.a.render(Object(c.jsxs)(i.a.StrictMode,{children:[Object(c.jsx)(O,{}),Object(c.jsx)(O,{})]}),document.getElementById("react_app"))}},[[16,1,2]]]);
//# sourceMappingURL=main.98705200.chunk.js.map

1
static/js/main.98705200.chunk.js.map

@ -1 +0,0 @@ @@ -1 +0,0 @@
{"version":3,"sources":["App.js","index.js"],"names":["Card","data","className","Username","Closed","UserID","href","Photo","CardImg","src","undefined","alt","style","width","React","Component","Verification","state","verifications","fetch","then","response","json","setState","this","map","i","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"8OAGA,SAASA,EAAKC,GACV,OACE,sBAAKC,UAAU,OAAf,UACA,6BAAI,4BAAID,EAAKE,aACX,sBAAKD,UAAU,YAAf,UACE,4BAAID,EAAKG,SACT,4BAAIH,EAAKI,SACT,4BAAG,mBAAGC,KAAML,EAAKM,MAAd,wCAKX,SAASC,EAAQP,GACf,OACE,sBAAKC,UAAU,WAAf,UACA,6BAAI,4BAAID,EAAKE,aACb,qBAAKM,SAAoBC,IAAfT,EAAKM,MAAsBN,EAAKM,MAAQ,mCAAoCI,IAAI,SAASC,MAAO,CAAEC,MAAO,UACjH,qBAAKX,UAAU,YAAf,SACE,4BAAID,EAAKI,cAMGS,IAAMC,U,IAsDbC,E,4MA3BXC,MAAQ,CACJC,cAAe,I,kEAEE,IAAD,OAEhBC,MADe,mDAEVC,MAAK,SAACC,GAAD,OAAcA,EAASC,UAC5BF,MAAK,SAACnB,GAAD,OAAU,EAAKsB,SAAS,CAACL,cAAejB,S,+BAGlD,OACG,qBAAKC,UAAU,MAAf,SACI,6BACKsB,KAAKP,MAAMC,cAAcO,KAAI,SAACxB,EAAMyB,GAAP,OAC1B,mCAAa,cAAC1B,EAAD,eAAUC,MAAdyB,c,GAfLZ,IAAMC,WC/CjCY,IAASC,OACP,eAAC,IAAMC,WAAP,WACE,cAAC,EAAD,IACA,cAAC,EAAD,OAEFC,SAASC,eAAe,gB","file":"static/js/main.98705200.chunk.js","sourcesContent":["import React from 'react';\nimport './App.css';\n\nfunction Card(data) {\n return (\n <div className=\"card\">\n <h4><b>{data.Username}</b></h4>\n <div className=\"container\">\n <p>{data.Closed}</p>\n <p>{data.UserID}</p>\n <p><a href={data.Photo}>Verification Photo</a></p>\n </div>\n </div>\n )\n }\n function CardImg(data) {\n return (\n <div className=\"card-img\">\n <h4><b>{data.Username}</b></h4>\n <img src={data.Photo !== undefined ? data.Photo : \"https://thiscatdoesnotexist.com/\"} alt=\"Avatar\" style={{ width: \"100%\" }} />\n <div className=\"container\">\n <p>{data.UserID}</p>\n </div>\n </div>\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 <div className=\"App\">\n <ul>\n {this.state.pending.map((data) => (\n data.map((actualData) => (\n <li key={actualData.UserID}> <CardImg {...actualData} /></li>\n ))\n ))}\n </ul>\n </div>\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 render() {\n return (\n <div className=\"App\">\n <ul>\n {this.state.verifications.map((data, i) => (\n <li key={i}> <Card {...data} /></li>\n ))}\n </ul>\n </div>\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 <React.StrictMode>\n <Pending />\n <Verification />\n </React.StrictMode>,\n document.getElementById('react_app')\n);\n"],"sourceRoot":""}

11
static/loggedIn.tpl

@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
<br><br>
<div class="container h-100 d-flex justify-content-center align-items-center">
<div id="react_app"></div>
<script>!function (e) { function t(t) { for (var n, l, a = t[0], f = t[1], i = t[2], c = 0, s = []; c < a.length; c++)l = a[c], Object.prototype.hasOwnProperty.call(o, l) && o[l] && s.push(o[l][0]), o[l] = 0; for (n in f) Object.prototype.hasOwnProperty.call(f, n) && (e[n] = f[n]); for (p && p(t); s.length;)s.shift()(); return u.push.apply(u, i || []), r() } function r() { for (var e, t = 0; t < u.length; t++) { for (var r = u[t], n = !0, a = 1; a < r.length; a++) { var f = r[a]; 0 !== o[f] && (n = !1) } n && (u.splice(t--, 1), e = l(l.s = r[0])) } return e } var n = {}, o = { 1: 0 }, u = []; function l(t) { if (n[t]) return n[t].exports; var r = n[t] = { i: t, l: !1, exports: {} }; return e[t].call(r.exports, r, r.exports, l), r.l = !0, r.exports } l.m = e, l.c = n, l.d = function (e, t, r) { l.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }) }, l.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) }, l.t = function (e, t) { if (1 & t && (e = l(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if (l.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var n in e) l.d(r, n, function (t) { return e[t] }.bind(null, n)); return r }, l.n = function (e) { var t = e && e.__esModule ? function () { return e.default } : function () { return e }; return l.d(t, "a", t), t }, l.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, l.p = "/"; var a = this.webpackJsonpthanos = this.webpackJsonpthanos || [], f = a.push.bind(a); a.push = t, a = a.slice(); for (var i = 0; i < a.length; i++)t(a[i]); var p = f; r() }([])</script>
<script src="/static/js/2.f311d910.chunk.js"></script>
<script src="/static/js/main.98705200.chunk.js"></script>
<div class="container h-100 d-flex justify-content-center align-items-center">
<div id="react_app"></div>
<script>!function (e) { function t(t) { for (var n, l, a = t[0], f = t[1], i = t[2], c = 0, s = []; c < a.length; c++)l = a[c], Object.prototype.hasOwnProperty.call(o, l) && o[l] && s.push(o[l][0]), o[l] = 0; for (n in f) Object.prototype.hasOwnProperty.call(f, n) && (e[n] = f[n]); for (p && p(t); s.length;)s.shift()(); return u.push.apply(u, i || []), r() } function r() { for (var e, t = 0; t < u.length; t++) { for (var r = u[t], n = !0, a = 1; a < r.length; a++) { var f = r[a]; 0 !== o[f] && (n = !1) } n && (u.splice(t--, 1), e = l(l.s = r[0])) } return e } var n = {}, o = { 1: 0 }, u = []; function l(t) { if (n[t]) return n[t].exports; var r = n[t] = { i: t, l: !1, exports: {} }; return e[t].call(r.exports, r, r.exports, l), r.l = !0, r.exports } l.m = e, l.c = n, l.d = function (e, t, r) { l.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }) }, l.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) }, l.t = function (e, t) { if (1 & t && (e = l(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var r = Object.create(null); if (l.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var n in e) l.d(r, n, function (t) { return e[t] }.bind(null, n)); return r }, l.n = function (e) { var t = e && e.__esModule ? function () { return e.default } : function () { return e }; return l.d(t, "a", t), t }, l.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, l.p = "/"; var a = this.webpackJsonpthanos = this.webpackJsonpthanos || [], f = a.push.bind(a); a.push = t, a = a.slice(); for (var i = 0; i < a.length; i++)t(a[i]); var p = f; r() }([])</script>
<script src="/static/js/2.4d5fc99e.chunk.js"></script>
<script src="/static/js/main.9753ddf0.chunk.js"></script>
</div>

3059
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save