Restrict access to the modal for users that are not the owner of the tournament
This commit is contained in:
parent
2b1d7b084e
commit
6035da058e
|
|
@ -53,7 +53,7 @@ class PrivateTournamentPage extends React.Component {
|
||||||
</Container>
|
</Container>
|
||||||
<div className='stages pt-5'>
|
<div className='stages pt-5'>
|
||||||
{playoffStages.map(stage =>
|
{playoffStages.map(stage =>
|
||||||
<Stage level={getLevelName(stage.level)} matches={stage.matches} key={stage.level}/>)}
|
<Stage isSignedIn={isSignedIn} isOwner={username == ownerUsername} level={getLevelName(stage.level)} matches={stage.matches} key={stage.level}/>)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
@ -113,7 +113,11 @@ class Match extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleModal() {
|
toggleModal() {
|
||||||
this.setState({modal: !this.state.modal});
|
const { isSignedIn, isOwner } = this.props;
|
||||||
|
|
||||||
|
if(isSignedIn && isOwner) {
|
||||||
|
this.setState({modal: !this.state.modal});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue