Move presenter logic to video grid

This commit is contained in:
Robert Long
2021-08-26 12:34:00 -07:00
parent 23763422d8
commit c094e820d1
5 changed files with 61 additions and 54 deletions

View File

@@ -20,19 +20,6 @@ export function GridDemo() {
]);
}, [stream]);
const togglePresenter = useCallback((selectedParticipant) => {
setParticipants((participants) =>
participants.map((participant) =>
participant === selectedParticipant
? {
...participant,
presenter: !participant.presenter,
}
: participant
)
);
}, []);
const removeParticipant = useCallback((key) => {
setParticipants((participants) =>
participants.filter((participant) => participant.userId !== key)
@@ -56,7 +43,7 @@ export function GridDemo() {
</button>
)}
</div>
<VideoGrid participants={participants} onClickNameTag={togglePresenter} />
<VideoGrid participants={participants} />
</div>
);
}