Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

⚡️(frontend) gate LowerAllHandsButton with AdminOrOwnerOnly

lebaudantoine29672cda6bab
diff --git a/src/frontend/src/features/participants/components/LowerAllHandsButton.tsx b/src/frontend/src/features/participants/components/LowerAllHandsButton.tsx
index af9da045..434ecd1e 100644
--- a/src/frontend/src/features/participants/components/LowerAllHandsButton.tsx
+++ b/src/frontend/src/features/participants/components/LowerAllHandsButton.tsx
@@ -2,22 +2,21 @@ import { Button } from '@/primitives'
import { useTranslation } from 'react-i18next'
import type { Participant } from 'livekit-client'
import { useLowerHandParticipants } from '../api/lowerHandParticipants'
-import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
import { css } from '@/styled-system/css'
import { RiHand } from '@remixicon/react'
+import { AdminOrOwnerOnly } from '@/features/rooms/components/AdminOrOwnerOnly'
type LowerAllHandsButtonProps = {
participants: Array<Participant>
}
-export const LowerAllHandsButton = ({
+const LowerAllHandsButtonInner = ({
participants,
}: LowerAllHandsButtonProps) => {
const { lowerHandParticipants } = useLowerHandParticipants()
const { t } = useTranslation('rooms')
- const isAdminOrOwner = useIsAdminOrOwner()
- if (!isAdminOrOwner) return null
+ if (!participants.length) return null
return (
<Button
@@ -36,3 +35,13 @@ export const LowerAllHandsButton = ({
</Button>
)
}
+
+export const LowerAllHandsButton = ({
+ participants,
+}: LowerAllHandsButtonProps) => {
+ return (
+ <AdminOrOwnerOnly>
+ <LowerAllHandsButtonInner participants={participants} />
+ </AdminOrOwnerOnly>
+ )
+}