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

20 lines
469 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-07 18:50:32 +01:00
function Board({ location, match, boards }) {
const { hash, name } = match.params
return <BoardComponent {...boards[getBoardAddress(hash, name)]} />
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)