Skip to content

Commit

Permalink
#133 : Fixed Ui for delete button if there are no documents present f…
Browse files Browse the repository at this point in the history
…or individual student page, courses page as well as all documents page
  • Loading branch information
compgirl123 committed Jan 20, 2020
1 parent f215b26 commit 15ae3a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tutify/src/components/CourseView/ViewCourse.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ render() {
}
</TableRow>
))}
{this.state.profileType === "tutor"
{this.state.profileType === "tutor" && this.state.files.length !== 0
?
<TableCell><Button type="button" onClick={event => this.deleteFile(event, this.state.shareTo)} variant="contained" size="small" className="submit">Delete Documents</Button></TableCell>
:
Expand Down
2 changes: 1 addition & 1 deletion tutify/src/components/ProfilePage/Studentdocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class Studentdocs extends React.Component {
)
})
}
{this.props.match.params.studentid !== undefined
{this.props.match.params.studentid !== undefined && this.state.files.length !== 0
?
<TableCell><Button type="button" onClick={event => this.deleteFile(event, this.state.shareTo)} variant="contained" size="small" className="submit">Delete Document</Button></TableCell>
:
Expand Down
6 changes: 5 additions & 1 deletion tutify/src/components/TutorProfile/DocList.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,12 @@ class DocList extends React.Component {
</TableRow>
)
})}

{this.state.files.length !== 0
?
<TableCell><Button type="button" onClick={event => this.getSelectedFiletoDelete(event, this.state.shareTo)} variant="contained" size="small" className="submit">Delete Documents</Button></TableCell>
:
<br/>
}
</TableBody>
</Table>
</React.Fragment>
Expand Down

0 comments on commit 15ae3a0

Please sign in to comment.