* Renders the component. * @return Element to render.
()
| 19 | * @return Element to render. |
| 20 | */ |
| 21 | public render() { |
| 22 | const { |
| 23 | clearChat, |
| 24 | isMod, |
| 25 | openModView, |
| 26 | roomState, |
| 27 | toggleR9k, |
| 28 | toggleFollowersOnly, |
| 29 | toggleSubsOnly, |
| 30 | toggleEmoteOnly, |
| 31 | } = this.props |
| 32 | |
| 33 | if (_.isNil(roomState) || !isMod) { |
| 34 | return null |
| 35 | } |
| 36 | |
| 37 | return ( |
| 38 | <> |
| 39 | <MenuDivider title="Mode" /> |
| 40 | <MenuItem |
| 41 | icon={this.getStateMenuIcon('r9k')} |
| 42 | text="Unique chat" |
| 43 | labelElement={<Icon icon="multi-select" />} |
| 44 | onClick={toggleR9k} |
| 45 | /> |
| 46 | <MenuItem icon={this.getStateMenuIcon('slow')} text="Slow mode" onClick={this.toggleSlowMode}> |
| 47 | <MenuDivider |
| 48 | title={ |
| 49 | <> |
| 50 | <Icon icon="outdated" /> Slow mode |
| 51 | </> |
| 52 | } |
| 53 | /> |
| 54 | {_.map(SlowModeDurations, (slowModeDuration) => ( |
| 55 | <MenuItem |
| 56 | onClick={(event: React.MouseEvent) => this.toggleSlowMode(event, slowModeDuration)} |
| 57 | text={`${slowModeDuration} ${pluralize('second', slowModeDuration)}`} |
| 58 | icon={this.getSlowModeMenuIcon(slowModeDuration)} |
| 59 | key={slowModeDuration} |
| 60 | /> |
| 61 | ))} |
| 62 | </MenuItem> |
| 63 | <MenuItem |
| 64 | icon={this.getStateMenuIcon('followersOnly')} |
| 65 | text="Follower-only" |
| 66 | labelElement={<Icon icon="follower" />} |
| 67 | onClick={toggleFollowersOnly} |
| 68 | /> |
| 69 | <MenuItem |
| 70 | icon={this.getStateMenuIcon('subsOnly')} |
| 71 | text="Subscribers-only" |
| 72 | labelElement={<Icon icon="dollar" />} |
| 73 | onClick={toggleSubsOnly} |
| 74 | /> |
| 75 | <MenuItem |
| 76 | icon={this.getStateMenuIcon('emoteOnly')} |
| 77 | text="Emote-only" |
| 78 | labelElement={<Icon icon="media" />} |
nothing calls this directly
no test coverage detected