Skip to content

armgit / meet

Public Imported from GitHub
0

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

♻️(frontend) extract recording hooks into a dedicated folder

lebaudantoine695ac4701453
diff --git a/src/frontend/src/features/rooms/livekit/hooks/useHasScreenRecordingAccess.ts b/src/frontend/src/features/recording/hooks/useHasRecordingAccess.ts
similarity index 89%
rename from src/frontend/src/features/rooms/livekit/hooks/useHasScreenRecordingAccess.ts
rename to src/frontend/src/features/recording/hooks/useHasRecordingAccess.ts
index 0f578b2e..50db91c9 100644
--- a/src/frontend/src/features/rooms/livekit/hooks/useHasScreenRecordingAccess.ts
+++ b/src/frontend/src/features/recording/hooks/useHasRecordingAccess.ts
@@ -2,7 +2,7 @@ import { useFeatureFlagEnabled } from 'posthog-js/react'
import { useIsAnalyticsEnabled } from '@/features/analytics/hooks/useIsAnalyticsEnabled'
import { RecordingMode } from '@/features/rooms/api/startRecording'
import { useIsRecordingModeEnabled } from './useIsRecordingModeEnabled'
-import { useIsAdminOrOwner } from './useIsAdminOrOwner'
+import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
export const useHasRecordingAccess = (
mode: RecordingMode,
diff --git a/src/frontend/src/features/rooms/livekit/hooks/useIsRecordingModeEnabled.ts b/src/frontend/src/features/recording/hooks/useIsRecordingModeEnabled.ts
similarity index 100%
rename from src/frontend/src/features/rooms/livekit/hooks/useIsRecordingModeEnabled.ts
rename to src/frontend/src/features/recording/hooks/useIsRecordingModeEnabled.ts
diff --git a/src/frontend/src/features/rooms/livekit/hooks/useIsRecordingStarted.ts b/src/frontend/src/features/recording/hooks/useIsRecordingStarted.ts
similarity index 100%
rename from src/frontend/src/features/rooms/livekit/hooks/useIsRecordingStarted.ts
rename to src/frontend/src/features/recording/hooks/useIsRecordingStarted.ts
diff --git a/src/frontend/src/features/rooms/livekit/hooks/useIsRecordingTransitioning.ts b/src/frontend/src/features/recording/hooks/useIsRecordingTransitioning.ts
similarity index 100%
rename from src/frontend/src/features/rooms/livekit/hooks/useIsRecordingTransitioning.ts
rename to src/frontend/src/features/recording/hooks/useIsRecordingTransitioning.ts
diff --git a/src/frontend/src/features/recording/index.ts b/src/frontend/src/features/recording/index.ts
new file mode 100644
index 00000000..83ac83ed
--- /dev/null
+++ b/src/frontend/src/features/recording/index.ts
@@ -0,0 +1,7 @@
+export { useIsRecordingModeEnabled } from './hooks/useIsRecordingModeEnabled'
+export {
+ useIsScreenRecordingStarted,
+ useIsTranscriptStarted,
+} from './hooks/useIsRecordingStarted'
+export { useIsRecordingTransitioning } from './hooks/useIsRecordingTransitioning'
+export { useHasRecordingAccess } from './hooks/useHasRecordingAccess'
diff --git a/src/frontend/src/features/rooms/livekit/components/ScreenRecording.tsx b/src/frontend/src/features/rooms/livekit/components/ScreenRecording.tsx
index ff2cb2ff..1ea2fb6b 100644
--- a/src/frontend/src/features/rooms/livekit/components/ScreenRecording.tsx
+++ b/src/frontend/src/features/rooms/livekit/components/ScreenRecording.tsx
@@ -16,11 +16,11 @@ import { NotificationPayload } from '@/features/notifications/NotificationPayloa
import { NotificationType } from '@/features/notifications/NotificationType'
import { RecordingStatus, recordingStore } from '@/stores/recording'
import { CRISP_HELP_ARTICLE_RECORDING } from '@/utils/constants'
-import { useIsRecordingTransitioning } from '../hooks/useIsRecordingTransitioning'
import {
+ useIsRecordingTransitioning,
useIsScreenRecordingStarted,
useIsTranscriptStarted,
-} from '../hooks/useIsRecordingStarted'
+} from '@/features/recording'
export const ScreenRecording = () => {
const [isLoading, setIsLoading] = useState(false)
diff --git a/src/frontend/src/features/rooms/livekit/components/Tools.tsx b/src/frontend/src/features/rooms/livekit/components/Tools.tsx
index 6ed14a16..d162397e 100644
--- a/src/frontend/src/features/rooms/livekit/components/Tools.tsx
+++ b/src/frontend/src/features/rooms/livekit/components/Tools.tsx
@@ -5,11 +5,11 @@ import { useTranslation } from 'react-i18next'
import { CRISP_HELP_ARTICLE_MORE_TOOLS } from '@/utils/constants'
import { ReactNode } from 'react'
import { Transcript } from './Transcript'
-import { useIsRecordingModeEnabled } from '../hooks/useIsRecordingModeEnabled'
import { RiFileTextFill, RiLiveFill } from '@remixicon/react'
import { SubPanelId, useSidePanel } from '../hooks/useSidePanel'
import { ScreenRecording } from './ScreenRecording'
import { RecordingMode } from '@/features/rooms/api/startRecording'
+import { useIsRecordingModeEnabled } from '@/features/recording'
export interface ToolsButtonProps {
icon: ReactNode
diff --git a/src/frontend/src/features/rooms/livekit/components/Transcript.tsx b/src/frontend/src/features/rooms/livekit/components/Transcript.tsx
index 66f0ddd4..26252a0f 100644
--- a/src/frontend/src/features/rooms/livekit/components/Transcript.tsx
+++ b/src/frontend/src/features/rooms/livekit/components/Transcript.tsx
@@ -15,16 +15,16 @@ import { useTranslation } from 'react-i18next'
import { NotificationPayload } from '@/features/notifications/NotificationPayload'
import { NotificationType } from '@/features/notifications/NotificationType'
import { RecordingStatus, recordingStore } from '@/stores/recording'
-import { useHasRecordingAccess } from '../hooks/useHasScreenRecordingAccess'
import {
BETA_USERS_FORM_URL,
CRISP_HELP_ARTICLE_TRANSCRIPT,
} from '@/utils/constants'
-import { useIsRecordingTransitioning } from '../hooks/useIsRecordingTransitioning'
import {
useIsScreenRecordingStarted,
useIsTranscriptStarted,
-} from '../hooks/useIsRecordingStarted'
+ useIsRecordingTransitioning,
+ useHasRecordingAccess,
+} from '@/features/recording'
export const Transcript = () => {
const [isLoading, setIsLoading] = useState(false)