Disable quick reactions button when no permissions (#7412)
This commit is contained in:
parent
a9d1f6e616
commit
097c40b577
2 changed files with 17 additions and 11 deletions
|
@ -37,6 +37,8 @@ interface IProps {
|
|||
reactionEvents: Set<MatrixEvent>;
|
||||
// A possible Matrix event if the current user has voted for this type
|
||||
myReactionEvent?: MatrixEvent;
|
||||
// Whether to prevent quick-reactions by clicking on this reaction
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
interface IState {
|
||||
|
@ -121,12 +123,12 @@ export default class ReactionsRowButton extends React.PureComponent<IProps, ISta
|
|||
label = reactors;
|
||||
}
|
||||
}
|
||||
const isPeeking = room.getMyMembership() !== "join";
|
||||
|
||||
return <AccessibleButton
|
||||
className={classes}
|
||||
aria-label={label}
|
||||
onClick={this.onClick}
|
||||
disabled={isPeeking}
|
||||
disabled={this.props.disabled}
|
||||
onMouseOver={this.onMouseOver}
|
||||
onMouseLeave={this.onMouseLeave}
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue