aboutsummaryrefslogtreecommitdiff
path: root/src/Board.js
diff options
context:
space:
mode:
authorLibravatar Renard 2019-09-25 15:33:33 -0300
committerLibravatar Renard 2019-09-25 15:33:33 -0300
commit2e496411a387493e87087d90deb4ed5efe3c3417 (patch)
tree28f4043d37275abc82a78b739e2ef35afdfffd87 /src/Board.js
parent30d3bf92fe11bcdfeeaf070732f28d9cd5be799a (diff)
downloadbai-client-2e496411a387493e87087d90deb4ed5efe3c3417.tar.gz
bai-client-2e496411a387493e87087d90deb4ed5efe3c3417.tar.xz
bai-client-2e496411a387493e87087d90deb4ed5efe3c3417.zip
Variable destructuring ✨
Diffstat (limited to 'src/Board.js')
-rw-r--r--src/Board.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Board.js b/src/Board.js
index 593f766..048cb00 100644
--- a/src/Board.js
+++ b/src/Board.js
@@ -97,6 +97,7 @@ class Board extends Component {
render() {
const { isLoaded, error, threadList, loadingMore, endReached } = this.state;
+ const { boardList, dir, nightMode } = this.props;
if (error != null) {
return (
@@ -117,11 +118,10 @@ class Board extends Component {
);
}
- const currentBoard = this.props.boardList.find(board => {
- return board.dir === this.props.dir;
+ const currentBoard = boardList.find(board => {
+ return board.dir === dir;
});
document.title = currentBoard.name + " - B.a.I";
- const nightMode = this.props.nightMode;
return (
<React.Fragment>
@@ -143,9 +143,7 @@ class Board extends Component {
{threadList.map(thread => (
<Segment.Group key={"seg_" + thread.timestamp + thread.id}>
<Header as="h3" attached inverted={nightMode}>
- <Link to={`/${this.props.dir}/read/${thread.id}`}>
- {thread.subject}
- </Link>
+ <Link to={`/${dir}/read/${thread.id}`}>{thread.subject}</Link>
<Header.Subheader>
{thread.total_replies} respuestas
</Header.Subheader>