mirror of
				https://github.com/owncast/owncast.git
				synced 2025-11-01 02:44:31 +08:00 
			
		
		
		
	Show moderation menu for moderators. Closes #1864
This commit is contained in:
		| @ -17,15 +17,13 @@ import ChatJoinMessage from '../ChatJoinMessage/ChatJoinMessage'; | ||||
|  | ||||
| interface Props { | ||||
|   messages: ChatMessage[]; | ||||
|   // loading: boolean; | ||||
|   usernameToHighlight: string; | ||||
|   chatUserId: string; | ||||
|   isModerator: boolean; | ||||
|   isMobile: boolean | undefined; | ||||
| } | ||||
|  | ||||
| export default function ChatContainer(props: Props) { | ||||
|   const { messages, usernameToHighlight, chatUserId, isModerator, isMobile } = props; | ||||
|   const { messages, usernameToHighlight, chatUserId, isModerator } = props; | ||||
|  | ||||
|   const [atBottom, setAtBottom] = useState(false); | ||||
|   // const [showButton, setShowButton] = useState(false); | ||||
| @ -146,7 +144,7 @@ export default function ChatContainer(props: Props) { | ||||
|         )} | ||||
|       </> | ||||
|     ), | ||||
|     [messages, usernameToHighlight, chatUserId, isModerator, atBottom, isMobile], | ||||
|     [messages, usernameToHighlight, chatUserId, isModerator, atBottom], | ||||
|   ); | ||||
|  | ||||
|   return ( | ||||
|  | ||||
| @ -12,7 +12,6 @@ import ChatModeration from '../../../services/moderation-service'; | ||||
|  | ||||
| const { confirm } = Modal; | ||||
|  | ||||
| /* eslint-disable @typescript-eslint/no-unused-vars */ | ||||
| interface Props { | ||||
|   accessToken: string; | ||||
|   messageID: string; | ||||
|  | ||||
| @ -339,8 +339,8 @@ export function ClientConfigStore() { | ||||
|  | ||||
|       const metadata = mergeMeta(state.meta) as AppStateOptions; | ||||
|  | ||||
|       console.debug('--- APP STATE: ', state.value); | ||||
|       console.debug('--- APP META: ', metadata); | ||||
|       // console.debug('--- APP STATE: ', state.value); | ||||
|       // console.debug('--- APP META: ', metadata); | ||||
|  | ||||
|       setAppState(metadata); | ||||
|     }); | ||||
|  | ||||
| @ -13,6 +13,6 @@ export default function handleConnectedClientInfoMessage( | ||||
|   setChatDisplayName(displayName); | ||||
|   setChatDisplayColor(displayColor); | ||||
|   setChatUserId(id); | ||||
|   setIsChatModerator(scopes?.includes('moderator')); | ||||
|   setIsChatModerator(scopes?.includes('MODERATOR')); | ||||
|   setChatAuthenticated(authenticated); | ||||
| } | ||||
|  | ||||
| @ -172,7 +172,6 @@ export default function ContentComponent() { | ||||
|                       usernameToHighlight={chatDisplayName} | ||||
|                       chatUserId={chatUserId} | ||||
|                       isModerator={false} | ||||
|                       isMobile={isMobile} | ||||
|                     /> | ||||
|                   </div> | ||||
|                 </div> | ||||
|  | ||||
| @ -8,12 +8,14 @@ import { | ||||
|   chatMessagesAtom, | ||||
|   chatDisplayNameAtom, | ||||
|   chatUserIdAtom, | ||||
|   isChatModeratorAtom, | ||||
| } from '../../stores/ClientConfigStore'; | ||||
|  | ||||
| export default function Sidebar() { | ||||
|   const messages = useRecoilValue<ChatMessage[]>(chatMessagesAtom); | ||||
|   const chatDisplayName = useRecoilValue<string>(chatDisplayNameAtom); | ||||
|   const chatUserId = useRecoilValue<string>(chatUserIdAtom); | ||||
|   const isChatModerator = useRecoilValue<boolean>(isChatModeratorAtom); | ||||
|  | ||||
|   return ( | ||||
|     <Sider className={s.root} collapsedWidth={0} width={320}> | ||||
| @ -21,8 +23,7 @@ export default function Sidebar() { | ||||
|         messages={messages} | ||||
|         usernameToHighlight={chatDisplayName} | ||||
|         chatUserId={chatUserId} | ||||
|         isModerator={false} | ||||
|         isMobile={false} | ||||
|         isModerator={isChatModerator} | ||||
|       /> | ||||
|     </Sider> | ||||
|   ); | ||||
|  | ||||
| @ -38,7 +38,6 @@ const AddMessagesChatExample = args => { | ||||
|         usernameToHighlight="testuser" | ||||
|         chatUserId="testuser" | ||||
|         isModerator={false} | ||||
|         isMobile={false} | ||||
|       /> | ||||
|     </RecoilRoot> | ||||
|   ); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Gabe Kangas
					Gabe Kangas