mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 02:08:47 +00:00
commit
b255006f7a
BIN
twistter-frontend/src/images/original.png
Normal file
BIN
twistter-frontend/src/images/original.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 48 KiB |
@ -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'
|
||||
});
|
||||
|
||||
|
||||
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 ? (
|
||||
<p>
|
||||
<Typography variant='h5'>{this.state.profile}</Typography>
|
||||
</p>) : <p>loading profile...</p>
|
||||
</p>) : (<p>loading username...</p>);
|
||||
|
||||
|
||||
let topicsMarkup = this.state.topics ? (
|
||||
this.state.topics.map(topic => <MyChip
|
||||
label={{topic}.topic.topic}
|
||||
onDelete={handleDelete}/>)
|
||||
) : (<p> loading topics...</p>);
|
||||
|
||||
return (
|
||||
<Grid container spacing={16}>
|
||||
@ -60,6 +94,12 @@ class user extends Component {
|
||||
<Grid item sm={4} xs={12}>
|
||||
<img src={noImage}/>
|
||||
{profileMarkup}
|
||||
{topicsMarkup}
|
||||
<MyChip
|
||||
icon={<AddCircle />}
|
||||
clickable
|
||||
onClick={handleAddCircle}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
);
|
||||
|
||||
@ -50,7 +50,13 @@ export default {
|
||||
marginBottom: 20
|
||||
},
|
||||
paper: {
|
||||
padding: 20
|
||||
padding: 10,
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
flexWrap: 'wrap'
|
||||
},
|
||||
chip: {
|
||||
margin: 0.5,
|
||||
},
|
||||
profile: {
|
||||
'& .image-wrapper': {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user