import {gql} from '@apollo/client'; import React, { useState } from "react"; import usePatchedSubscription from "./usePatchedSubscription"; const ParentOfUserList = ({userId}) => { const [shouldRender, setShouldRender] = useState(true); return (
Userlist: { console.log(e.target.checked); setShouldRender(e.target.checked); } }> {shouldRender && }
); } function UserList({userId}) { const { loading, error, data } = usePatchedSubscription( gql`subscription { user(limit: 50, order_by: [ {role: asc}, {emojiTime: asc_nulls_last}, {isDialIn: desc}, {hasDrawPermissionOnCurrentPage: desc}, {name: asc}, {userId: asc} ]) { userId name role color emoji avatar presenter pinned locked authed mobile clientType disconnected loggedOut voice { joined listenOnly talking muted } cameras { streamId } hasDrawPermissionOnCurrentPage lastBreakoutRoom { isDefaultName sequence shortName currentlyInRoom } connectionStatus { connectionAliveAt } } }` ); return !loading && !error && ( {/**/} {data.map((user) => { console.log('user', user); return ( {/**/} ); })}
IdName Role Emoji Avatar Presenter Mobile ClientType Sharing Camera Whiteboard Multiuser Pinned Sharing Mic ListenOnly Talking Muted Locked Last BreakoutRoom connectionAliveAt Disconnected (leftFlag) LoggedOut
{user.userId}
{user.name}
{user.role} {user.emoji} {user.avatar} {user.presenter === true ? 'Yes' : 'No'} {user.mobile === true ? 'Yes' : 'No'} {user.clientType} 0 ? '#A0DAA9' : ''}}>{user.cameras.length > 0 ? 'Yes' : 'No'} {user.hasDrawPermissionOnCurrentPage ? 'Yes' : 'No'} {user.pinned === true ? 'Yes' : 'No'} {user.voice?.joined === true ? 'Yes' : 'No'} {user.voice?.listenOnly === true ? 'Yes' : 'No'} {user.voice?.talking === true ? 'Yes' : 'No'} {user.voice?.muted === true ? 'Yes' : 'No'} {user.locked === true ? 'Yes' : 'No'} {user.lastBreakoutRoom?.shortName}{user.lastBreakoutRoom?.currentlyInRoom === true ? ' (Online)' : ''} {user?.connectionStatus?.connectionAliveAt} {user.disconnected === true ? 'Yes' : 'No'} {user.loggedOut === true ? 'Yes' : 'No'}
); } export default ParentOfUserList;