import React, { Component } from 'react' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import * as actions from '../actions' // import { Loader } from '../common' class PaperAddress extends Component { componentDidMount() { const { sha256 } = this.props.match.params this.props.actions.getAddress(sha256) } componentDidUpdate(newProps) { const { sha256: oldSha256 } = this.props.match.params const { sha256 } = newProps.match.params if (sha256 !== oldSha256) { this.props.actions.getPaperInfo(this.props.match.params.key) } } render() { // if (!this.props.match.params.key) return null // if (this.props.api.address.loading) return // if (!this.props.api.paperInfo.dataset) return
Metadata not found
return null } } const mapStateToProps = state => ({ api: state.api, }) const mapDispatchToProps = dispatch => ({ actions: bindActionCreators({ ...actions }, dispatch), }) export default connect(mapStateToProps, mapDispatchToProps)(PaperAddress)