From 6035da058ed052262bf668efb325049bdf27c5d9 Mon Sep 17 00:00:00 2001 From: JP1998 Date: Tue, 9 Apr 2019 17:00:49 +0200 Subject: [PATCH] Restrict access to the modal for users that are not the owner of the tournament --- pages/tournament.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pages/tournament.js b/pages/tournament.js index dbff215..6874c08 100644 --- a/pages/tournament.js +++ b/pages/tournament.js @@ -53,7 +53,7 @@ class PrivateTournamentPage extends React.Component {
{playoffStages.map(stage => - )} + )}
); @@ -113,7 +113,11 @@ class Match extends React.Component { } toggleModal() { - this.setState({modal: !this.state.modal}); + const { isSignedIn, isOwner } = this.props; + + if(isSignedIn && isOwner) { + this.setState({modal: !this.state.modal}); + } } render() {