Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: conditions for showing more actions #1982

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,10 @@ export const Participant = ({ peer, isConnected }) => {
const ParticipantActions = React.memo(({ peerId, role, isLocal }) => {
const isHandRaised = useHMSStore(selectHasPeerHandRaised(peerId));
const canChangeRole = useHMSStore(selectPermissions)?.changeRole;
const shouldShowMoreActions = canChangeRole;
const canRemoveOthers = useHMSStore(selectPermissions)?.removeOthers;
const { elements } = useRoomLayoutConferencingScreen();
const { on_stage_exp } = elements || {};
const shouldShowMoreActions = (on_stage_exp && canChangeRole) || canRemoveOthers;
const isAudioMuted = !useHMSStore(selectIsPeerAudioEnabled(peerId));

return (
Expand Down Expand Up @@ -212,15 +215,21 @@ const ParticipantActions = React.memo(({ peerId, role, isLocal }) => {
</Flex>
) : null}

{shouldShowMoreActions && !isLocal ? <ParticipantMoreActions peerId={peerId} role={role} /> : null}
{shouldShowMoreActions && !isLocal ? (
<ParticipantMoreActions
peerId={peerId}
role={role}
elements={elements}
canChangeRole={canChangeRole}
canRemoveOthers={canRemoveOthers}
/>
) : null}
</Flex>
);
});

const ParticipantMoreActions = ({ peerId, role }) => {
const ParticipantMoreActions = ({ peerId, role, elements, canChangeRole, canRemoveOthers }) => {
const hmsActions = useHMSActions();
const { changeRole: canChangeRole, removeOthers: canRemoveOthers } = useHMSStore(selectPermissions);
const { elements } = useRoomLayoutConferencingScreen();
const {
bring_to_stage_label,
remove_from_stage_label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const RoleAccordion = ({
icon={<AddCircleIcon />}
content="Load More"
onClick={loadNext}
backgroundColor="$secodary_default"
backgroundColor="$secondary_default"
css={{
w: 'max-content',
borderRadius: '$size$9',
Expand Down
Loading