diff --git a/twistter-frontend/src/pages/user.js b/twistter-frontend/src/pages/user.js index 3340b47..c877e06 100644 --- a/twistter-frontend/src/pages/user.js +++ b/twistter-frontend/src/pages/user.js @@ -19,16 +19,36 @@ import Typography from "@material-ui/core/Typography"; import AddCircle from '@material-ui/icons/AddCircle'; import TextField from '@material-ui/core/TextField'; import VerifiedIcon from '@material-ui/icons/CheckSharp'; +import withStyles from '@material-ui/core/styles/withStyles'; +import GridList from '@material-ui/core/GridList'; +import GridListTile from '@material-ui/core/GridListTile'; +import GridListTileBar from '@material-ui/core/GridListTileBar'; +import Paper from '@material-ui/core/Paper'; + // component import '../App.css'; import noImage from '../images/no-img.png'; import Writing_Microblogs from '../Writing_Microblogs'; + const MyChip = styled(Chip)({ margin: 2, color: "primary" }); +const styles = { + button: { + positon: 'relative', + float: 'left', + marginLeft: 30, + marginTop: 15 + }, + paper: { + // marginLeft: "10%", + // marginRight: "10%" + } +}; + class user extends Component { state = { profile: null, @@ -70,18 +90,18 @@ class user extends Component { componentDidMount() { axios .get("/user") - .then(res => { + .then((res) => { this.setState({ profile: res.data.credentials.handle, imageUrl: res.data.credentials.imageUrl, verified: res.data.credentials.verified ? res.data.credentials.verified : false }); }) - .catch(err => console.log(err)); + .catch((err) => console.log(err)); axios .get("/getAllTopics") - .then(res => { + .then((res) => { this.setState({ topics: res.data }); @@ -100,8 +120,8 @@ class user extends Component { } render() { + const { classes } = this.props; let authenticated = this.props.user.authenticated; - let classes = this.props; let profileMarkup = this.state.profile ? (
@@ -149,66 +169,108 @@ class user extends Component { ) ) : (

My Posts

); + // FIX: This needs to check if user's profile page being displayed + // is the same as the user who is logged in + // Can't check for that right now, because this page is always + // showing the logged in users profile, instead of retreiving the + // profile based on the URL entered + let editButtonMarkup = true ? ( + + ) : null; + return ( - - - {imageMarkup} - {profileMarkup} - {topicsMarkup} - this.handleChange(event)} - /> - -
- - - { - authenticated && - } - - - { - authenticated && - this.state.profile === 'Admin' && - } + // + // + // { + // authenticated && + // this.state.profile === 'Admin' && + // } - - -
- - {postMarkup} - - - - -        -
+ // to='/verify' + // > + // Verify Users + // } + // + // + // + // + // {postMarkup} + // + // + // + // + //        + // + +
+ + + {editButtonMarkup} + + + + + {imageMarkup} + {profileMarkup} + {topicsMarkup} + this.handleChange(event)} + /> + + + +

posts here

+
+
+
+ + +
); } } @@ -221,4 +283,4 @@ user.propTypes = { user: PropTypes.object.isRequired } -export default connect(mapStateToProps)(user); +export default connect(mapStateToProps)(withStyles(styles)(user));