diff options
-rw-r--r-- | src/App.js | 6 | ||||
-rw-r--r-- | src/BBSThread.js | 5 | ||||
-rw-r--r-- | src/Board.js | 5 | ||||
-rw-r--r-- | src/Post.js | 2 |
4 files changed, 8 insertions, 10 deletions
@@ -1,10 +1,10 @@ import React, { Component } from 'react'; import { render } from "react-dom"; -import { Router, Link, Match } from "@reach/router"; +import { Router, Link } from "@reach/router"; import 'fomantic-ui-css/semantic.css'; import "./App.css"; -import { Dropdown, Menu, Icon, Loader, Container, Grid } from "semantic-ui-react"; +import { Dropdown, Menu, Icon, Loader, Container } from "semantic-ui-react"; import Home from "./Home"; import BBSThread from "./BBSThread"; import Board from "./Board"; @@ -43,7 +43,7 @@ class App extends Component { } const { boardList } = this.state; - const pathList = boardList.map(board => "/" + board.dir) + //const pathList = boardList.map(board => "/" + board.dir) return ( <Container> <Menu inverted> diff --git a/src/BBSThread.js b/src/BBSThread.js index 747682b..025f258 100644 --- a/src/BBSThread.js +++ b/src/BBSThread.js @@ -1,5 +1,5 @@ import React, { Component } from "react"; -import { Header, Icon, Loader, Message, Segment, Image, Label } from "semantic-ui-react"; +import { Header, Icon, Loader, Message } from "semantic-ui-react"; import Moment from "react-moment"; import "moment/locale/es"; import Post from "./Post"; @@ -27,7 +27,7 @@ class BBSThread extends Component { fetch(apiURl) .then((response) => { return response.json() }) .then((resource => { - if (resource["state"] == "error") { + if (resource["state"] === "error") { console.log("API Error:" + resource["message"]); this.setState({ error: resource }); } @@ -37,7 +37,6 @@ class BBSThread extends Component { } render() { const { isLoading, error } = this.state; - const filesize = require('filesize'); if (isLoading) { return ( diff --git a/src/Board.js b/src/Board.js index beb8a74..bec11a3 100644 --- a/src/Board.js +++ b/src/Board.js @@ -1,9 +1,8 @@ import React, { Component } from "react"; -import { Loader, Message, Segment, Header, Icon, Image } from "semantic-ui-react"; +import { Loader, Message, Segment, Header } from "semantic-ui-react"; import { Link } from "@reach/router"; import Moment from "react-moment"; import "moment/locale/es"; -import Post from "./Post"; class Board extends Component { constructor() { super(); @@ -20,7 +19,7 @@ class Board extends Component { return response.json(); }) .then((resource) => { - if (resource["state"] == "error") { + if (resource["state"] === "error") { this.setState({ error: resource }); } this.setState({ isLoaded: true, threadList: resource["threads"] }) diff --git a/src/Post.js b/src/Post.js index 956cf72..a09cccf 100644 --- a/src/Post.js +++ b/src/Post.js @@ -15,7 +15,7 @@ const Post = ({ index, post, locked, dir }) => { </Header> <Segment.Group horizontal> - {post.file != "" ? + {post.file !== "" ? <Segment compact className="imageSegment"> <Label attached='bottom'>{post.file} {post.image_width}x{post.image_height} {filesize(post.file_size, { bits: true })}</Label> <Image fluid src={`https://bienvenidoainternet.org/${dir}/thumb/${post.thumb}`} /> |