1
0
mirror of https://github.com/fazo96/ipfs-boards synced 2025-01-26 15:04:19 +01:00
ipfs-boards/src/containers/Board.js

22 lines
571 B
JavaScript
Raw Normal View History

2018-02-07 18:50:32 +01:00
import React from 'react'
2018-02-04 19:08:21 +01:00
import { connect } from 'react-redux'
import BoardComponent from '../components/Board'
2018-02-07 18:50:32 +01:00
import { getBoardAddress } from '../utils/orbitdb'
2018-02-04 19:08:21 +01:00
2018-02-08 23:52:06 +01:00
function Board({ stats, location, match, boards }) {
2018-02-07 18:50:32 +01:00
const { hash, name } = match.params
2018-02-08 23:52:06 +01:00
const address = getBoardAddress(hash, name)
const boardStats = stats.dbs[address] || {}
return <BoardComponent stats={boardStats} {...boards[address]} />
2018-02-04 19:08:21 +01:00
}
function mapStateToProps(state){
return {
boards: state.boards.boards
}
}
export default connect(
2018-02-07 18:50:32 +01:00
mapStateToProps
2018-02-04 19:08:21 +01:00
)(Board)