import React from 'react'; import PropTypes from 'prop-types'; import { Helmet } from 'react-helmet'; import brand from 'ba-api/brand'; import dummy from 'ba-api/dummyContents'; import AccountCircle from '@material-ui/icons/AccountCircle'; import SupervisorAccount from '@material-ui/icons/SupervisorAccount'; import Favorite from '@material-ui/icons/Favorite'; import PhotoLibrary from '@material-ui/icons/PhotoLibrary'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import data from 'ba-api/timelineData'; import { fetchAction } from 'ba-actions/SocmedActions'; import { Cover, About, Connection, Favorites, Albums } from 'ba-components'; import { AppBar, Tabs, Tab, Hidden } from '@material-ui/core'; function TabContainer(props) { return (
{props.children}
); } TabContainer.propTypes = { children: PropTypes.node.isRequired, }; class UserProfile extends React.Component { state = { value: 0, }; componentDidMount() { this.props.fetchData(data); } handleChange = (event, value) => { this.setState({ value }); }; render() { const title = brand.name + ' - Profile'; const description = brand.desc; const { dataProps } = this.props; const { value } = this.state; return (
{title} } /> } /> } /> } /> } label="ABOUT" /> } label="20 CONNECTIONS" /> } label="18 FAVORITES" /> } label="4 ALBUMS" /> {value === 0 && } {value === 1 && } {value === 2 && } {value === 3 && }
); } } UserProfile.propTypes = { dataProps: PropTypes.object.isRequired, fetchData: PropTypes.func.isRequired, }; const reducer = 'socmed'; const mapStateToProps = state => ({ force: state, // force state from reducer dataProps: state.getIn([reducer, 'dataTimeline']) }); const constDispatchToProps = dispatch => ({ fetchData: bindActionCreators(fetchAction, dispatch) }); const UserProfileMapped = connect( mapStateToProps, constDispatchToProps )(UserProfile); export default UserProfileMapped;