import React, { Component } from "react";
import { render } from "react-dom";
import { Router, Link } from "@reach/router";
import "fomantic-ui-css/semantic.css";
import "./App.css";
import {
Dropdown,
Menu,
Icon,
Loader,
Container,
Segment
} from "semantic-ui-react";
import Home from "./Home";
import Thread from "./Thread";
import Board from "./Board";
import NotFound from "./NotFound";
class App extends Component {
constructor() {
super();
this.state = {
boardList: [],
isLoaded: false
};
}
componentDidMount() {
fetch("https://bienvenidoainternet.org/cgi/api/boards")
.then(response => {
return response.json();
})
.then(resource => {
this.setState({ boardList: resource["boards"], isLoaded: true });
})
.catch(console.error);
}
render() {
if (!this.state.isLoaded) {
if (!this.state.isLoaded) {
return (
Cargando ...
);
}
}
const { boardList } = this.state;
//const pathList = boardList.map(board => "/" + board.dir)
return (
Bievenido a Internet 2010-2019
bai-client + weabot
);
}
}
render(, document.getElementById("root"));