@openpeepshq/rn-components 0.3.5 → 0.3.7
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/README.md +2 -2
- package/metro/resolve-asset-source.js +19 -0
- package/metro.js +20 -1
- package/package.json +2 -2
- package/src/components/custom/common/empty-state-container.tsx +42 -114
- package/src/components/custom/headers/tab-screens-header.tsx +3 -4
- package/src/components/custom/navigation/side-menu.tsx +2 -2
- package/src/components/navigation/auth-wrapper.tsx +1 -1
- package/src/components/notifications/NotificationItem.tsx +1 -1
- package/src/components/notifications/NotificationsList.tsx +5 -1
- package/src/components/post/Feed.tsx +3 -1
- package/src/components/post/FeedPost.tsx +32 -37
- package/src/components/post/FeedPostContent.tsx +6 -8
- package/src/components/post/feed/events/EventsFeed.tsx +1 -0
- package/src/components/post/pieces/PostActions.tsx +46 -121
- package/src/components/post/pieces/PostInfoHeader.tsx +9 -5
- package/src/components/post/post-form/Footer.tsx +47 -64
- package/src/components/post/post-form/OpenpeepsMarkdownInput.tsx +3 -0
- package/src/components/post/post-form/PollComposerFields.tsx +2 -2
- package/src/components/post/post-form/PostForm.tsx +133 -129
- package/src/components/post/types/Note.tsx +1 -1
- package/src/components/post/types/Poll.tsx +1 -1
- package/src/components/post/types/article/CardArticle.tsx +1 -1
- package/src/components/post/types/event/CardEvent.tsx +1 -1
- package/src/components/post/types/event/FullEvent.tsx +21 -20
- package/src/components/profile/ProfileCard.tsx +1 -1
- package/src/components/profile/ProfileHeader.tsx +8 -10
- package/src/pages/Explore.tsx +30 -5
- package/src/pages/Members.tsx +2 -2
- package/src/pages/conversations/Index.tsx +1 -1
- package/src/pages/conversations/New.tsx +8 -1
- package/src/pages/groups/Index.tsx +8 -1
- package/src/pages/groups/Info.tsx +4 -4
- package/src/pages/groups/Show.tsx +42 -3
- package/src/pages/posts/Edit.tsx +43 -5
- package/src/pages/posts/New.tsx +121 -74
- package/src/pages/posts/Reply.tsx +77 -49
- package/src/pages/profile/Followers.tsx +4 -1
- package/src/pages/profile/Following.tsx +4 -1
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
|
-
import { View } from 'react-native';
|
|
2
|
+
import { Pressable, View } from 'react-native';
|
|
3
3
|
import { UseFormReturn } from 'react-hook-form';
|
|
4
|
+
import { BottomSheetModal } from '@gorhom/bottom-sheet';
|
|
5
|
+
import { AudienceSetting, type PostCreationData } from '@openpeepshq/common';
|
|
6
|
+
import { audienceSummary, useOpenpeeps } from '@openpeepshq/react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
4
8
|
import { ProfileAvatar } from '../../profile/Avatar';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Form, FormTextarea, FormField } from '../../ui/form';
|
|
9
|
+
import { ThemedText } from '../../ui/themed-text';
|
|
10
|
+
import { Switch } from '../../ui/switch';
|
|
11
|
+
import { ChevronDownIcon, MegaphoneIcon } from '../../icons/index';
|
|
9
12
|
import { ComposeAttachments } from './ComposeAttachments';
|
|
10
|
-
import {
|
|
13
|
+
import { ComposePreviewLinks } from './ComposePreviewLinks';
|
|
14
|
+
import { OpenpeepsMarkdownInput } from './OpenpeepsMarkdownInput';
|
|
11
15
|
import { PollComposerFields } from './PollComposerFields';
|
|
12
|
-
import {
|
|
16
|
+
import { VisibilitySheet } from './VisibilitySheet';
|
|
13
17
|
|
|
14
|
-
import { useOpenpeeps } from '@openpeepshq/react';
|
|
15
|
-
import { BottomSheetModal } from '@gorhom/bottom-sheet';
|
|
16
|
-
|
|
17
|
-
import { ProfileSelector } from '../../profile/index';
|
|
18
18
|
interface PostFormProps {
|
|
19
19
|
autoFocus?: boolean;
|
|
20
20
|
canEditVisibility?: boolean;
|
|
21
21
|
postData: PostCreationData;
|
|
22
22
|
setPostData: (postData: PostCreationData) => void;
|
|
23
23
|
form: UseFormReturn<PostCreationData>;
|
|
24
|
+
showNotify?: boolean;
|
|
25
|
+
notify?: boolean;
|
|
26
|
+
onNotifyChange?: (value: boolean) => void;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
export const PostForm = ({
|
|
@@ -29,12 +32,13 @@ export const PostForm = ({
|
|
|
29
32
|
postData,
|
|
30
33
|
setPostData,
|
|
31
34
|
form,
|
|
35
|
+
showNotify = false,
|
|
36
|
+
notify = false,
|
|
37
|
+
onNotifyChange,
|
|
32
38
|
}: PostFormProps) => {
|
|
33
39
|
const { currentProfile } = useOpenpeeps();
|
|
34
|
-
const profileModalRef = useRef<BottomSheetModal>(null);
|
|
35
|
-
|
|
36
40
|
const { t } = useTranslation();
|
|
37
|
-
|
|
41
|
+
const visibilityModalRef = useRef<BottomSheetModal>(null);
|
|
38
42
|
const { subscribe } = form;
|
|
39
43
|
|
|
40
44
|
useEffect(
|
|
@@ -59,125 +63,125 @@ export const PostForm = ({
|
|
|
59
63
|
[postData, form, setPostData]
|
|
60
64
|
);
|
|
61
65
|
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, []);
|
|
66
|
+
const selectedGroupName = useMemo(() => {
|
|
67
|
+
if (!postData.groupId) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
return currentProfile?.memberships?.find(
|
|
71
|
+
(membership) => membership.group.id === postData.groupId
|
|
72
|
+
)?.group.displayName;
|
|
73
|
+
}, [currentProfile?.memberships, postData.groupId]);
|
|
70
74
|
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const handle = `@${profile.handle}`;
|
|
75
|
-
|
|
76
|
-
const currentContent = form.getValues('data.content') || '';
|
|
77
|
-
const newContent = currentContent.replace(/@[^\s@]*$/, `${handle} `);
|
|
78
|
-
|
|
79
|
-
const newPostData = {
|
|
80
|
-
...postData,
|
|
81
|
-
data: {
|
|
82
|
-
...postData.data,
|
|
83
|
-
content: newContent,
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
form.reset(newPostData);
|
|
88
|
-
setPostData(newPostData);
|
|
89
|
-
},
|
|
90
|
-
[form, postData, setPostData]
|
|
91
|
-
);
|
|
75
|
+
const content = form.watch('data.content') ?? '';
|
|
76
|
+
const isQuestion = postData.data.type === 'question';
|
|
77
|
+
const isNote = postData.data.type === 'note';
|
|
92
78
|
|
|
93
79
|
return (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
attachments: postData.data.attachments?.filter(
|
|
119
|
-
(_, i) => i !== index
|
|
120
|
-
),
|
|
121
|
-
},
|
|
122
|
-
};
|
|
123
|
-
form.reset(newPostData);
|
|
124
|
-
setPostData(newPostData);
|
|
125
|
-
}}
|
|
126
|
-
updateAttachment={(index, attachment) => {
|
|
127
|
-
const newPostData = {
|
|
128
|
-
...postData,
|
|
129
|
-
data: {
|
|
130
|
-
...postData.data,
|
|
131
|
-
attachments: postData.data.attachments?.map((a, i) =>
|
|
132
|
-
i === index ? attachment : a
|
|
133
|
-
),
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
form.reset(newPostData);
|
|
137
|
-
setPostData(newPostData);
|
|
138
|
-
}}
|
|
139
|
-
/>
|
|
140
|
-
)}
|
|
141
|
-
|
|
142
|
-
<FormField
|
|
143
|
-
control={form.control}
|
|
144
|
-
name={'data.content'}
|
|
145
|
-
render={({ field: { onChange, value, ...rest } }) => (
|
|
146
|
-
<FormTextarea
|
|
147
|
-
autoFocus={autoFocus}
|
|
148
|
-
containerClassName={'w-full'}
|
|
149
|
-
className={cn(
|
|
150
|
-
'px-4 py-2 border-0 text-foreground ',
|
|
151
|
-
contentInputHeight
|
|
80
|
+
<View className="px-4 pb-4">
|
|
81
|
+
{currentProfile ? (
|
|
82
|
+
<Pressable
|
|
83
|
+
disabled={!canEditVisibility}
|
|
84
|
+
accessibilityLabel={t('posts.form.changeAudience')}
|
|
85
|
+
onPress={() => visibilityModalRef.current?.present()}
|
|
86
|
+
className="mb-3 w-full flex-row items-center gap-3 rounded-md border border-border p-3"
|
|
87
|
+
>
|
|
88
|
+
<ProfileAvatar className="size-10" profile={currentProfile} />
|
|
89
|
+
<View className="min-w-0 flex-1">
|
|
90
|
+
<View className="flex-row items-center gap-1">
|
|
91
|
+
<ThemedText className="font-medium" numberOfLines={1}>
|
|
92
|
+
{currentProfile.displayName ?? currentProfile.handle}
|
|
93
|
+
</ThemedText>
|
|
94
|
+
{canEditVisibility ? (
|
|
95
|
+
<ChevronDownIcon size={16} className="text-muted-foreground" />
|
|
96
|
+
) : null}
|
|
97
|
+
</View>
|
|
98
|
+
<ThemedText className="text-sm text-muted-foreground">
|
|
99
|
+
{audienceSummary(
|
|
100
|
+
postData.visibility,
|
|
101
|
+
t,
|
|
102
|
+
selectedGroupName,
|
|
103
|
+
postData.audience?.length
|
|
152
104
|
)}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
105
|
+
</ThemedText>
|
|
106
|
+
</View>
|
|
107
|
+
</Pressable>
|
|
108
|
+
) : null}
|
|
109
|
+
|
|
110
|
+
<OpenpeepsMarkdownInput
|
|
111
|
+
autoFocus={autoFocus}
|
|
112
|
+
value={content}
|
|
113
|
+
onChange={(text) => form.setValue('data.content', text)}
|
|
114
|
+
placeholder={
|
|
115
|
+
isQuestion
|
|
116
|
+
? t('posts.form.poll.question')
|
|
117
|
+
: t('posts.form.note.placeholder')
|
|
118
|
+
}
|
|
119
|
+
/>
|
|
120
|
+
|
|
121
|
+
<ComposePreviewLinks content={content} />
|
|
122
|
+
|
|
123
|
+
{isNote && (postData.data.attachments?.length ?? 0) > 0 ? (
|
|
124
|
+
<ComposeAttachments
|
|
125
|
+
attachments={postData.data.attachments ?? []}
|
|
126
|
+
removeAttachment={(index) => {
|
|
127
|
+
const newPostData = {
|
|
128
|
+
...postData,
|
|
129
|
+
data: {
|
|
130
|
+
...postData.data,
|
|
131
|
+
attachments: postData.data.attachments?.filter(
|
|
132
|
+
(_, i) => i !== index
|
|
133
|
+
),
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
form.reset(newPostData);
|
|
137
|
+
setPostData(newPostData);
|
|
138
|
+
}}
|
|
139
|
+
updateAttachment={(index, attachment) => {
|
|
140
|
+
const newPostData = {
|
|
141
|
+
...postData,
|
|
142
|
+
data: {
|
|
143
|
+
...postData.data,
|
|
144
|
+
attachments: postData.data.attachments?.map((item, i) =>
|
|
145
|
+
i === index ? attachment : item
|
|
146
|
+
),
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
form.reset(newPostData);
|
|
150
|
+
setPostData(newPostData);
|
|
151
|
+
}}
|
|
179
152
|
/>
|
|
180
|
-
|
|
181
|
-
|
|
153
|
+
) : null}
|
|
154
|
+
|
|
155
|
+
{isQuestion ? (
|
|
156
|
+
<PollComposerFields form={form} postData={postData} />
|
|
157
|
+
) : null}
|
|
158
|
+
|
|
159
|
+
{showNotify ? (
|
|
160
|
+
<View className="flex-row items-center justify-between py-3">
|
|
161
|
+
<View className="flex-row items-center gap-2">
|
|
162
|
+
<MegaphoneIcon size={20} className="text-foreground" />
|
|
163
|
+
<ThemedText className="text-base">
|
|
164
|
+
{t('posts.form.notifyEveryone')}
|
|
165
|
+
</ThemedText>
|
|
166
|
+
</View>
|
|
167
|
+
<Switch
|
|
168
|
+
checked={notify}
|
|
169
|
+
onCheckedChange={onNotifyChange ?? (() => undefined)}
|
|
170
|
+
/>
|
|
171
|
+
</View>
|
|
172
|
+
) : null}
|
|
173
|
+
|
|
174
|
+
<VisibilitySheet
|
|
175
|
+
type="post"
|
|
176
|
+
ref={visibilityModalRef}
|
|
177
|
+
showDirect
|
|
178
|
+
audienceSetting={{
|
|
179
|
+
visibility: postData.visibility,
|
|
180
|
+
groupId: postData.groupId || undefined,
|
|
181
|
+
audience: postData.audience || [],
|
|
182
|
+
}}
|
|
183
|
+
onSubmit={handleAudienceSelect}
|
|
184
|
+
/>
|
|
185
|
+
</View>
|
|
182
186
|
);
|
|
183
187
|
};
|
|
@@ -22,7 +22,7 @@ export const FeedNote = ({ post }: Props) =>
|
|
|
22
22
|
</View>
|
|
23
23
|
) : (
|
|
24
24
|
<View>
|
|
25
|
-
<ThemedText className="text-
|
|
25
|
+
<ThemedText className="text-destructive">
|
|
26
26
|
This Feed-Note Component was used but the post type on the server is not
|
|
27
27
|
of type "note". Please report this to the Developers
|
|
28
28
|
</ThemedText>
|
|
@@ -24,7 +24,7 @@ export const FeedPoll = ({ post }: Props) =>
|
|
|
24
24
|
</View>
|
|
25
25
|
) : (
|
|
26
26
|
<View>
|
|
27
|
-
<ThemedText className="text-
|
|
27
|
+
<ThemedText className="text-destructive">
|
|
28
28
|
This Feed-Note Component was used but the post type on the server is not
|
|
29
29
|
of type "note". Please report this to the Developers
|
|
30
30
|
</ThemedText>
|
|
@@ -24,7 +24,7 @@ export const ArticleCard = ({ post }: CardArticleProps) => {
|
|
|
24
24
|
id: post.id,
|
|
25
25
|
});
|
|
26
26
|
}}
|
|
27
|
-
className="
|
|
27
|
+
className="mb-6 w-full rounded-lg border border-border"
|
|
28
28
|
>
|
|
29
29
|
{article.image && (
|
|
30
30
|
<View className="w-full h-[200px]">
|
|
@@ -46,7 +46,7 @@ export const CardEvent = ({ post, showEventDate = true }: CardEventProps) => {
|
|
|
46
46
|
occurrence: occurrenceId,
|
|
47
47
|
});
|
|
48
48
|
}}
|
|
49
|
-
className="
|
|
49
|
+
className="mb-6 w-full rounded-lg border border-border"
|
|
50
50
|
>
|
|
51
51
|
<View className="w-full aspect-video overflow-hidden rounded-t-md">
|
|
52
52
|
<Image
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useRef } from 'react';
|
|
2
2
|
import { useOpenpeeps } from '@openpeepshq/react';
|
|
3
|
-
import { EmptyStateContainer } from '../../../custom/index';
|
|
4
3
|
import {
|
|
5
4
|
MoreVerticalIcon,
|
|
6
5
|
ShareIcon,
|
|
@@ -80,7 +79,9 @@ export const FullEvent: React.FC<FullEventProps> = ({ post, occurrence }) => {
|
|
|
80
79
|
const navigation =
|
|
81
80
|
useNavigation<NativeStackNavigationProp<MainStackParamList>>();
|
|
82
81
|
const { openNewPost } = useNewPostModal();
|
|
83
|
-
const [tabValue, setTabValue] = React.useState(
|
|
82
|
+
const [tabValue, setTabValue] = React.useState(
|
|
83
|
+
(post?.data as Event)?.content ? 'description' : 'discussions'
|
|
84
|
+
);
|
|
84
85
|
const { setContt } = useNewConversationStore();
|
|
85
86
|
|
|
86
87
|
const group = useMemo(() => post?.group as Group, [post]);
|
|
@@ -330,17 +331,19 @@ export const FullEvent: React.FC<FullEventProps> = ({ post, occurrence }) => {
|
|
|
330
331
|
className="w-full mx-auto flex-col gap-1.5 mt-5"
|
|
331
332
|
>
|
|
332
333
|
<TabsList className="flex-row w-full bg-transparent border-muted rounded-none border-b p-0 px-3">
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
334
|
+
{event?.content ? (
|
|
335
|
+
<TabsTrigger
|
|
336
|
+
value="description"
|
|
337
|
+
onPress={() => {
|
|
338
|
+
setTabValue('description');
|
|
339
|
+
}}
|
|
340
|
+
className={`${
|
|
341
|
+
tabValue === 'description' ? 'border-b-2 border-foreground' : ''
|
|
342
|
+
}`}
|
|
343
|
+
>
|
|
344
|
+
<ThemedText>Description</ThemedText>
|
|
345
|
+
</TabsTrigger>
|
|
346
|
+
) : null}
|
|
344
347
|
<TabsTrigger
|
|
345
348
|
value="discussions"
|
|
346
349
|
className={`${
|
|
@@ -366,13 +369,11 @@ export const FullEvent: React.FC<FullEventProps> = ({ post, occurrence }) => {
|
|
|
366
369
|
</TabsTrigger>
|
|
367
370
|
)}
|
|
368
371
|
</TabsList>
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
<OpenpeepsMarkdown source={event
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
)}
|
|
375
|
-
</TabsContent>
|
|
372
|
+
{event?.content ? (
|
|
373
|
+
<TabsContent value="description" className="p-0">
|
|
374
|
+
<OpenpeepsMarkdown source={event.content} linkPreviewMode="none" />
|
|
375
|
+
</TabsContent>
|
|
376
|
+
) : null}
|
|
376
377
|
<TabsContent value="discussions" className="flex-1 p-0">
|
|
377
378
|
<ReplyBox post={post} />
|
|
378
379
|
{descendentThreads.map((thread) => (
|
|
@@ -70,7 +70,7 @@ export const MiniProfileCard = ({
|
|
|
70
70
|
showAction = true,
|
|
71
71
|
}: MiniProfileCardProps) => {
|
|
72
72
|
return (
|
|
73
|
-
<View className="flex flex-row gap-x-2
|
|
73
|
+
<View className="flex flex-row items-center gap-x-2 rounded-md border border-border px-2 py-2">
|
|
74
74
|
<ProfileAvatar profile={profile} className="size-8" />
|
|
75
75
|
<ThemedText>
|
|
76
76
|
{truncateText(profile.displayName, 10) || `@${profile.handle}`}
|
|
@@ -24,16 +24,14 @@ export const ProfileHeader = ({
|
|
|
24
24
|
const roles = profile.roles ?? [];
|
|
25
25
|
return (
|
|
26
26
|
<View className="relative mb-8">
|
|
27
|
-
<View className="relative aspect-[3/1] w-full bg-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
profile.header
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
resizeMode="cover"
|
|
36
|
-
/>
|
|
27
|
+
<View className="relative aspect-[3/1] w-full bg-surface-2">
|
|
28
|
+
{profile.header ? (
|
|
29
|
+
<Image
|
|
30
|
+
source={{ uri: profile.header }}
|
|
31
|
+
className="h-full w-full"
|
|
32
|
+
resizeMode="cover"
|
|
33
|
+
/>
|
|
34
|
+
) : null}
|
|
37
35
|
<View className="absolute -bottom-12 left-4 z-10">
|
|
38
36
|
<ProfileAvatar profile={profile} className="size-24" />
|
|
39
37
|
</View>
|
package/src/pages/Explore.tsx
CHANGED
|
@@ -236,7 +236,12 @@ export const Explore: React.FC<ExploreScreenProps> = ({ navigation }) => {
|
|
|
236
236
|
/>
|
|
237
237
|
)}
|
|
238
238
|
uniqueBy={(item) => String(item?.data?.id)}
|
|
239
|
-
ListEmptyComponent={
|
|
239
|
+
ListEmptyComponent={
|
|
240
|
+
<EmptyStateContainer
|
|
241
|
+
type="profiles"
|
|
242
|
+
copyKey="explore.noProfilesFound"
|
|
243
|
+
/>
|
|
244
|
+
}
|
|
240
245
|
/>
|
|
241
246
|
</TabsContent>
|
|
242
247
|
<TabsContent value="posts" className="w-full p-0">
|
|
@@ -251,7 +256,12 @@ export const Explore: React.FC<ExploreScreenProps> = ({ navigation }) => {
|
|
|
251
256
|
<FeedPost key={item.data.id} post={item.data} showReplyTo />
|
|
252
257
|
)}
|
|
253
258
|
uniqueBy={(item) => String(item?.data?.id)}
|
|
254
|
-
ListEmptyComponent={
|
|
259
|
+
ListEmptyComponent={
|
|
260
|
+
<EmptyStateContainer
|
|
261
|
+
type="posts"
|
|
262
|
+
copyKey="explore.noPostsFound"
|
|
263
|
+
/>
|
|
264
|
+
}
|
|
255
265
|
/>
|
|
256
266
|
</TabsContent>
|
|
257
267
|
<TabsContent value="jams" className="w-full p-2">
|
|
@@ -266,7 +276,12 @@ export const Explore: React.FC<ExploreScreenProps> = ({ navigation }) => {
|
|
|
266
276
|
<CardEvent key={item.data.id} post={item.data} />
|
|
267
277
|
)}
|
|
268
278
|
uniqueBy={(item) => String(item?.data?.id)}
|
|
269
|
-
ListEmptyComponent={
|
|
279
|
+
ListEmptyComponent={
|
|
280
|
+
<EmptyStateContainer
|
|
281
|
+
type="my-jams"
|
|
282
|
+
copyKey="explore.noJamsFound"
|
|
283
|
+
/>
|
|
284
|
+
}
|
|
270
285
|
/>
|
|
271
286
|
</TabsContent>
|
|
272
287
|
<TabsContent value="events" className="w-full p-2">
|
|
@@ -281,7 +296,12 @@ export const Explore: React.FC<ExploreScreenProps> = ({ navigation }) => {
|
|
|
281
296
|
<CardEvent key={item.data.id} post={item.data} />
|
|
282
297
|
)}
|
|
283
298
|
uniqueBy={(item) => String(item?.data?.id)}
|
|
284
|
-
ListEmptyComponent={
|
|
299
|
+
ListEmptyComponent={
|
|
300
|
+
<EmptyStateContainer
|
|
301
|
+
type="events"
|
|
302
|
+
copyKey="explore.noEventsFound"
|
|
303
|
+
/>
|
|
304
|
+
}
|
|
285
305
|
/>
|
|
286
306
|
</TabsContent>
|
|
287
307
|
<TabsContent value="groups" className="w-full p-2">
|
|
@@ -303,7 +323,12 @@ export const Explore: React.FC<ExploreScreenProps> = ({ navigation }) => {
|
|
|
303
323
|
/>
|
|
304
324
|
)}
|
|
305
325
|
uniqueBy={(item) => String(item?.data?.id)}
|
|
306
|
-
ListEmptyComponent={
|
|
326
|
+
ListEmptyComponent={
|
|
327
|
+
<EmptyStateContainer
|
|
328
|
+
type="groups"
|
|
329
|
+
copyKey="explore.noGroupsFound"
|
|
330
|
+
/>
|
|
331
|
+
}
|
|
307
332
|
/>
|
|
308
333
|
</TabsContent>
|
|
309
334
|
</Tabs>
|
package/src/pages/Members.tsx
CHANGED
|
@@ -88,7 +88,7 @@ export const Members: React.FC<DirectoryProps> = ({ navigation }) => {
|
|
|
88
88
|
</>
|
|
89
89
|
}
|
|
90
90
|
/>
|
|
91
|
-
<KeyboardAwareScrollView className="w-full grow flex bg-background
|
|
91
|
+
<KeyboardAwareScrollView className="relative w-full grow flex bg-background gap-y-4 border-t border-border p-2">
|
|
92
92
|
{isLoading && <ActivityIndicator size={'small'} />}
|
|
93
93
|
{filteredProfiles?.map((profile, index) => {
|
|
94
94
|
return (
|
|
@@ -117,7 +117,7 @@ export const Members: React.FC<DirectoryProps> = ({ navigation }) => {
|
|
|
117
117
|
})}
|
|
118
118
|
|
|
119
119
|
{filteredProfiles?.length === 0 && (
|
|
120
|
-
<EmptyStateContainer type="profiles" />
|
|
120
|
+
<EmptyStateContainer type="profiles" copyKey="members.empty" />
|
|
121
121
|
)}
|
|
122
122
|
<View className="mb-36" />
|
|
123
123
|
</KeyboardAwareScrollView>
|
|
@@ -136,7 +136,7 @@ export const ConversationsIndex: React.FC<MessagesProps> = ({ navigation }) => {
|
|
|
136
136
|
>
|
|
137
137
|
{isLoading && <ActivityIndicator size={'small'} />}
|
|
138
138
|
{!isLoading && filteredConversations?.length === 0 && (
|
|
139
|
-
<EmptyStateContainer type="messages" />
|
|
139
|
+
<EmptyStateContainer type="messages" copyKey="conversations.empty" />
|
|
140
140
|
)}
|
|
141
141
|
{!isLoading &&
|
|
142
142
|
filteredConversations?.map((conversation, idx) => (
|
|
@@ -118,7 +118,14 @@ export const NewConversation = ({
|
|
|
118
118
|
|
|
119
119
|
{!isLoading && filteredProfiles?.length === 0 && (
|
|
120
120
|
<View className="flex-1 items-center justify-center mt-4 pb-12">
|
|
121
|
-
<EmptyStateContainer
|
|
121
|
+
<EmptyStateContainer
|
|
122
|
+
type="profiles"
|
|
123
|
+
copyKey={
|
|
124
|
+
searchQuery
|
|
125
|
+
? 'profile.selector.emptySearch'
|
|
126
|
+
: 'profile.selector.empty'
|
|
127
|
+
}
|
|
128
|
+
/>
|
|
122
129
|
</View>
|
|
123
130
|
)}
|
|
124
131
|
</KeyboardAwareScrollView>
|
|
@@ -151,7 +151,14 @@ export const GroupsIndex: React.FC<GroupsProps> = ({ navigation }) => {
|
|
|
151
151
|
>
|
|
152
152
|
{isLoading && <ActivityIndicator size={'small'} />}
|
|
153
153
|
{!isLoading && visibleGroups.length === 0 && (
|
|
154
|
-
<EmptyStateContainer
|
|
154
|
+
<EmptyStateContainer
|
|
155
|
+
type="groups"
|
|
156
|
+
copyKey={
|
|
157
|
+
!searchQuery && filterBy === 'my-groups'
|
|
158
|
+
? 'groups.noGroupsYet'
|
|
159
|
+
: 'groups.noGroupsFound'
|
|
160
|
+
}
|
|
161
|
+
/>
|
|
155
162
|
)}
|
|
156
163
|
{!isLoading &&
|
|
157
164
|
visibleGroups.map((group) => (
|
|
@@ -51,13 +51,13 @@ export const GroupInfo = ({ route }: GroupInfoProps) => {
|
|
|
51
51
|
<>
|
|
52
52
|
<ThemedText className="text-2xl">About Group</ThemedText>
|
|
53
53
|
|
|
54
|
-
<View className="
|
|
54
|
+
<View className="my-4 border-b border-border py-4">
|
|
55
55
|
<ThemedText className="text-lg font-semibold">
|
|
56
56
|
Description
|
|
57
57
|
</ThemedText>
|
|
58
58
|
<OpenpeepsMarkdown source={groupData?.description || ''} />
|
|
59
59
|
</View>
|
|
60
|
-
<View className="
|
|
60
|
+
<View className="my-4 space-y-6 border-b border-border py-4">
|
|
61
61
|
<ThemedText className="text-lg font-semibold">Details</ThemedText>
|
|
62
62
|
|
|
63
63
|
<ThemedText className="">
|
|
@@ -130,7 +130,7 @@ export const GroupInfoAsComponent: React.FC<GroupInfoAsComponentProps> = ({
|
|
|
130
130
|
{isLoading && <ActivityIndicator size={'small'} />}
|
|
131
131
|
{!isLoading && (
|
|
132
132
|
<>
|
|
133
|
-
<View className="border-b
|
|
133
|
+
<View className="border-b border-border">
|
|
134
134
|
<ThemedText className="text-lg font-semibold">
|
|
135
135
|
Description
|
|
136
136
|
</ThemedText>
|
|
@@ -140,7 +140,7 @@ export const GroupInfoAsComponent: React.FC<GroupInfoAsComponentProps> = ({
|
|
|
140
140
|
}
|
|
141
141
|
/>
|
|
142
142
|
</View>
|
|
143
|
-
<View className="
|
|
143
|
+
<View className="my-2 flex gap-y-2 border-b border-border py-4">
|
|
144
144
|
<ThemedText className="text-lg font-semibold">Details</ThemedText>
|
|
145
145
|
<View>
|
|
146
146
|
<ThemedText className="font-semibold">Created</ThemedText>
|