Cleaning unused code
This commit is contained in:
1 parent
6c66df280b
commit
a9e5d2ba05
2 files changed
+45
-58
No files matched your search
@@ -69,7 +69,8 @@ class UserImages extends React.Component {
|
||||
saveDisabled: true,
|
||||
uploadToolDisabled: false,
|
||||
showNewAvatar: false,
|
||||
needToWait: false
|
||||
needToWait: false,
|
||||
removeCurrentAvatar: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +85,7 @@ class UserImages extends React.Component {
|
||||
refetchQueries: [{ query: getUsersQuery}] // This allow us to re run whatever queries are necesary after the mutation.
|
||||
})
|
||||
|
||||
this.setState({saveDisabled: true})
|
||||
this.setState({saveDisabled: true, removeCurrentAvatar:true})
|
||||
|
||||
/* Before we are done, we need to update the state of the local storage. */
|
||||
|
||||
@@ -169,31 +170,57 @@ console.log("dates", avatarChangeDate, now, timePassed, oneDay)
|
||||
)
|
||||
}
|
||||
|
||||
onError = () => {
|
||||
onError = (err) => {
|
||||
console.log('onError')
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
onRemoveSuccess = (err) => {
|
||||
console.log('onRemoveSuccess')
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
showCurrentAvatar() {
|
||||
|
||||
const { classes } = this.props
|
||||
return (
|
||||
<div>
|
||||
<Typography className={classes.typography} variant='body1' gutterBottom align='left'>
|
||||
This is your current Avatar:
|
||||
</Typography>
|
||||
|
||||
<Grid container justify='center' >
|
||||
<Grid item>
|
||||
<Avatar
|
||||
alt="Avatar"
|
||||
src={"https://cdn.filestackcontent.com/" + this.state.avatarHandle}
|
||||
className={classNames(classes.bigAvatar)}
|
||||
/>
|
||||
if (this.state.removeCurrentAvatar === true) {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Typography className={classes.typography} variant='body1' gutterBottom align='left'>
|
||||
This is your current Avatar:
|
||||
</Typography>
|
||||
|
||||
<Grid container justify='center' >
|
||||
<Grid item>
|
||||
<Avatar
|
||||
alt="Avatar"
|
||||
src={"https://cdn.filestackcontent.com/" + this.state.avatarHandle}
|
||||
className={classNames(classes.bigAvatar)}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</div>
|
||||
)
|
||||
</div>
|
||||
)
|
||||
|
||||
} else {
|
||||
|
||||
return (
|
||||
<div>
|
||||
<ReactFilestack
|
||||
apikey={'AH97QJOXTHwdBXjydQgABz'}
|
||||
mode="remove"
|
||||
options={options}
|
||||
fileHandle={this.state.avatarHandle}
|
||||
onSuccess={this.onRemoveSuccess}
|
||||
onError={this.onError}
|
||||
link
|
||||
></ReactFilestack>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import React from 'react';
|
||||
|
||||
import {
|
||||
XYPlot,
|
||||
XAxis,
|
||||
YAxis,
|
||||
HorizontalGridLines,
|
||||
VerticalGridLines,
|
||||
LineSeries
|
||||
} from 'index';
|
||||
|
||||
const data = [];
|
||||
|
||||
for (let i = 0; i < 20; i++) {
|
||||
const series = [];
|
||||
for (let j = 0; j < 100; j++) {
|
||||
series.push({x: j, y: (i / 10 + 1) * Math.sin(Math.PI * (i + j) / 50)});
|
||||
}
|
||||
data.push({color: i, key: i, data: series, opacity: 0.8});
|
||||
}
|
||||
|
||||
export default class Example extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<XYPlot
|
||||
width={300}
|
||||
height={300}
|
||||
colorType="linear"
|
||||
colorDomain={[0, 9]}
|
||||
colorRange={['yellow', 'orange']}
|
||||
>
|
||||
<HorizontalGridLines />
|
||||
<VerticalGridLines />
|
||||
<XAxis />
|
||||
<YAxis />
|
||||
{data.map(props => <LineSeries {...props}/>)}
|
||||
</XYPlot>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user