From a9e5d2ba0593e978f70b9638dba1ec884c3d963d Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 18 Sep 2018 08:02:05 +0200 Subject: [PATCH] Cleaning unused code --- client/src/components/UserImages.js | 63 +++++++++++++++++------- client/src/components/home/ChartUsers.js | 40 --------------- 2 files changed, 45 insertions(+), 58 deletions(-) delete mode 100644 client/src/components/home/ChartUsers.js diff --git a/client/src/components/UserImages.js b/client/src/components/UserImages.js index 57f613cfa..23651fda6 100644 --- a/client/src/components/UserImages.js +++ b/client/src/components/UserImages.js @@ -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 ( -
- - This is your current Avatar: - - - - + if (this.state.removeCurrentAvatar === true) { + + return ( +
+ + This is your current Avatar: + + + + + + - -
- ) +
+ ) + + } else { + + return ( +
+ +
+ ) + } + } diff --git a/client/src/components/home/ChartUsers.js b/client/src/components/home/ChartUsers.js deleted file mode 100644 index d9eca93ce..000000000 --- a/client/src/components/home/ChartUsers.js +++ /dev/null @@ -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 ( - - - - - - {data.map(props => )} - - ); - } -}