File size: 2,173 Bytes
3bc47cc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
'use strict'
const e = React.createElement;
class Comp1 extends React.Component {
    constructor(props) {
       super(props);
       //this.getallmagneuris = this.getallmagneuris.bind(this);
       this.state = {quotas:[]}
    }
   
    componentDidMount() {
       //window.addEventListener('load', this.handleLoad);
       //this.getallmagneuris();
       alert("Hi")
    }
    /*
    async getallmagneuris(){
        const companyname = "Google"
        const company_password = "kya63amari"
        const contributorsignup= await axios.post("https://caesarcoinbackend.onrender.com/quotapostersignin",{"company":companyname,"email":"amari.lawal05@gmail.com","password":company_password})
        
        //console.log(contributorsignup)
        if (contributorsignup.data.access_token == "Wrong password"){
          let walletbalance= document.getElementById("walletbalance")
          walletbalance.style = "position:absolute;left:20%;top:10%;"
          walletbalance.innerHTML = `${companyname} incorrect password or username.`
        }
        else{
          const config = {
            headers: { Authorization: `Bearer ${contributorsignup.data.access_token}` }
          };
          const getlastblockchainresp = await axios.get("https://caesarcoinbackend.onrender.com/getallmagneturi",config) 
          //console.log(getlastblockchainresp.data.quotamagneturis)
          this.setState( state => ({
            quotas: state.quotas.concat(getlastblockchainresp.data.quotamagneturis)
        }));
  
        }
    }*/
    render () {
        //console.log(this.state)
        //const quotas = this.state //.quotas
        console.log("hi")
        return (
          <div>
            <h1>Quota files Contributed</h1>

          </div>
        )
    }
}


// Find all DOM containers, and render our component into them.
var containers = document.querySelectorAll('.root-react')
console.log("test")
containers.forEach(domContainer => {
    // Read the user ID from a data-* attribute.
    const userid = domContainer.dataset.userid
    // render the component into the DOM
    ReactDOM.render(
      e(Comp1, { userid: userid}),
      domContainer
    )
});