-
-
Save nomoney4me/0ed0850563611800580531d507011979 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react'; | |
| import { connect } from 'react-redux'; | |
| import Loading from '../../assets/img/loading.gif'; | |
| let contract_data = (data) => { | |
| if (data) { | |
| data.map(row => { | |
| console.log(row) | |
| }) | |
| } | |
| return data | |
| } | |
| const Dashboard = (props) => { | |
| let loading = props.data ? false : true; | |
| let data = contract_data(props.data) | |
| return ( | |
| <Col xs={12} md={12} lg={12}> | |
| {/* loading bar */} | |
| <Row style={{ height: "30px" }}> | |
| {loading ? <img src={Loading} /> : ""} | |
| </Row> | |
| <Row> | |
| <Col xs={12} md={12} lg={12}> | |
| <code>{ JSON.stringify(data) } </code> | |
| </Col> | |
| </Row> | |
| </Col> | |
| ) | |
| } | |
| const mapStateToProps = (state) => ({ | |
| data: state.Candidates | |
| }) | |
| export default connect(mapStateToProps)(Dashboard) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment