diff --git a/twistter-frontend/src/images/original.png b/twistter-frontend/src/images/original.png new file mode 100644 index 0000000..c28e365 Binary files /dev/null and b/twistter-frontend/src/images/original.png differ diff --git a/twistter-frontend/src/images/twistter-logo.png b/twistter-frontend/src/images/twistter-logo.png index c28e365..1baf97c 100644 Binary files a/twistter-frontend/src/images/twistter-logo.png and b/twistter-frontend/src/images/twistter-logo.png differ diff --git a/twistter-frontend/src/pages/user.js b/twistter-frontend/src/pages/user.js index 7ace6bc..435c92c 100644 --- a/twistter-frontend/src/pages/user.js +++ b/twistter-frontend/src/pages/user.js @@ -11,7 +11,7 @@ import CardContent from '@material-ui/core/CardContent'; import Chip from '@material-ui/core/Chip'; import Paper from '@material-ui/core/Paper'; import Typography from "@material-ui/core/Typography"; - +import AddCircle from '@material-ui/icons/AddCircle'; // component import Profile from '../components/profile/Profile'; @@ -28,29 +28,63 @@ const PostCard = styled(Card)({ padding: '0 30px', }); +const MyChip = styled(Chip)({ + margin: 2, + color: 'primary' +}); -class user extends Component { + +const styles = (theme) => ({ + ...theme +}); + +const handleDelete = () => { + alert("Delete this topic!"); +} + +const handleAddCircle = () => { + alert("Add topic"); +} + +class user extends Component { state = { - profile: null + profile: null, + topics: null }; componentDidMount() { axios .get("/user") .then(res => { - console.log(res.data.userData.credentials.handle); + console.log(res.data.credentials.handle); this.setState({ - profile: res.data.userData.credentials.handle + profile: res.data.credentials.handle }); }) .catch(err => console.log(err)); + axios + .get("/getAllTopics") + .then(res => { + console.log(res.data[1]); + this.setState({ + topics: res.data + }) + }) + .catch(err => console.log(err)); } render() { - + const classes = this.props; let profileMarkup = this.state.profile ? (
loading profile...
+ ) : (loading username...
); + + + let topicsMarkup = this.state.topics ? ( + this.state.topics.map(topic =>loading topics...
); return (