fetch certifications in account view
This commit is contained in:
parent
409c4adfbf
commit
e1c5796a5c
@ -19,7 +19,6 @@ import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import { hashToImageUrl } from '~/redux/providers/imagesReducer';
|
||||
import { fetchCertifications } from '~/redux/providers/certifications/actions';
|
||||
|
||||
import defaultIcon from '../../../assets/images/certifications/unknown.svg';
|
||||
|
||||
@ -29,14 +28,7 @@ class Certifications extends Component {
|
||||
static propTypes = {
|
||||
account: PropTypes.string.isRequired,
|
||||
certifications: PropTypes.array.isRequired,
|
||||
dappsUrl: PropTypes.string.isRequired,
|
||||
|
||||
fetchCertifications: PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
componentWillMount () {
|
||||
const { account, fetchCertifications } = this.props;
|
||||
fetchCertifications(account);
|
||||
dappsUrl: PropTypes.string.isRequired
|
||||
}
|
||||
|
||||
render () {
|
||||
@ -77,11 +69,7 @@ function mapStateToProps (_, initProps) {
|
||||
};
|
||||
}
|
||||
|
||||
function mapDispatchToProps (dispatch) {
|
||||
return bindActionCreators({ fetchCertifications }, dispatch);
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
null
|
||||
)(Certifications);
|
||||
|
@ -31,6 +31,7 @@ import shapeshiftBtn from '../../../assets/images/shapeshift-btn.png';
|
||||
import Header from './Header';
|
||||
import Transactions from './Transactions';
|
||||
import { setVisibleAccounts } from '~/redux/providers/personalActions';
|
||||
import { fetchCertifiers, fetchCertifications } from '~/redux/providers/certifications/actions';
|
||||
|
||||
import VerificationStore from '~/modals/SMSVerification/store';
|
||||
|
||||
@ -43,6 +44,8 @@ class Account extends Component {
|
||||
|
||||
static propTypes = {
|
||||
setVisibleAccounts: PropTypes.func.isRequired,
|
||||
fetchCertifiers: PropTypes.func.isRequired,
|
||||
fetchCertifications: PropTypes.func.isRequired,
|
||||
images: PropTypes.object.isRequired,
|
||||
|
||||
params: PropTypes.object,
|
||||
@ -62,6 +65,7 @@ class Account extends Component {
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
this.props.fetchCertifiers();
|
||||
this.setVisibleAccounts();
|
||||
}
|
||||
|
||||
@ -88,9 +92,10 @@ class Account extends Component {
|
||||
}
|
||||
|
||||
setVisibleAccounts (props = this.props) {
|
||||
const { params, setVisibleAccounts } = props;
|
||||
const { params, setVisibleAccounts, fetchCertifications } = props;
|
||||
const addresses = [ params.address ];
|
||||
setVisibleAccounts(addresses);
|
||||
fetchCertifications(params.address);
|
||||
}
|
||||
|
||||
render () {
|
||||
@ -344,7 +349,9 @@ function mapStateToProps (state) {
|
||||
|
||||
function mapDispatchToProps (dispatch) {
|
||||
return bindActionCreators({
|
||||
setVisibleAccounts
|
||||
setVisibleAccounts,
|
||||
fetchCertifiers,
|
||||
fetchCertifications
|
||||
}, dispatch);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user