Skip to content

Commit

Permalink
Merge pull request #124 from developmentseed/fix/hide-buttons-no-edits
Browse files Browse the repository at this point in the history
hide upload and trash buttons if there are no edits
  • Loading branch information
geohacker authored Nov 5, 2019
2 parents f7cbab9 + f9e1b37 commit e1db966
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions app/screens/UserContributions/UserContributionsListScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ class UserContributionsListScreen extends React.Component {
render () {
const { navigation, edits, uploadedEdits } = this.props
const allEdits = edits.concat(uploadedEdits).sort((a, b) => b.timestamp > a.timestamp ? 1 : -1)
const headerActions = [
{
name: 'upload-2',
onPress: this.props.retryAllEdits
},
{
name: 'trash-bin',
onPress: this.props.clearUploadedEdits
}
]
let headerActions
if (allEdits && allEdits.length) {
headerActions = [
{
name: 'upload-2',
onPress: this.props.retryAllEdits
},
{
name: 'trash-bin',
onPress: this.props.clearUploadedEdits
}
]
}
return (
<Container>
<Header
Expand Down

0 comments on commit e1db966

Please sign in to comment.