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 }); }); } render() { if (!this.state.isLoaded) { if (!this.state.isLoaded) { return ( Cargando ... ); } } const { boardList } = this.state; //const pathList = boardList.map(board => "/" + board.dir) return ( B.a.I Home {boardList.map(board => board.board_type === 1 ? ( /{board.dir}/ - {board.name} ) : null )} {boardList.map(board => board.board_type === 0 ? ( /{board.dir}/ - {board.name} ) : null )} Bievenido a Internet 2010-2019
bai-client + weabot
); } } render(, document.getElementById("root"));