@syra.fm/sdk 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/client.js +268 -0
- package/lib/commonjs/client.js.map +1 -0
- package/lib/commonjs/errors.js +22 -0
- package/lib/commonjs/errors.js.map +1 -0
- package/lib/commonjs/index.js +63 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/index.native.js +28 -0
- package/lib/commonjs/index.native.js.map +1 -0
- package/lib/commonjs/live/assets/icons/spaces-icon.js +42 -0
- package/lib/commonjs/live/assets/icons/spaces-icon.js.map +1 -0
- package/lib/commonjs/live/assets/icons/syra-icon.js +43 -0
- package/lib/commonjs/live/assets/icons/syra-icon.js.map +1 -0
- package/lib/commonjs/live/components/AnimatedPulse.js +38 -0
- package/lib/commonjs/live/components/AnimatedPulse.js.map +1 -0
- package/lib/commonjs/live/components/AnimatedSpeakerRing.js +90 -0
- package/lib/commonjs/live/components/AnimatedSpeakerRing.js.map +1 -0
- package/lib/commonjs/live/components/CreateRoomSheet.js +688 -0
- package/lib/commonjs/live/components/CreateRoomSheet.js.map +1 -0
- package/lib/commonjs/live/components/InsightsPanel.js +333 -0
- package/lib/commonjs/live/components/InsightsPanel.js.map +1 -0
- package/lib/commonjs/live/components/LiveRoomSheet.js +1195 -0
- package/lib/commonjs/live/components/LiveRoomSheet.js.map +1 -0
- package/lib/commonjs/live/components/MiniRoomBar.js +161 -0
- package/lib/commonjs/live/components/MiniRoomBar.js.map +1 -0
- package/lib/commonjs/live/components/PanelHeader.js +57 -0
- package/lib/commonjs/live/components/PanelHeader.js.map +1 -0
- package/lib/commonjs/live/components/PodcastStreamPicker.js +1190 -0
- package/lib/commonjs/live/components/PodcastStreamPicker.js.map +1 -0
- package/lib/commonjs/live/components/RecordingCard.js +192 -0
- package/lib/commonjs/live/components/RecordingCard.js.map +1 -0
- package/lib/commonjs/live/components/RecordingsPanel.js +304 -0
- package/lib/commonjs/live/components/RecordingsPanel.js.map +1 -0
- package/lib/commonjs/live/components/RoomCard.js +553 -0
- package/lib/commonjs/live/components/RoomCard.js.map +1 -0
- package/lib/commonjs/live/components/StreamConfigModal.js +656 -0
- package/lib/commonjs/live/components/StreamConfigModal.js.map +1 -0
- package/lib/commonjs/live/components/StreamConfigPanel.js +822 -0
- package/lib/commonjs/live/components/StreamConfigPanel.js.map +1 -0
- package/lib/commonjs/live/context/LiveConfigContext.js +46 -0
- package/lib/commonjs/live/context/LiveConfigContext.js.map +1 -0
- package/lib/commonjs/live/context/LiveRoomContext.js +195 -0
- package/lib/commonjs/live/context/LiveRoomContext.js.map +1 -0
- package/lib/commonjs/live/hooks/useActiveSpeakers.js +35 -0
- package/lib/commonjs/live/hooks/useActiveSpeakers.js.map +1 -0
- package/lib/commonjs/live/hooks/useRoomAudio.js +129 -0
- package/lib/commonjs/live/hooks/useRoomAudio.js.map +1 -0
- package/lib/commonjs/live/hooks/useRoomConnection.js +177 -0
- package/lib/commonjs/live/hooks/useRoomConnection.js.map +1 -0
- package/lib/commonjs/live/hooks/useRoomManager.js +37 -0
- package/lib/commonjs/live/hooks/useRoomManager.js.map +1 -0
- package/lib/commonjs/live/hooks/useRoomUsers.js +52 -0
- package/lib/commonjs/live/hooks/useRoomUsers.js.map +1 -0
- package/lib/commonjs/live/index.js +310 -0
- package/lib/commonjs/live/index.js.map +1 -0
- package/lib/commonjs/live/services/livekitService.js +20 -0
- package/lib/commonjs/live/services/livekitService.js.map +1 -0
- package/lib/commonjs/live/services/spaceSocketService.js +181 -0
- package/lib/commonjs/live/services/spaceSocketService.js.map +1 -0
- package/lib/commonjs/live/services/spacesService.js +642 -0
- package/lib/commonjs/live/services/spacesService.js.map +1 -0
- package/lib/commonjs/live/types.js +6 -0
- package/lib/commonjs/live/types.js.map +1 -0
- package/lib/commonjs/live/validation.js +238 -0
- package/lib/commonjs/live/validation.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/{dist/cjs → lib/commonjs}/schema.js +55 -47
- package/lib/commonjs/schema.js.map +1 -0
- package/lib/module/client.js +264 -0
- package/lib/module/client.js.map +1 -0
- package/lib/module/errors.js +17 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/index.native.js +5 -0
- package/lib/module/index.native.js.map +1 -0
- package/lib/module/live/assets/icons/spaces-icon.js +34 -0
- package/lib/module/live/assets/icons/spaces-icon.js.map +1 -0
- package/lib/module/live/assets/icons/syra-icon.js +36 -0
- package/lib/module/live/assets/icons/syra-icon.js.map +1 -0
- package/lib/module/live/components/AnimatedPulse.js +33 -0
- package/lib/module/live/components/AnimatedPulse.js.map +1 -0
- package/lib/module/live/components/AnimatedSpeakerRing.js +85 -0
- package/lib/module/live/components/AnimatedSpeakerRing.js.map +1 -0
- package/lib/module/live/components/CreateRoomSheet.js +682 -0
- package/lib/module/live/components/CreateRoomSheet.js.map +1 -0
- package/lib/module/live/components/InsightsPanel.js +327 -0
- package/lib/module/live/components/InsightsPanel.js.map +1 -0
- package/lib/module/live/components/LiveRoomSheet.js +1189 -0
- package/lib/module/live/components/LiveRoomSheet.js.map +1 -0
- package/lib/module/live/components/MiniRoomBar.js +154 -0
- package/lib/module/live/components/MiniRoomBar.js.map +1 -0
- package/lib/module/live/components/PanelHeader.js +52 -0
- package/lib/module/live/components/PanelHeader.js.map +1 -0
- package/lib/module/live/components/PodcastStreamPicker.js +1183 -0
- package/lib/module/live/components/PodcastStreamPicker.js.map +1 -0
- package/lib/module/live/components/RecordingCard.js +187 -0
- package/lib/module/live/components/RecordingCard.js.map +1 -0
- package/lib/module/live/components/RecordingsPanel.js +298 -0
- package/lib/module/live/components/RecordingsPanel.js.map +1 -0
- package/lib/module/live/components/RoomCard.js +548 -0
- package/lib/module/live/components/RoomCard.js.map +1 -0
- package/lib/module/live/components/StreamConfigModal.js +650 -0
- package/lib/module/live/components/StreamConfigModal.js.map +1 -0
- package/lib/module/live/components/StreamConfigPanel.js +816 -0
- package/lib/module/live/components/StreamConfigPanel.js.map +1 -0
- package/lib/module/live/context/LiveConfigContext.js +40 -0
- package/lib/module/live/context/LiveConfigContext.js.map +1 -0
- package/lib/module/live/context/LiveRoomContext.js +189 -0
- package/lib/module/live/context/LiveRoomContext.js.map +1 -0
- package/lib/module/live/hooks/useActiveSpeakers.js +31 -0
- package/lib/module/live/hooks/useActiveSpeakers.js.map +1 -0
- package/lib/module/live/hooks/useRoomAudio.js +125 -0
- package/lib/module/live/hooks/useRoomAudio.js.map +1 -0
- package/lib/module/live/hooks/useRoomConnection.js +173 -0
- package/lib/module/live/hooks/useRoomConnection.js.map +1 -0
- package/lib/module/live/hooks/useRoomManager.js +32 -0
- package/lib/module/live/hooks/useRoomManager.js.map +1 -0
- package/lib/module/live/hooks/useRoomUsers.js +46 -0
- package/lib/module/live/hooks/useRoomUsers.js.map +1 -0
- package/lib/module/live/index.js +38 -0
- package/lib/module/live/index.js.map +1 -0
- package/lib/module/live/services/livekitService.js +16 -0
- package/lib/module/live/services/livekitService.js.map +1 -0
- package/lib/module/live/services/spaceSocketService.js +176 -0
- package/lib/module/live/services/spaceSocketService.js.map +1 -0
- package/lib/module/live/services/spacesService.js +639 -0
- package/lib/module/live/services/spacesService.js.map +1 -0
- package/lib/module/live/types.js +4 -0
- package/lib/module/live/types.js.map +1 -0
- package/lib/module/live/validation.js +229 -0
- package/lib/module/live/validation.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/{dist/esm → lib/module}/schema.js +47 -39
- package/lib/module/schema.js.map +1 -0
- package/{dist/types → lib/typescript/commonjs}/client.d.ts +1 -0
- package/lib/typescript/commonjs/client.d.ts.map +1 -0
- package/{dist/types → lib/typescript/commonjs}/errors.d.ts +1 -0
- package/lib/typescript/commonjs/errors.d.ts.map +1 -0
- package/{dist/types → lib/typescript/commonjs}/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.native.d.ts +3 -0
- package/lib/typescript/commonjs/index.native.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/assets/icons/spaces-icon.d.ts +13 -0
- package/lib/typescript/commonjs/live/assets/icons/spaces-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/assets/icons/syra-icon.d.ts +13 -0
- package/lib/typescript/commonjs/live/assets/icons/syra-icon.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/AnimatedPulse.d.ts +8 -0
- package/lib/typescript/commonjs/live/components/AnimatedPulse.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/AnimatedSpeakerRing.d.ts +10 -0
- package/lib/typescript/commonjs/live/components/AnimatedSpeakerRing.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/CreateRoomSheet.d.ts +26 -0
- package/lib/typescript/commonjs/live/components/CreateRoomSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/InsightsPanel.d.ts +11 -0
- package/lib/typescript/commonjs/live/components/InsightsPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/LiveRoomSheet.d.ts +11 -0
- package/lib/typescript/commonjs/live/components/LiveRoomSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/MiniRoomBar.d.ts +15 -0
- package/lib/typescript/commonjs/live/components/MiniRoomBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/PanelHeader.d.ts +10 -0
- package/lib/typescript/commonjs/live/components/PanelHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/PodcastStreamPicker.d.ts +54 -0
- package/lib/typescript/commonjs/live/components/PodcastStreamPicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/RecordingCard.d.ts +11 -0
- package/lib/typescript/commonjs/live/components/RecordingCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/RecordingsPanel.d.ts +12 -0
- package/lib/typescript/commonjs/live/components/RecordingsPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/RoomCard.d.ts +38 -0
- package/lib/typescript/commonjs/live/components/RoomCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/StreamConfigModal.d.ts +11 -0
- package/lib/typescript/commonjs/live/components/StreamConfigModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/components/StreamConfigPanel.d.ts +13 -0
- package/lib/typescript/commonjs/live/components/StreamConfigPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/context/LiveConfigContext.d.ts +78 -0
- package/lib/typescript/commonjs/live/context/LiveConfigContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/context/LiveRoomContext.d.ts +12 -0
- package/lib/typescript/commonjs/live/context/LiveRoomContext.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/hooks/useActiveSpeakers.d.ts +3 -0
- package/lib/typescript/commonjs/live/hooks/useActiveSpeakers.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/hooks/useRoomAudio.d.ts +16 -0
- package/lib/typescript/commonjs/live/hooks/useRoomAudio.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/hooks/useRoomConnection.d.ts +29 -0
- package/lib/typescript/commonjs/live/hooks/useRoomConnection.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/hooks/useRoomManager.d.ts +11 -0
- package/lib/typescript/commonjs/live/hooks/useRoomManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/hooks/useRoomUsers.d.ts +5 -0
- package/lib/typescript/commonjs/live/hooks/useRoomUsers.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/index.d.ts +24 -0
- package/lib/typescript/commonjs/live/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/services/livekitService.d.ts +7 -0
- package/lib/typescript/commonjs/live/services/livekitService.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/services/spaceSocketService.d.ts +69 -0
- package/lib/typescript/commonjs/live/services/spaceSocketService.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/services/spacesService.d.ts +181 -0
- package/lib/typescript/commonjs/live/services/spacesService.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/types.d.ts +100 -0
- package/lib/typescript/commonjs/live/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/live/validation.d.ts +658 -0
- package/lib/typescript/commonjs/live/validation.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/{dist/types → lib/typescript/commonjs}/schema.d.ts +1 -0
- package/lib/typescript/commonjs/schema.d.ts.map +1 -0
- package/lib/typescript/module/client.d.ts +141 -0
- package/lib/typescript/module/client.d.ts.map +1 -0
- package/lib/typescript/module/errors.d.ts +9 -0
- package/lib/typescript/module/errors.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +6 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/index.native.d.ts +3 -0
- package/lib/typescript/module/index.native.d.ts.map +1 -0
- package/lib/typescript/module/live/assets/icons/spaces-icon.d.ts +13 -0
- package/lib/typescript/module/live/assets/icons/spaces-icon.d.ts.map +1 -0
- package/lib/typescript/module/live/assets/icons/syra-icon.d.ts +13 -0
- package/lib/typescript/module/live/assets/icons/syra-icon.d.ts.map +1 -0
- package/lib/typescript/module/live/components/AnimatedPulse.d.ts +8 -0
- package/lib/typescript/module/live/components/AnimatedPulse.d.ts.map +1 -0
- package/lib/typescript/module/live/components/AnimatedSpeakerRing.d.ts +10 -0
- package/lib/typescript/module/live/components/AnimatedSpeakerRing.d.ts.map +1 -0
- package/lib/typescript/module/live/components/CreateRoomSheet.d.ts +26 -0
- package/lib/typescript/module/live/components/CreateRoomSheet.d.ts.map +1 -0
- package/lib/typescript/module/live/components/InsightsPanel.d.ts +11 -0
- package/lib/typescript/module/live/components/InsightsPanel.d.ts.map +1 -0
- package/lib/typescript/module/live/components/LiveRoomSheet.d.ts +11 -0
- package/lib/typescript/module/live/components/LiveRoomSheet.d.ts.map +1 -0
- package/lib/typescript/module/live/components/MiniRoomBar.d.ts +15 -0
- package/lib/typescript/module/live/components/MiniRoomBar.d.ts.map +1 -0
- package/lib/typescript/module/live/components/PanelHeader.d.ts +10 -0
- package/lib/typescript/module/live/components/PanelHeader.d.ts.map +1 -0
- package/lib/typescript/module/live/components/PodcastStreamPicker.d.ts +54 -0
- package/lib/typescript/module/live/components/PodcastStreamPicker.d.ts.map +1 -0
- package/lib/typescript/module/live/components/RecordingCard.d.ts +11 -0
- package/lib/typescript/module/live/components/RecordingCard.d.ts.map +1 -0
- package/lib/typescript/module/live/components/RecordingsPanel.d.ts +12 -0
- package/lib/typescript/module/live/components/RecordingsPanel.d.ts.map +1 -0
- package/lib/typescript/module/live/components/RoomCard.d.ts +38 -0
- package/lib/typescript/module/live/components/RoomCard.d.ts.map +1 -0
- package/lib/typescript/module/live/components/StreamConfigModal.d.ts +11 -0
- package/lib/typescript/module/live/components/StreamConfigModal.d.ts.map +1 -0
- package/lib/typescript/module/live/components/StreamConfigPanel.d.ts +13 -0
- package/lib/typescript/module/live/components/StreamConfigPanel.d.ts.map +1 -0
- package/lib/typescript/module/live/context/LiveConfigContext.d.ts +78 -0
- package/lib/typescript/module/live/context/LiveConfigContext.d.ts.map +1 -0
- package/lib/typescript/module/live/context/LiveRoomContext.d.ts +12 -0
- package/lib/typescript/module/live/context/LiveRoomContext.d.ts.map +1 -0
- package/lib/typescript/module/live/hooks/useActiveSpeakers.d.ts +3 -0
- package/lib/typescript/module/live/hooks/useActiveSpeakers.d.ts.map +1 -0
- package/lib/typescript/module/live/hooks/useRoomAudio.d.ts +16 -0
- package/lib/typescript/module/live/hooks/useRoomAudio.d.ts.map +1 -0
- package/lib/typescript/module/live/hooks/useRoomConnection.d.ts +29 -0
- package/lib/typescript/module/live/hooks/useRoomConnection.d.ts.map +1 -0
- package/lib/typescript/module/live/hooks/useRoomManager.d.ts +11 -0
- package/lib/typescript/module/live/hooks/useRoomManager.d.ts.map +1 -0
- package/lib/typescript/module/live/hooks/useRoomUsers.d.ts +5 -0
- package/lib/typescript/module/live/hooks/useRoomUsers.d.ts.map +1 -0
- package/lib/typescript/module/live/index.d.ts +24 -0
- package/lib/typescript/module/live/index.d.ts.map +1 -0
- package/lib/typescript/module/live/services/livekitService.d.ts +7 -0
- package/lib/typescript/module/live/services/livekitService.d.ts.map +1 -0
- package/lib/typescript/module/live/services/spaceSocketService.d.ts +69 -0
- package/lib/typescript/module/live/services/spaceSocketService.d.ts.map +1 -0
- package/lib/typescript/module/live/services/spacesService.d.ts +181 -0
- package/lib/typescript/module/live/services/spacesService.d.ts.map +1 -0
- package/lib/typescript/module/live/types.d.ts +100 -0
- package/lib/typescript/module/live/types.d.ts.map +1 -0
- package/lib/typescript/module/live/validation.d.ts +658 -0
- package/lib/typescript/module/live/validation.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/schema.d.ts +1072 -0
- package/lib/typescript/module/schema.d.ts.map +1 -0
- package/package.json +133 -21
- package/src/index.native.ts +2 -0
- package/src/live/assets/icons/spaces-icon.tsx +15 -0
- package/src/live/assets/icons/syra-icon.tsx +13 -0
- package/src/live/assets/sounds/intro.mp3 +0 -0
- package/src/live/components/AnimatedPulse.tsx +52 -0
- package/src/live/components/AnimatedSpeakerRing.tsx +101 -0
- package/src/live/components/CreateRoomSheet.tsx +654 -0
- package/src/live/components/InsightsPanel.tsx +202 -0
- package/src/live/components/LiveRoomSheet.tsx +969 -0
- package/src/live/components/MiniRoomBar.tsx +166 -0
- package/src/live/components/PanelHeader.tsx +36 -0
- package/src/live/components/PodcastStreamPicker.tsx +1155 -0
- package/src/live/components/RecordingCard.tsx +154 -0
- package/src/live/components/RecordingsPanel.tsx +251 -0
- package/src/live/components/RoomCard.tsx +494 -0
- package/src/live/components/StreamConfigModal.tsx +600 -0
- package/src/live/components/StreamConfigPanel.tsx +729 -0
- package/src/live/context/LiveConfigContext.tsx +96 -0
- package/src/live/context/LiveRoomContext.tsx +235 -0
- package/src/live/hooks/useActiveSpeakers.ts +39 -0
- package/src/live/hooks/useRoomAudio.ts +103 -0
- package/src/live/hooks/useRoomConnection.ts +162 -0
- package/src/live/hooks/useRoomManager.ts +17 -0
- package/src/live/hooks/useRoomUsers.ts +52 -0
- package/src/live/index.ts +92 -0
- package/src/live/services/livekitService.ts +11 -0
- package/src/live/services/spaceSocketService.ts +136 -0
- package/src/live/services/spacesService.ts +692 -0
- package/src/live/types.ts +119 -0
- package/src/live/validation.ts +279 -0
- package/dist/cjs/client.js +0 -244
- package/dist/cjs/errors.js +0 -16
- package/dist/cjs/index.js +0 -15
- package/dist/cjs/package.json +0 -3
- package/dist/esm/client.js +0 -240
- package/dist/esm/errors.js +0 -12
- package/dist/esm/index.js +0 -3
- package/dist/esm/package.json +0 -3
|
@@ -0,0 +1,682 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useState, useEffect, forwardRef, useImperativeHandle } from 'react';
|
|
4
|
+
import { View, Text, StyleSheet, TouchableOpacity, TextInput, ScrollView, FlatList } from 'react-native';
|
|
5
|
+
import MaterialCommunityIcons from '@expo/vector-icons/MaterialCommunityIcons';
|
|
6
|
+
import { useLiveConfig } from "../context/LiveConfigContext.js";
|
|
7
|
+
import { useLiveRoom } from "../context/LiveRoomContext.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
const TOPICS = ['Technology', 'Music', 'Sports', 'Gaming', 'News', 'Politics', 'Science', 'Art', 'Business', 'Education', 'Entertainment', 'Health', 'Culture', 'Crypto', 'AI'];
|
|
10
|
+
const ROOM_TYPES = [{
|
|
11
|
+
value: 'talk',
|
|
12
|
+
label: 'Talk',
|
|
13
|
+
icon: 'microphone',
|
|
14
|
+
description: 'Open conversation'
|
|
15
|
+
}, {
|
|
16
|
+
value: 'stage',
|
|
17
|
+
label: 'Stage',
|
|
18
|
+
icon: 'account-voice',
|
|
19
|
+
description: 'Panel discussion'
|
|
20
|
+
}, {
|
|
21
|
+
value: 'broadcast',
|
|
22
|
+
label: 'Broadcast',
|
|
23
|
+
icon: 'broadcast',
|
|
24
|
+
description: 'One-to-many stream'
|
|
25
|
+
}];
|
|
26
|
+
export const CreateRoomSheet = /*#__PURE__*/forwardRef(({
|
|
27
|
+
onClose,
|
|
28
|
+
onRoomCreated,
|
|
29
|
+
mode = 'standalone',
|
|
30
|
+
ScrollViewComponent,
|
|
31
|
+
hideFooter = false,
|
|
32
|
+
onFormStateChange,
|
|
33
|
+
houses
|
|
34
|
+
}, ref) => {
|
|
35
|
+
const Scroll = ScrollViewComponent || ScrollView;
|
|
36
|
+
const {
|
|
37
|
+
useTheme,
|
|
38
|
+
roomsService,
|
|
39
|
+
toast
|
|
40
|
+
} = useLiveConfig();
|
|
41
|
+
const theme = useTheme();
|
|
42
|
+
const {
|
|
43
|
+
joinLiveRoom
|
|
44
|
+
} = useLiveRoom();
|
|
45
|
+
const [title, setTitle] = useState('');
|
|
46
|
+
const [description, setDescription] = useState('');
|
|
47
|
+
const [topic, setTopic] = useState('');
|
|
48
|
+
const [scheduledStart, setScheduledStart] = useState('');
|
|
49
|
+
const [speakerPermission, setSpeakerPermission] = useState('invited');
|
|
50
|
+
const [roomType, setRoomType] = useState('talk');
|
|
51
|
+
const [selectedHouse, setSelectedHouse] = useState(null);
|
|
52
|
+
const [recordingEnabled, setRecordingEnabled] = useState(true);
|
|
53
|
+
const [loading, setLoading] = useState(false);
|
|
54
|
+
const isValid = title.trim().length > 0;
|
|
55
|
+
const isBroadcast = roomType === 'broadcast';
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
onFormStateChange?.({
|
|
58
|
+
isValid,
|
|
59
|
+
loading,
|
|
60
|
+
hasScheduledStart: !!scheduledStart.trim()
|
|
61
|
+
});
|
|
62
|
+
}, [isValid, loading, scheduledStart, onFormStateChange]);
|
|
63
|
+
const buildCreatePayload = () => ({
|
|
64
|
+
title: title.trim(),
|
|
65
|
+
description: description.trim() || undefined,
|
|
66
|
+
topic: topic.trim() || undefined,
|
|
67
|
+
speakerPermission: isBroadcast ? 'invited' : speakerPermission,
|
|
68
|
+
type: roomType,
|
|
69
|
+
ownerType: selectedHouse ? 'house' : 'profile',
|
|
70
|
+
houseId: selectedHouse?._id,
|
|
71
|
+
recordingEnabled
|
|
72
|
+
});
|
|
73
|
+
const handleCreateAndStart = async () => {
|
|
74
|
+
if (!isValid || loading) return;
|
|
75
|
+
setLoading(true);
|
|
76
|
+
try {
|
|
77
|
+
const room = await roomsService.createRoom(buildCreatePayload());
|
|
78
|
+
if (room) {
|
|
79
|
+
const started = await roomsService.startRoom(room._id);
|
|
80
|
+
onClose();
|
|
81
|
+
if (started) {
|
|
82
|
+
joinLiveRoom(room._id);
|
|
83
|
+
} else {
|
|
84
|
+
toast.error('Room created but failed to start');
|
|
85
|
+
}
|
|
86
|
+
onRoomCreated?.(room);
|
|
87
|
+
} else {
|
|
88
|
+
toast.error('Failed to create room');
|
|
89
|
+
}
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.error('Error creating room:', error);
|
|
92
|
+
toast.error('Failed to create room');
|
|
93
|
+
} finally {
|
|
94
|
+
setLoading(false);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const handleSchedule = async () => {
|
|
98
|
+
if (!isValid || loading) return;
|
|
99
|
+
if (!scheduledStart.trim()) {
|
|
100
|
+
toast.error('Please enter a scheduled start time');
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
setLoading(true);
|
|
104
|
+
try {
|
|
105
|
+
const room = await roomsService.createRoom({
|
|
106
|
+
...buildCreatePayload(),
|
|
107
|
+
scheduledStart: scheduledStart.trim()
|
|
108
|
+
});
|
|
109
|
+
if (room) {
|
|
110
|
+
onClose();
|
|
111
|
+
onRoomCreated?.(room);
|
|
112
|
+
} else {
|
|
113
|
+
toast.error('Failed to create room');
|
|
114
|
+
}
|
|
115
|
+
} catch (error) {
|
|
116
|
+
console.error('Error creating room:', error);
|
|
117
|
+
toast.error('Failed to create room');
|
|
118
|
+
} finally {
|
|
119
|
+
setLoading(false);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
const handleCreateForEmbed = async () => {
|
|
123
|
+
if (!isValid || loading) return;
|
|
124
|
+
setLoading(true);
|
|
125
|
+
try {
|
|
126
|
+
const room = await roomsService.createRoom(buildCreatePayload());
|
|
127
|
+
if (room) {
|
|
128
|
+
onClose();
|
|
129
|
+
onRoomCreated?.(room);
|
|
130
|
+
} else {
|
|
131
|
+
toast.error('Failed to create room');
|
|
132
|
+
}
|
|
133
|
+
} catch (error) {
|
|
134
|
+
console.error('Error creating room:', error);
|
|
135
|
+
toast.error('Failed to create room');
|
|
136
|
+
} finally {
|
|
137
|
+
setLoading(false);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
useImperativeHandle(ref, () => ({
|
|
141
|
+
handleCreateAndStart,
|
|
142
|
+
handleSchedule,
|
|
143
|
+
handleCreateForEmbed
|
|
144
|
+
}), [handleCreateAndStart, handleSchedule, handleCreateForEmbed]);
|
|
145
|
+
const renderFooterContent = () => {
|
|
146
|
+
if (hideFooter) return null;
|
|
147
|
+
return /*#__PURE__*/_jsx(View, {
|
|
148
|
+
style: [styles.footer, {
|
|
149
|
+
borderTopColor: theme.colors.border,
|
|
150
|
+
backgroundColor: theme.colors.background
|
|
151
|
+
}],
|
|
152
|
+
children: mode === 'standalone' ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
153
|
+
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
154
|
+
style: [styles.primaryButton, {
|
|
155
|
+
backgroundColor: isValid ? theme.colors.primary : theme.colors.backgroundSecondary,
|
|
156
|
+
opacity: loading ? 0.6 : 1
|
|
157
|
+
}],
|
|
158
|
+
onPress: handleCreateAndStart,
|
|
159
|
+
disabled: !isValid || loading,
|
|
160
|
+
children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
161
|
+
name: "play",
|
|
162
|
+
size: 20,
|
|
163
|
+
color: isValid ? theme.colors.card : theme.colors.textSecondary
|
|
164
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
165
|
+
style: [styles.primaryButtonText, {
|
|
166
|
+
color: isValid ? theme.colors.card : theme.colors.textSecondary
|
|
167
|
+
}],
|
|
168
|
+
children: loading ? 'Creating...' : 'Start Now'
|
|
169
|
+
})]
|
|
170
|
+
}), scheduledStart.trim() && /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
171
|
+
style: [styles.secondaryButton, {
|
|
172
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
173
|
+
borderColor: theme.colors.border,
|
|
174
|
+
opacity: loading ? 0.6 : 1
|
|
175
|
+
}],
|
|
176
|
+
onPress: handleSchedule,
|
|
177
|
+
disabled: !isValid || loading,
|
|
178
|
+
children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
179
|
+
name: "calendar",
|
|
180
|
+
size: 20,
|
|
181
|
+
color: theme.colors.text
|
|
182
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
183
|
+
style: [styles.secondaryButtonText, {
|
|
184
|
+
color: theme.colors.text
|
|
185
|
+
}],
|
|
186
|
+
children: "Schedule Room"
|
|
187
|
+
})]
|
|
188
|
+
})]
|
|
189
|
+
}) : /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
190
|
+
style: [styles.primaryButton, {
|
|
191
|
+
backgroundColor: isValid ? theme.colors.primary : theme.colors.backgroundSecondary,
|
|
192
|
+
opacity: loading ? 0.6 : 1
|
|
193
|
+
}],
|
|
194
|
+
onPress: handleCreateForEmbed,
|
|
195
|
+
disabled: !isValid || loading,
|
|
196
|
+
children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
197
|
+
name: "radio",
|
|
198
|
+
size: 20,
|
|
199
|
+
color: isValid ? theme.colors.card : theme.colors.textSecondary
|
|
200
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
201
|
+
style: [styles.primaryButtonText, {
|
|
202
|
+
color: isValid ? theme.colors.card : theme.colors.textSecondary
|
|
203
|
+
}],
|
|
204
|
+
children: loading ? 'Creating...' : 'Create Room'
|
|
205
|
+
})]
|
|
206
|
+
})
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
210
|
+
style: [styles.container, {
|
|
211
|
+
backgroundColor: theme.colors.background
|
|
212
|
+
}],
|
|
213
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
214
|
+
style: [styles.header, {
|
|
215
|
+
borderBottomColor: theme.colors.border
|
|
216
|
+
}],
|
|
217
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
218
|
+
onPress: onClose,
|
|
219
|
+
style: styles.headerCloseBtn,
|
|
220
|
+
children: /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
221
|
+
name: "close",
|
|
222
|
+
size: 20,
|
|
223
|
+
color: theme.colors.text
|
|
224
|
+
})
|
|
225
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
226
|
+
style: [styles.headerTitle, {
|
|
227
|
+
color: theme.colors.text
|
|
228
|
+
}],
|
|
229
|
+
children: "Create Room"
|
|
230
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
231
|
+
style: {
|
|
232
|
+
width: 28
|
|
233
|
+
}
|
|
234
|
+
})]
|
|
235
|
+
}), /*#__PURE__*/_jsxs(Scroll, {
|
|
236
|
+
style: {
|
|
237
|
+
flex: 1
|
|
238
|
+
},
|
|
239
|
+
contentContainerStyle: [styles.scrollContent, hideFooter && {
|
|
240
|
+
paddingBottom: 72
|
|
241
|
+
}],
|
|
242
|
+
keyboardShouldPersistTaps: "handled",
|
|
243
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
244
|
+
style: [styles.inputSection, styles.sectionPadded],
|
|
245
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
246
|
+
style: [styles.label, {
|
|
247
|
+
color: theme.colors.text
|
|
248
|
+
}],
|
|
249
|
+
children: "Room Type"
|
|
250
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
251
|
+
style: styles.typeSelector,
|
|
252
|
+
children: ROOM_TYPES.map(rt => {
|
|
253
|
+
const selected = roomType === rt.value;
|
|
254
|
+
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
255
|
+
style: [styles.typeCard, {
|
|
256
|
+
backgroundColor: selected ? theme.colors.primary : theme.colors.backgroundSecondary,
|
|
257
|
+
borderColor: selected ? theme.colors.primary : theme.colors.border
|
|
258
|
+
}],
|
|
259
|
+
onPress: () => setRoomType(rt.value),
|
|
260
|
+
children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
261
|
+
name: rt.icon,
|
|
262
|
+
size: 22,
|
|
263
|
+
color: selected ? '#FFFFFF' : theme.colors.textSecondary
|
|
264
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
265
|
+
style: [styles.typeCardLabel, {
|
|
266
|
+
color: selected ? '#FFFFFF' : theme.colors.text
|
|
267
|
+
}],
|
|
268
|
+
children: rt.label
|
|
269
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
270
|
+
style: [styles.typeCardDesc, {
|
|
271
|
+
color: selected ? 'rgba(255,255,255,0.8)' : theme.colors.textSecondary
|
|
272
|
+
}],
|
|
273
|
+
children: rt.description
|
|
274
|
+
})]
|
|
275
|
+
}, rt.value);
|
|
276
|
+
})
|
|
277
|
+
})]
|
|
278
|
+
}), houses && houses.length > 0 && /*#__PURE__*/_jsxs(View, {
|
|
279
|
+
style: styles.inputSection,
|
|
280
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
281
|
+
style: [styles.label, styles.sectionPadded, {
|
|
282
|
+
color: theme.colors.text
|
|
283
|
+
}],
|
|
284
|
+
children: "Create for"
|
|
285
|
+
}), /*#__PURE__*/_jsx(FlatList, {
|
|
286
|
+
horizontal: true,
|
|
287
|
+
showsHorizontalScrollIndicator: false,
|
|
288
|
+
data: [null, ...houses],
|
|
289
|
+
keyExtractor: item => item?._id ?? 'personal',
|
|
290
|
+
contentContainerStyle: styles.chipList,
|
|
291
|
+
renderItem: ({
|
|
292
|
+
item
|
|
293
|
+
}) => {
|
|
294
|
+
const selected = item === null ? !selectedHouse : selectedHouse?._id === item._id;
|
|
295
|
+
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
296
|
+
style: [styles.chip, {
|
|
297
|
+
backgroundColor: selected ? theme.colors.primary : theme.colors.backgroundSecondary
|
|
298
|
+
}],
|
|
299
|
+
onPress: () => setSelectedHouse(item),
|
|
300
|
+
children: [item && /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
301
|
+
name: "home-group",
|
|
302
|
+
size: 14,
|
|
303
|
+
color: selected ? '#FFFFFF' : theme.colors.textSecondary,
|
|
304
|
+
style: {
|
|
305
|
+
marginRight: 4
|
|
306
|
+
}
|
|
307
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
308
|
+
style: [styles.chipText, {
|
|
309
|
+
color: selected ? '#FFFFFF' : theme.colors.text
|
|
310
|
+
}],
|
|
311
|
+
children: item ? item.name : 'Personal'
|
|
312
|
+
})]
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
})]
|
|
316
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
317
|
+
style: [styles.inputSection, styles.sectionPadded],
|
|
318
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
319
|
+
style: [styles.label, {
|
|
320
|
+
color: theme.colors.text
|
|
321
|
+
}],
|
|
322
|
+
children: "Title *"
|
|
323
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
324
|
+
style: [styles.input, {
|
|
325
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
326
|
+
color: theme.colors.text
|
|
327
|
+
}],
|
|
328
|
+
placeholder: "What's your room about?",
|
|
329
|
+
placeholderTextColor: theme.colors.textTertiary,
|
|
330
|
+
value: title,
|
|
331
|
+
onChangeText: setTitle,
|
|
332
|
+
maxLength: 100
|
|
333
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
334
|
+
style: [styles.charCount, {
|
|
335
|
+
color: theme.colors.textTertiary
|
|
336
|
+
}],
|
|
337
|
+
children: [title.length, "/100"]
|
|
338
|
+
})]
|
|
339
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
340
|
+
style: styles.inputSection,
|
|
341
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
342
|
+
style: [styles.label, styles.sectionPadded, {
|
|
343
|
+
color: theme.colors.text
|
|
344
|
+
}],
|
|
345
|
+
children: "Topic"
|
|
346
|
+
}), /*#__PURE__*/_jsx(FlatList, {
|
|
347
|
+
horizontal: true,
|
|
348
|
+
showsHorizontalScrollIndicator: false,
|
|
349
|
+
data: TOPICS,
|
|
350
|
+
keyExtractor: item => item,
|
|
351
|
+
contentContainerStyle: styles.chipList,
|
|
352
|
+
renderItem: ({
|
|
353
|
+
item
|
|
354
|
+
}) => {
|
|
355
|
+
const selected = topic === item;
|
|
356
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
357
|
+
style: [styles.chip, {
|
|
358
|
+
backgroundColor: selected ? theme.colors.primary : theme.colors.backgroundSecondary
|
|
359
|
+
}],
|
|
360
|
+
onPress: () => setTopic(selected ? '' : item),
|
|
361
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
362
|
+
style: [styles.chipText, {
|
|
363
|
+
color: selected ? '#FFFFFF' : theme.colors.text
|
|
364
|
+
}],
|
|
365
|
+
children: item
|
|
366
|
+
})
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
})]
|
|
370
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
371
|
+
style: [styles.inputSection, styles.sectionPadded],
|
|
372
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
373
|
+
style: [styles.label, {
|
|
374
|
+
color: theme.colors.text
|
|
375
|
+
}],
|
|
376
|
+
children: "Description"
|
|
377
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
378
|
+
style: [styles.textArea, {
|
|
379
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
380
|
+
color: theme.colors.text
|
|
381
|
+
}],
|
|
382
|
+
placeholder: "Tell people what to expect...",
|
|
383
|
+
placeholderTextColor: theme.colors.textTertiary,
|
|
384
|
+
value: description,
|
|
385
|
+
onChangeText: setDescription,
|
|
386
|
+
multiline: true,
|
|
387
|
+
numberOfLines: 3,
|
|
388
|
+
maxLength: 500
|
|
389
|
+
})]
|
|
390
|
+
}), !isBroadcast && /*#__PURE__*/_jsxs(View, {
|
|
391
|
+
style: [styles.inputSection, styles.sectionPadded],
|
|
392
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
393
|
+
style: [styles.label, {
|
|
394
|
+
color: theme.colors.text
|
|
395
|
+
}],
|
|
396
|
+
children: "Who can speak?"
|
|
397
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
398
|
+
style: styles.radioGroup,
|
|
399
|
+
children: [{
|
|
400
|
+
value: 'everyone',
|
|
401
|
+
label: 'Everyone',
|
|
402
|
+
icon: 'earth'
|
|
403
|
+
}, {
|
|
404
|
+
value: 'followers',
|
|
405
|
+
label: 'People you follow',
|
|
406
|
+
icon: 'account-group'
|
|
407
|
+
}, {
|
|
408
|
+
value: 'invited',
|
|
409
|
+
label: 'Only invited speakers',
|
|
410
|
+
icon: 'account-plus'
|
|
411
|
+
}].map((option, index, arr) => {
|
|
412
|
+
const selected = speakerPermission === option.value;
|
|
413
|
+
const isFirst = index === 0;
|
|
414
|
+
const isLast = index === arr.length - 1;
|
|
415
|
+
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
416
|
+
style: [styles.radioRow, {
|
|
417
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
418
|
+
borderTopLeftRadius: isFirst ? 12 : 0,
|
|
419
|
+
borderTopRightRadius: isFirst ? 12 : 0,
|
|
420
|
+
borderBottomLeftRadius: isLast ? 12 : 0,
|
|
421
|
+
borderBottomRightRadius: isLast ? 12 : 0
|
|
422
|
+
}],
|
|
423
|
+
onPress: () => setSpeakerPermission(option.value),
|
|
424
|
+
children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
425
|
+
name: option.icon,
|
|
426
|
+
size: 18,
|
|
427
|
+
color: selected ? theme.colors.primary : theme.colors.textSecondary
|
|
428
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
429
|
+
style: [styles.radioLabel, {
|
|
430
|
+
color: selected ? theme.colors.primary : theme.colors.text
|
|
431
|
+
}],
|
|
432
|
+
children: option.label
|
|
433
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
434
|
+
style: [styles.radioCircle, {
|
|
435
|
+
borderColor: selected ? theme.colors.primary : theme.colors.border,
|
|
436
|
+
backgroundColor: selected ? theme.colors.primary : 'transparent'
|
|
437
|
+
}],
|
|
438
|
+
children: selected && /*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
439
|
+
name: "check",
|
|
440
|
+
size: 12,
|
|
441
|
+
color: "#FFFFFF"
|
|
442
|
+
})
|
|
443
|
+
})]
|
|
444
|
+
}, option.value);
|
|
445
|
+
})
|
|
446
|
+
})]
|
|
447
|
+
}), mode === 'standalone' && /*#__PURE__*/_jsxs(View, {
|
|
448
|
+
style: [styles.inputSection, styles.sectionPadded],
|
|
449
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
450
|
+
style: [styles.label, {
|
|
451
|
+
color: theme.colors.text
|
|
452
|
+
}],
|
|
453
|
+
children: "Schedule (Optional)"
|
|
454
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
455
|
+
style: [styles.input, {
|
|
456
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
457
|
+
color: theme.colors.text
|
|
458
|
+
}],
|
|
459
|
+
placeholder: "e.g., 2024-03-20 14:00",
|
|
460
|
+
placeholderTextColor: theme.colors.textTertiary,
|
|
461
|
+
value: scheduledStart,
|
|
462
|
+
onChangeText: setScheduledStart
|
|
463
|
+
})]
|
|
464
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
465
|
+
style: [styles.inputSection, styles.sectionPadded],
|
|
466
|
+
children: /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
467
|
+
style: [styles.toggleRow, {
|
|
468
|
+
backgroundColor: theme.colors.backgroundSecondary
|
|
469
|
+
}],
|
|
470
|
+
onPress: () => setRecordingEnabled(!recordingEnabled),
|
|
471
|
+
children: [/*#__PURE__*/_jsx(MaterialCommunityIcons, {
|
|
472
|
+
name: recordingEnabled ? 'record-circle' : 'record-circle-outline',
|
|
473
|
+
size: 20,
|
|
474
|
+
color: recordingEnabled ? '#FF0000' : theme.colors.textSecondary
|
|
475
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
476
|
+
style: {
|
|
477
|
+
flex: 1
|
|
478
|
+
},
|
|
479
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
480
|
+
style: [styles.toggleLabel, {
|
|
481
|
+
color: theme.colors.text
|
|
482
|
+
}],
|
|
483
|
+
children: "Auto-record"
|
|
484
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
485
|
+
style: {
|
|
486
|
+
fontSize: 11,
|
|
487
|
+
color: theme.colors.textSecondary
|
|
488
|
+
},
|
|
489
|
+
children: "Record audio when room goes live (max 1h, expires in 6 months)"
|
|
490
|
+
})]
|
|
491
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
492
|
+
style: [styles.toggleIndicator, {
|
|
493
|
+
backgroundColor: recordingEnabled ? theme.colors.primary : theme.colors.border
|
|
494
|
+
}],
|
|
495
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
496
|
+
style: [styles.toggleDot, recordingEnabled && {
|
|
497
|
+
transform: [{
|
|
498
|
+
translateX: 14
|
|
499
|
+
}]
|
|
500
|
+
}]
|
|
501
|
+
})
|
|
502
|
+
})]
|
|
503
|
+
})
|
|
504
|
+
})]
|
|
505
|
+
}), renderFooterContent()]
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
CreateRoomSheet.displayName = 'CreateRoomSheet';
|
|
509
|
+
const styles = StyleSheet.create({
|
|
510
|
+
container: {
|
|
511
|
+
flex: 1
|
|
512
|
+
},
|
|
513
|
+
header: {
|
|
514
|
+
flexDirection: 'row',
|
|
515
|
+
alignItems: 'center',
|
|
516
|
+
justifyContent: 'space-between',
|
|
517
|
+
paddingHorizontal: 12,
|
|
518
|
+
paddingVertical: 8,
|
|
519
|
+
borderBottomWidth: 0.5
|
|
520
|
+
},
|
|
521
|
+
headerCloseBtn: {
|
|
522
|
+
width: 28,
|
|
523
|
+
height: 28,
|
|
524
|
+
alignItems: 'center',
|
|
525
|
+
justifyContent: 'center'
|
|
526
|
+
},
|
|
527
|
+
headerTitle: {
|
|
528
|
+
fontSize: 16,
|
|
529
|
+
fontWeight: '600'
|
|
530
|
+
},
|
|
531
|
+
scrollContent: {
|
|
532
|
+
paddingVertical: 16,
|
|
533
|
+
paddingBottom: 12
|
|
534
|
+
},
|
|
535
|
+
sectionPadded: {
|
|
536
|
+
paddingHorizontal: 16
|
|
537
|
+
},
|
|
538
|
+
inputSection: {
|
|
539
|
+
marginBottom: 16
|
|
540
|
+
},
|
|
541
|
+
label: {
|
|
542
|
+
fontSize: 13,
|
|
543
|
+
fontWeight: '600',
|
|
544
|
+
marginBottom: 6
|
|
545
|
+
},
|
|
546
|
+
input: {
|
|
547
|
+
borderRadius: 12,
|
|
548
|
+
paddingHorizontal: 14,
|
|
549
|
+
paddingVertical: 10,
|
|
550
|
+
fontSize: 15
|
|
551
|
+
},
|
|
552
|
+
textArea: {
|
|
553
|
+
borderRadius: 12,
|
|
554
|
+
paddingHorizontal: 14,
|
|
555
|
+
paddingVertical: 10,
|
|
556
|
+
fontSize: 15,
|
|
557
|
+
minHeight: 72,
|
|
558
|
+
textAlignVertical: 'top'
|
|
559
|
+
},
|
|
560
|
+
charCount: {
|
|
561
|
+
fontSize: 11,
|
|
562
|
+
marginTop: 4
|
|
563
|
+
},
|
|
564
|
+
typeSelector: {
|
|
565
|
+
flexDirection: 'row',
|
|
566
|
+
gap: 10
|
|
567
|
+
},
|
|
568
|
+
typeCard: {
|
|
569
|
+
flex: 1,
|
|
570
|
+
alignItems: 'center',
|
|
571
|
+
paddingVertical: 14,
|
|
572
|
+
paddingHorizontal: 8,
|
|
573
|
+
borderRadius: 12,
|
|
574
|
+
borderWidth: 1,
|
|
575
|
+
gap: 4
|
|
576
|
+
},
|
|
577
|
+
typeCardLabel: {
|
|
578
|
+
fontSize: 13,
|
|
579
|
+
fontWeight: '600',
|
|
580
|
+
marginTop: 2
|
|
581
|
+
},
|
|
582
|
+
typeCardDesc: {
|
|
583
|
+
fontSize: 10,
|
|
584
|
+
textAlign: 'center'
|
|
585
|
+
},
|
|
586
|
+
chipList: {
|
|
587
|
+
gap: 8,
|
|
588
|
+
paddingHorizontal: 16
|
|
589
|
+
},
|
|
590
|
+
chip: {
|
|
591
|
+
flexDirection: 'row',
|
|
592
|
+
alignItems: 'center',
|
|
593
|
+
paddingHorizontal: 14,
|
|
594
|
+
paddingVertical: 8,
|
|
595
|
+
borderRadius: 20
|
|
596
|
+
},
|
|
597
|
+
chipText: {
|
|
598
|
+
fontSize: 13,
|
|
599
|
+
fontWeight: '500'
|
|
600
|
+
},
|
|
601
|
+
radioGroup: {
|
|
602
|
+
gap: 3
|
|
603
|
+
},
|
|
604
|
+
radioRow: {
|
|
605
|
+
flexDirection: 'row',
|
|
606
|
+
alignItems: 'center',
|
|
607
|
+
gap: 10,
|
|
608
|
+
paddingHorizontal: 14,
|
|
609
|
+
paddingVertical: 12
|
|
610
|
+
},
|
|
611
|
+
radioLabel: {
|
|
612
|
+
fontSize: 14,
|
|
613
|
+
flex: 1
|
|
614
|
+
},
|
|
615
|
+
radioCircle: {
|
|
616
|
+
width: 20,
|
|
617
|
+
height: 20,
|
|
618
|
+
borderRadius: 10,
|
|
619
|
+
borderWidth: 2,
|
|
620
|
+
alignItems: 'center',
|
|
621
|
+
justifyContent: 'center'
|
|
622
|
+
},
|
|
623
|
+
footer: {
|
|
624
|
+
gap: 10,
|
|
625
|
+
paddingHorizontal: 16,
|
|
626
|
+
paddingTop: 10,
|
|
627
|
+
paddingBottom: 14,
|
|
628
|
+
borderTopWidth: 0.5
|
|
629
|
+
},
|
|
630
|
+
primaryButton: {
|
|
631
|
+
flexDirection: 'row',
|
|
632
|
+
alignItems: 'center',
|
|
633
|
+
justifyContent: 'center',
|
|
634
|
+
paddingVertical: 12,
|
|
635
|
+
borderRadius: 22,
|
|
636
|
+
gap: 6
|
|
637
|
+
},
|
|
638
|
+
primaryButtonText: {
|
|
639
|
+
fontSize: 15,
|
|
640
|
+
fontWeight: '600'
|
|
641
|
+
},
|
|
642
|
+
secondaryButton: {
|
|
643
|
+
flexDirection: 'row',
|
|
644
|
+
alignItems: 'center',
|
|
645
|
+
justifyContent: 'center',
|
|
646
|
+
paddingVertical: 12,
|
|
647
|
+
borderRadius: 22,
|
|
648
|
+
borderWidth: 1,
|
|
649
|
+
gap: 6
|
|
650
|
+
},
|
|
651
|
+
secondaryButtonText: {
|
|
652
|
+
fontSize: 15,
|
|
653
|
+
fontWeight: '600'
|
|
654
|
+
},
|
|
655
|
+
toggleRow: {
|
|
656
|
+
flexDirection: 'row',
|
|
657
|
+
alignItems: 'center',
|
|
658
|
+
gap: 10,
|
|
659
|
+
paddingHorizontal: 14,
|
|
660
|
+
paddingVertical: 12,
|
|
661
|
+
borderRadius: 12
|
|
662
|
+
},
|
|
663
|
+
toggleLabel: {
|
|
664
|
+
fontSize: 14,
|
|
665
|
+
fontWeight: '500'
|
|
666
|
+
},
|
|
667
|
+
toggleIndicator: {
|
|
668
|
+
width: 36,
|
|
669
|
+
height: 22,
|
|
670
|
+
borderRadius: 11,
|
|
671
|
+
justifyContent: 'center',
|
|
672
|
+
paddingHorizontal: 2
|
|
673
|
+
},
|
|
674
|
+
toggleDot: {
|
|
675
|
+
width: 18,
|
|
676
|
+
height: 18,
|
|
677
|
+
borderRadius: 9,
|
|
678
|
+
backgroundColor: '#FFFFFF'
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
export default CreateRoomSheet;
|
|
682
|
+
//# sourceMappingURL=CreateRoomSheet.js.map
|