@openpeepshq/rn-components 0.13.0 → 0.13.1
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/package.json +3 -3
- package/src/components/jams/JamDeviceSelectors.tsx +31 -3
- package/src/components/jams/JamLobby.tsx +104 -5
- package/src/components/jams/JamVideoCall.tsx +157 -3
- package/src/components/jams/JamVideoLayout.tsx +9 -2
- package/src/components/jams/useLateTrackMediaStream.test.ts +145 -0
- package/src/components/jams/useLateTrackMediaStream.ts +61 -0
- package/src/components/post/feed/events/EventsCalendar.test.tsx +144 -0
- package/src/components/post/feed/events/EventsCalendar.tsx +4 -8
- package/src/components/post/feed/events/EventsView.tsx +5 -13
- package/src/components/post/post-form/OpenpeepsMarkdownInput.tsx +14 -5
- package/src/components/post/post-form/PostForm.tsx +1 -0
- package/src/lib/dmMessageGate.test.ts +58 -0
- package/src/lib/livekit/useStableLiveKitRoom.ts +23 -13
- package/src/lib/utils.ts +4 -1
- package/src/pages/conversations/NewDraft.tsx +2 -3
- package/src/pages/conversations/Show.tsx +4 -1
- package/src/pages/events/Index.tsx +1 -5
- package/src/pages/events/My.tsx +1 -2
- package/src/pages/groups/Show.tsx +10 -2
- package/src/pages/posts/Edit.tsx +16 -6
- package/src/pages/posts/New.tsx +15 -5
- package/src/pages/posts/Reply.tsx +15 -6
|
@@ -18,8 +18,10 @@ import {
|
|
|
18
18
|
MediaAttachment,
|
|
19
19
|
pollOptionsWithinLimit,
|
|
20
20
|
PostCreationData,
|
|
21
|
+
canSubmitPostContent,
|
|
21
22
|
PublicPost,
|
|
22
23
|
resolvePollOptionContents,
|
|
24
|
+
visibleTextLength,
|
|
23
25
|
} from '@openpeepshq/common';
|
|
24
26
|
import Toast from 'react-native-toast-message';
|
|
25
27
|
import {
|
|
@@ -90,7 +92,6 @@ export const ReplyPost = ({ route, navigation }: PostProps) => {
|
|
|
90
92
|
setPostData(newPostData as PostCreationData);
|
|
91
93
|
form.reset(newPostData);
|
|
92
94
|
}
|
|
93
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
94
95
|
}, [post]);
|
|
95
96
|
|
|
96
97
|
useEffect(() => {
|
|
@@ -118,6 +119,7 @@ export const ReplyPost = ({ route, navigation }: PostProps) => {
|
|
|
118
119
|
}, [isPostLoading, post, postData]);
|
|
119
120
|
|
|
120
121
|
const trimmedContent = (postData?.data.content ?? '').trim();
|
|
122
|
+
const visibleContentLength = visibleTextLength(trimmedContent);
|
|
121
123
|
const pollOptions =
|
|
122
124
|
postData?.data.type === 'question'
|
|
123
125
|
? postData.data.options.map((option) => option.content)
|
|
@@ -134,12 +136,18 @@ export const ReplyPost = ({ route, navigation }: PostProps) => {
|
|
|
134
136
|
return false;
|
|
135
137
|
}
|
|
136
138
|
if (postData.data.type === 'question') {
|
|
137
|
-
return
|
|
139
|
+
return canSubmitPostContent({
|
|
140
|
+
visibleContentLength,
|
|
141
|
+
attachmentsLength: postData.data.attachments?.length ?? 0,
|
|
142
|
+
composerType: 'question',
|
|
143
|
+
pollOptionsValid,
|
|
144
|
+
});
|
|
138
145
|
}
|
|
139
|
-
return (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
146
|
+
return canSubmitPostContent({
|
|
147
|
+
visibleContentLength,
|
|
148
|
+
attachmentsLength: postData.data.attachments?.length ?? 0,
|
|
149
|
+
composerType: 'note',
|
|
150
|
+
});
|
|
143
151
|
}, [
|
|
144
152
|
attachmentsProcessing,
|
|
145
153
|
isPosting,
|
|
@@ -147,6 +155,7 @@ export const ReplyPost = ({ route, navigation }: PostProps) => {
|
|
|
147
155
|
post,
|
|
148
156
|
postData,
|
|
149
157
|
trimmedContent.length,
|
|
158
|
+
visibleContentLength,
|
|
150
159
|
]);
|
|
151
160
|
|
|
152
161
|
const handlePostCreation = async () => {
|