diff --git a/twistter-frontend/src/pages/user.js b/twistter-frontend/src/pages/user.js index d48279b..a91dffe 100644 --- a/twistter-frontend/src/pages/user.js +++ b/twistter-frontend/src/pages/user.js @@ -23,179 +23,179 @@ import noImage from '../images/no-img.png'; import Paper from '@material-ui/core/Paper'; const styles = { - button: { - positon: 'relative', - float: 'left', - marginLeft: 30, - marginTop: 15 - }, - paper: { - // marginLeft: "10%", - // marginRight: "10%" - } + button: { + positon: 'relative', + float: 'left', + marginLeft: 30, + marginTop: 15 + }, + paper: { + // marginLeft: "10%", + // marginRight: "10%" + } }; const MyChip = styled(Chip)({ - margin: 2, - color: 'primary' + margin: 2, + color: 'primary' }); class user extends Component { - state = { - profile: null, - imageUrl: null, - topics: null, - newTopic: null - }; + state = { + profile: null, + imageUrl: null, + topics: null, + newTopic: null + }; - handleDelete = (topic) => { - alert(`Delete topic: ${topic}!`); - }; + handleDelete = (topic) => { + alert(`Delete topic: ${topic}!`); + }; - handleAddCircle = () => { - axios - .post('/putTopic', { - topic: this.state.newTopic - }) - .then(function() { - location.reload(); - }) - .catch(function(err) { - console.log(err); - }); - }; + handleAddCircle = () => { + axios + .post('/putTopic', { + topic: this.state.newTopic + }) + .then(function() { + location.reload(); + }) + .catch(function(err) { + console.log(err); + }); + }; - handleChange(event) { - this.setState({ - newTopic: event.target.value - }); - } + handleChange(event) { + this.setState({ + newTopic: event.target.value + }); + } - componentDidMount() { - axios - .get('/user') - .then((res) => { - this.setState({ - profile: res.data.credentials.handle, - imageUrl: res.data.credentials.imageUrl - }); - }) - .catch((err) => console.log(err)); - axios - .get('/getAllTopics') - .then((res) => { - this.setState({ - topics: res.data - }); - }) - .catch((err) => console.log(err)); - } - render() { - const { classes } = this.props; - let profileMarkup = this.state.profile ? ( -
-
loading username...
- ); + componentDidMount() { + axios + .get('/user') + .then((res) => { + this.setState({ + profile: res.data.credentials.handle, + imageUrl: res.data.credentials.imageUrl + }); + }) + .catch((err) => console.log(err)); + axios + .get('/getAllTopics') + .then((res) => { + this.setState({ + topics: res.data + }); + }) + .catch((err) => console.log(err)); + } + render() { + const { classes } = this.props; + let profileMarkup = this.state.profile ? ( +
+
loading username...
+ ); - let topicsMarkup = this.state.topics ? ( - this.state.topics.map((topic) => ( -loading topics...
- ); + let topicsMarkup = this.state.topics ? ( + this.state.topics.map((topic) => ( +loading topics...
+ ); - let imageMarkup = this.state.imageUrl ? ( -Posts go here
- //Posts go here
+ //posts here
-posts here
+Posts go here