Fixing after react update
This commit is contained in:
@@ -1,3 +1,53 @@
|
||||
<<<<<<< HEAD
|
||||
import React, { Fragment, useEffect } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import Spinner from '../layout/Spinner';
|
||||
import ProfileItem from './ProfileItem';
|
||||
import { getProfiles } from '../../actions/profile';
|
||||
|
||||
const Profiles = ({ getProfiles, profile: { profiles, loading } }) => {
|
||||
useEffect(() => {
|
||||
getProfiles();
|
||||
}, [getProfiles]);
|
||||
|
||||
return (
|
||||
<section className="container">
|
||||
{loading ? (
|
||||
<Spinner />
|
||||
) : (
|
||||
<Fragment>
|
||||
<h1 className="large text-primary">Developers</h1>
|
||||
<p className="lead">
|
||||
<i className="fab fa-connectdevelop" /> Browse and connect with
|
||||
developers
|
||||
</p>
|
||||
<div className="profiles">
|
||||
{profiles.length > 0 ? (
|
||||
profiles.map((profile) => (
|
||||
<ProfileItem key={profile._id} profile={profile} />
|
||||
))
|
||||
) : (
|
||||
<h4>No profiles found...</h4>
|
||||
)}
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
Profiles.propTypes = {
|
||||
getProfiles: PropTypes.func.isRequired,
|
||||
profile: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
profile: state.profile
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, { getProfiles })(Profiles);
|
||||
=======
|
||||
import React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
@@ -40,3 +90,4 @@ ProfileItem.propTypes = {
|
||||
};
|
||||
|
||||
export default ProfileItem;
|
||||
>>>>>>> cc38df43629d64ca77f694c971a13a026b3afcfb
|
||||
|
||||
Reference in New Issue
Block a user