Skip to content

armgit / meet

Public Imported from GitHub
0

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

🚚(frontend) move participant list code into a feature folder

lebaudantoined1dde71bea94
diff --git a/src/frontend/src/features/notifications/components/WaitingParticipantNotification.tsx b/src/frontend/src/features/notifications/components/WaitingParticipantNotification.tsx
index 80ad8fb2..bead7e36 100644
--- a/src/frontend/src/features/notifications/components/WaitingParticipantNotification.tsx
+++ b/src/frontend/src/features/notifications/components/WaitingParticipantNotification.tsx
@@ -7,8 +7,8 @@ import { RiInfinityLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import { useEffect, useRef, useState } from 'react'
import { usePrevious } from '@/hooks/usePrevious'
-import { WaitingParticipant } from '@/features/rooms/api/listWaitingParticipants'
-import { useWaitingParticipants } from '@/features/rooms/hooks/useWaitingParticipants'
+import type { WaitingParticipant } from '@/features/participants/api/listWaitingParticipants'
+import { useWaitingParticipants } from '@/features/participants/hooks/useWaitingParticipants'
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
import { useNotificationSound } from '../hooks/useSoundNotification'
import { NotificationType } from '@/features/notifications'
diff --git a/src/frontend/src/features/rooms/api/enterRoom.ts b/src/frontend/src/features/participants/api/enterRoom.ts
similarity index 100%
rename from src/frontend/src/features/rooms/api/enterRoom.ts
rename to src/frontend/src/features/participants/api/enterRoom.ts
diff --git a/src/frontend/src/features/rooms/api/listWaitingParticipants.ts b/src/frontend/src/features/participants/api/listWaitingParticipants.ts
similarity index 100%
rename from src/frontend/src/features/rooms/api/listWaitingParticipants.ts
rename to src/frontend/src/features/participants/api/listWaitingParticipants.ts
diff --git a/src/frontend/src/features/rooms/api/lowerHandParticipant.ts b/src/frontend/src/features/participants/api/lowerHandParticipant.ts
similarity index 100%
rename from src/frontend/src/features/rooms/api/lowerHandParticipant.ts
rename to src/frontend/src/features/participants/api/lowerHandParticipant.ts
diff --git a/src/frontend/src/features/rooms/api/lowerHandParticipants.ts b/src/frontend/src/features/participants/api/lowerHandParticipants.ts
similarity index 100%
rename from src/frontend/src/features/rooms/api/lowerHandParticipants.ts
rename to src/frontend/src/features/participants/api/lowerHandParticipants.ts
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/HandRaisedListItem.tsx b/src/frontend/src/features/participants/components/HandRaisedListItem.tsx
similarity index 96%
rename from src/frontend/src/features/rooms/livekit/components/controls/Participants/HandRaisedListItem.tsx
rename to src/frontend/src/features/participants/components/HandRaisedListItem.tsx
index 11689f99..b3987ca8 100644
--- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/HandRaisedListItem.tsx
+++ b/src/frontend/src/features/participants/components/HandRaisedListItem.tsx
@@ -4,7 +4,7 @@ import { HStack } from '@/styled-system/jsx'
import { Text } from '@/primitives/Text'
import { useTranslation } from 'react-i18next'
import { Avatar } from '@/components/Avatar'
-import { useLowerHandParticipant } from '@/features/rooms/api/lowerHandParticipant'
+import { useLowerHandParticipant } from '../api/lowerHandParticipant'
import { getParticipantColor } from '@/features/rooms/utils/getParticipantColor'
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
import type { Participant } from 'livekit-client'
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/LowerAllHandsButton.tsx b/src/frontend/src/features/participants/components/LowerAllHandsButton.tsx
similarity index 92%
rename from src/frontend/src/features/rooms/livekit/components/controls/Participants/LowerAllHandsButton.tsx
rename to src/frontend/src/features/participants/components/LowerAllHandsButton.tsx
index ea8aa949..af9da045 100644
--- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/LowerAllHandsButton.tsx
+++ b/src/frontend/src/features/participants/components/LowerAllHandsButton.tsx
@@ -1,7 +1,7 @@
import { Button } from '@/primitives'
import { useTranslation } from 'react-i18next'
import type { Participant } from 'livekit-client'
-import { useLowerHandParticipants } from '@/features/rooms/api/lowerHandParticipants'
+import { useLowerHandParticipants } from '../api/lowerHandParticipants'
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
import { css } from '@/styled-system/css'
import { RiHand } from '@remixicon/react'
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/MuteEveryoneButton.tsx b/src/frontend/src/features/participants/components/MuteEveryoneButton.tsx
similarity index 100%
rename from src/frontend/src/features/rooms/livekit/components/controls/Participants/MuteEveryoneButton.tsx
rename to src/frontend/src/features/participants/components/MuteEveryoneButton.tsx
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx b/src/frontend/src/features/participants/components/ParticipantListItem.tsx
similarity index 96%
rename from src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx
rename to src/frontend/src/features/participants/components/ParticipantListItem.tsx
index 3fd8333d..bf4a8256 100644
--- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantListItem.tsx
+++ b/src/frontend/src/features/participants/components/ParticipantListItem.tsx
@@ -16,11 +16,11 @@ import Source = Track.Source
import { RiMicFill, RiMicOffFill } from '@remixicon/react'
import { Button } from '@/primitives'
import { useState } from 'react'
-import { MuteAlertDialog } from '../../MuteAlertDialog'
import { useMuteParticipant } from '@/features/rooms/api/muteParticipant'
import { useCanMute } from '@/features/rooms/livekit/hooks/useCanMute'
-import { ParticipantMenuButton } from '../../ParticipantMenu/ParticipantMenuButton'
+import { ParticipantMenuButton } from './menu/ParticipantMenuButton'
import { PinBadge } from './PinBadge'
+import { MuteAlertDialog } from '@/features/rooms/livekit/components/MuteAlertDialog'
type MicIndicatorProps = {
participant: Participant
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsCollapsableList.tsx b/src/frontend/src/features/participants/components/ParticipantsCollapsableList.tsx
similarity index 100%
rename from src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsCollapsableList.tsx
rename to src/frontend/src/features/participants/components/ParticipantsCollapsableList.tsx
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx b/src/frontend/src/features/participants/components/ParticipantsList.tsx
similarity index 87%
rename from src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx
rename to src/frontend/src/features/participants/components/ParticipantsList.tsx
index 0fc82a3a..ebeefa37 100644
--- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx
+++ b/src/frontend/src/features/participants/components/ParticipantsList.tsx
@@ -3,14 +3,14 @@ import { useParticipants } from '@livekit/components-react'
import { Div, H } from '@/primitives'
import { useTranslation } from 'react-i18next'
-import { ParticipantListItem } from '../../controls/Participants/ParticipantListItem'
-import { ParticipantsCollapsableList } from '../../controls/Participants/ParticipantsCollapsableList'
-import { HandRaisedListItem } from '../../controls/Participants/HandRaisedListItem'
-import { LowerAllHandsButton } from '../../controls/Participants/LowerAllHandsButton'
+import { ParticipantListItem } from './ParticipantListItem'
+import { ParticipantsCollapsableList } from './ParticipantsCollapsableList'
+import { HandRaisedListItem } from './HandRaisedListItem'
+import { LowerAllHandsButton } from './LowerAllHandsButton'
import { WaitingParticipantListItem } from './WaitingParticipantListItem'
-import { useWaitingParticipants } from '@/features/rooms/hooks/useWaitingParticipants'
+import { useWaitingParticipants } from '@/features/participants/hooks/useWaitingParticipants'
import type { Participant } from 'livekit-client'
-import { WaitingParticipant } from '@/features/rooms/api/listWaitingParticipants'
+import { WaitingParticipant } from '@/features/participants/api/listWaitingParticipants'
import { MuteEveryoneButton } from './MuteEveryoneButton'
// TODO: Optimize rendering performance, especially for longer participant lists, even though they are generally short.
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/PinBadge.tsx b/src/frontend/src/features/participants/components/PinBadge.tsx
similarity index 100%
rename from src/frontend/src/features/rooms/livekit/components/controls/Participants/PinBadge.tsx
rename to src/frontend/src/features/participants/components/PinBadge.tsx
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/WaitingParticipantListItem.tsx b/src/frontend/src/features/participants/components/WaitingParticipantListItem.tsx
similarity index 96%
rename from src/frontend/src/features/rooms/livekit/components/controls/Participants/WaitingParticipantListItem.tsx
rename to src/frontend/src/features/participants/components/WaitingParticipantListItem.tsx
index 3e32c3e0..6da75eab 100644
--- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/WaitingParticipantListItem.tsx
+++ b/src/frontend/src/features/participants/components/WaitingParticipantListItem.tsx
@@ -3,7 +3,7 @@ import { HStack } from '@/styled-system/jsx'
import { css } from '@/styled-system/css'
import { Avatar } from '@/components/Avatar'
import { useTranslation } from 'react-i18next'
-import { WaitingParticipant } from '@/features/rooms/api/listWaitingParticipants'
+import { WaitingParticipant } from '../api/listWaitingParticipants'
import { RiCloseLine } from '@remixicon/react'
export const WaitingParticipantListItem = ({
diff --git a/src/frontend/src/features/rooms/livekit/components/ParticipantMenu/ParticipantMenu.tsx b/src/frontend/src/features/participants/components/menu/ParticipantMenu.tsx
similarity index 85%
rename from src/frontend/src/features/rooms/livekit/components/ParticipantMenu/ParticipantMenu.tsx
rename to src/frontend/src/features/participants/components/menu/ParticipantMenu.tsx
index 1ada58c8..2cc6397e 100644
--- a/src/frontend/src/features/rooms/livekit/components/ParticipantMenu/ParticipantMenu.tsx
+++ b/src/frontend/src/features/participants/components/menu/ParticipantMenu.tsx
@@ -1,8 +1,8 @@
import { Menu as RACMenu } from 'react-aria-components'
import type { Participant } from 'livekit-client'
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
-import { PinMenuItem } from './PinMenuItem'
-import { RemoveMenuItem } from './RemoveMenuItem'
+import { PinMenuItem } from './items/PinMenuItem'
+import { RemoveMenuItem } from './items/RemoveMenuItem'
export const ParticipantMenu = ({
participant,
diff --git a/src/frontend/src/features/rooms/livekit/components/ParticipantMenu/ParticipantMenuButton.tsx b/src/frontend/src/features/participants/components/menu/ParticipantMenuButton.tsx
similarity index 100%
rename from src/frontend/src/features/rooms/livekit/components/ParticipantMenu/ParticipantMenuButton.tsx
rename to src/frontend/src/features/participants/components/menu/ParticipantMenuButton.tsx
diff --git a/src/frontend/src/features/rooms/livekit/components/ParticipantMenu/PinMenuItem.tsx b/src/frontend/src/features/participants/components/menu/items/PinMenuItem.tsx
similarity index 100%
rename from src/frontend/src/features/rooms/livekit/components/ParticipantMenu/PinMenuItem.tsx
rename to src/frontend/src/features/participants/components/menu/items/PinMenuItem.tsx
diff --git a/src/frontend/src/features/rooms/livekit/components/ParticipantMenu/RemoveMenuItem.tsx b/src/frontend/src/features/participants/components/menu/items/RemoveMenuItem.tsx
similarity index 100%
rename from src/frontend/src/features/rooms/livekit/components/ParticipantMenu/RemoveMenuItem.tsx
rename to src/frontend/src/features/participants/components/menu/items/RemoveMenuItem.tsx
diff --git a/src/frontend/src/features/rooms/hooks/useWaitingParticipants.ts b/src/frontend/src/features/participants/hooks/useWaitingParticipants.ts
similarity index 97%
rename from src/frontend/src/features/rooms/hooks/useWaitingParticipants.ts
rename to src/frontend/src/features/participants/hooks/useWaitingParticipants.ts
index 9b8459ff..825ff7e4 100644
--- a/src/frontend/src/features/rooms/hooks/useWaitingParticipants.ts
+++ b/src/frontend/src/features/participants/hooks/useWaitingParticipants.ts
@@ -7,7 +7,7 @@ import { useEnterRoom } from '../api/enterRoom'
import {
useListWaitingParticipants,
type WaitingParticipant,
-} from '../api/listWaitingParticipants'
+} from '../../participants/api/listWaitingParticipants'
import { decodeNotificationDataReceived } from '@/features/notifications/utils'
import { NotificationType } from '@/features/notifications/NotificationType'
diff --git a/src/frontend/src/features/rooms/livekit/components/SidePanel.tsx b/src/frontend/src/features/rooms/livekit/components/SidePanel.tsx
index e5940c17..67297a5e 100644
--- a/src/frontend/src/features/rooms/livekit/components/SidePanel.tsx
+++ b/src/frontend/src/features/rooms/livekit/components/SidePanel.tsx
@@ -5,7 +5,7 @@ import { text } from '@/primitives/Text'
import { Button, Div } from '@/primitives'
import { RiArrowLeftLine, RiCloseLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
-import { ParticipantsList } from './controls/Participants/ParticipantsList'
+import { ParticipantsList } from '@/features/participants/components/ParticipantsList'
import { PanelId, useSidePanel } from '../hooks/useSidePanel'
import React, { ReactNode, useCallback, useRef } from 'react'
import { Chat } from '@/features/chat/components/Chat'
diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsToggle.tsx b/src/frontend/src/features/rooms/livekit/components/controls/ParticipantsToggle.tsx
similarity index 97%
rename from src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsToggle.tsx
rename to src/frontend/src/features/rooms/livekit/components/controls/ParticipantsToggle.tsx
index 8e205f90..5f809198 100644
--- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsToggle.tsx
+++ b/src/frontend/src/features/rooms/livekit/components/controls/ParticipantsToggle.tsx
@@ -4,10 +4,10 @@ import { ToggleButton } from '@/primitives'
import { VisualOnlyTooltip } from '@/primitives/VisualOnlyTooltip'
import { css } from '@/styled-system/css'
import { useRemoteParticipants } from '@livekit/components-react'
-import { useSidePanel } from '../../../hooks/useSidePanel'
import { ToggleButtonProps } from '@/primitives/ToggleButton'
import { useRegisterKeyboardShortcut } from '@/features/shortcuts/useRegisterKeyboardShortcut'
import { RoomEvent } from 'livekit-client'
+import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
export const ParticipantsToggle = ({
onPress,
diff --git a/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/MobileControlBar.tsx b/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/MobileControlBar.tsx
index 663a2039..a9221124 100644
--- a/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/MobileControlBar.tsx
+++ b/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/MobileControlBar.tsx
@@ -15,7 +15,7 @@ import {
} from '@remixicon/react'
import { ScreenShareToggle } from '../../components/controls/ScreenShareToggle'
import { ChatToggle } from '../../components/controls/ChatToggle'
-import { ParticipantsToggle } from '../../components/controls/Participants/ParticipantsToggle'
+import { ParticipantsToggle } from '../../components/controls/ParticipantsToggle'
import { useSidePanel } from '../../hooks/useSidePanel'
import { LinkButton } from '@/primitives'
import { ResponsiveMenu } from './ResponsiveMenu'
diff --git a/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/MoreOptions.tsx b/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/MoreOptions.tsx
index 482c8474..e571d655 100644
--- a/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/MoreOptions.tsx
+++ b/src/frontend/src/features/rooms/livekit/prefabs/ControlBar/MoreOptions.tsx
@@ -1,6 +1,6 @@
import { css } from '@/styled-system/css'
import { ChatToggle } from '../../components/controls/ChatToggle'
-import { ParticipantsToggle } from '../../components/controls/Participants/ParticipantsToggle'
+import { ParticipantsToggle } from '../../components/controls/ParticipantsToggle'
import { ToolsToggle } from '../../components/controls/ToolsToggle'
import { InfoToggle } from '../../components/controls/InfoToggle'
import { AdminToggle } from '../../components/AdminToggle'