@openpeepshq/rn-components 0.3.9 → 0.3.12
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/conversations/ConversationMessageBubble.tsx +1 -1
- package/src/components/custom/common/index.ts +0 -1
- package/src/components/custom/index.ts +0 -1
- package/src/components/custom/navigation/side-menu.tsx +2 -2
- package/src/components/groups/GroupOptionsMenu.tsx +13 -5
- package/src/components/index.ts +1 -0
- package/src/components/jams/CreateNewJam.tsx +11 -10
- package/src/components/jams/JamActionsFooter.tsx +37 -51
- package/src/components/jams/JamCard.tsx +5 -5
- package/src/components/jams/JamLobby.tsx +2 -1
- package/src/components/layout/AuthLayout.tsx +120 -0
- package/src/components/layout/ContentHeader.tsx +62 -0
- package/src/components/layout/HeaderActionButton.tsx +23 -0
- package/src/components/layout/HeaderMobile.tsx +96 -0
- package/src/components/layout/PlusButton.tsx +26 -0
- package/src/components/layout/RootLayout.tsx +30 -0
- package/src/components/layout/index.ts +13 -0
- package/src/components/layout/pageChrome.tsx +75 -0
- package/src/components/navigation/auth-navigator.tsx +2 -2
- package/src/components/navigation/main-navigator.tsx +17 -1
- package/src/components/navigation/parent-back.ts +139 -0
- package/src/components/navigation/tab-navigator.tsx +2 -0
- package/src/components/notifications/types/JamStarted.tsx +8 -6
- package/src/components/notifications/types/Reply.tsx +7 -10
- package/src/components/post/NewEventButton.tsx +23 -16
- package/src/components/post/NewNoteButton.tsx +15 -13
- package/src/components/post/pieces/EventRsvpButton.tsx +22 -18
- package/src/components/post/pieces/ParticipantsCard.tsx +4 -20
- package/src/components/post/types/Article.tsx +3 -1
- package/src/components/post/types/event/CardEvent.tsx +1 -1
- package/src/components/post/types/event/FullEvent.tsx +156 -37
- package/src/components/profile/ProfileCard.tsx +9 -2
- package/src/components/profile/ProfileFromId.tsx +1 -1
- package/src/components/ui/button.tsx +1 -1
- package/src/pages/About.tsx +3 -5
- package/src/pages/CodeOfConduct.tsx +7 -7
- package/src/pages/Explore.tsx +87 -127
- package/src/pages/Members.tsx +31 -39
- package/src/pages/Notifications.tsx +6 -13
- package/src/pages/PostDetail.tsx +22 -16
- package/src/pages/Profile.tsx +3 -2
- package/src/pages/Tags.tsx +72 -13
- package/src/pages/Welcome.tsx +3 -8
- package/src/pages/articles/Edit.tsx +18 -15
- package/src/pages/articles/Index.tsx +11 -21
- package/src/pages/articles/New.tsx +18 -15
- package/src/pages/conversations/Index.tsx +44 -68
- package/src/pages/conversations/Info.tsx +6 -5
- package/src/pages/conversations/New.tsx +14 -13
- package/src/pages/conversations/NewDraft.tsx +5 -5
- package/src/pages/conversations/Show.tsx +24 -22
- package/src/pages/events/Edit.tsx +14 -13
- package/src/pages/events/Index.tsx +28 -32
- package/src/pages/events/My.tsx +7 -7
- package/src/pages/events/New.tsx +14 -13
- package/src/pages/feeds/Bookmarks.tsx +3 -9
- package/src/pages/feeds/Local.tsx +3 -10
- package/src/pages/feeds/My.tsx +3 -9
- package/src/pages/groups/Edit.tsx +6 -7
- package/src/pages/groups/EditInfo.tsx +20 -17
- package/src/pages/groups/EditRoles.tsx +18 -19
- package/src/pages/groups/Index.tsx +82 -119
- package/src/pages/groups/Info.tsx +22 -23
- package/src/pages/groups/Members.tsx +9 -8
- package/src/pages/groups/New.tsx +18 -15
- package/src/pages/groups/Show.tsx +6 -5
- package/src/pages/jams/Index.tsx +8 -26
- package/src/pages/jams/New.tsx +14 -11
- package/src/pages/posts/Edit.tsx +20 -17
- package/src/pages/posts/New.tsx +30 -29
- package/src/pages/posts/Reply.tsx +20 -16
- package/src/pages/profile/Followers.tsx +9 -10
- package/src/pages/profile/Following.tsx +9 -10
- package/src/pages/settings/AccessTokens.tsx +6 -5
- package/src/pages/settings/Account.tsx +13 -12
- package/src/pages/settings/Blocked.tsx +5 -5
- package/src/pages/settings/Feed.tsx +13 -12
- package/src/pages/settings/Index.tsx +3 -11
- package/src/pages/settings/Language.tsx +36 -37
- package/src/pages/settings/NotificationPreferences.tsx +10 -12
- package/src/pages/settings/Notifications.tsx +10 -9
- package/src/pages/settings/PublicProfile.tsx +6 -6
- package/src/pages/settings/PushEnabledDevices.tsx +10 -9
- package/src/pages/settings/Theme.tsx +13 -12
- package/src/pages/settings/Timezone.tsx +27 -28
- package/src/theme/OpenPeepsThemeProvider.tsx +23 -12
- package/src/theme/utils.ts +10 -5
- package/tailwind.config.js +6 -0
- package/src/components/custom/common/plus-fab.tsx +0 -23
- package/src/components/custom/headers/generic-header.tsx +0 -88
- package/src/components/custom/headers/index.ts +0 -2
- package/src/components/custom/headers/tab-screens-header.tsx +0 -199
- package/src/components/navigation/auth-wrapper.tsx +0 -107
|
@@ -27,8 +27,13 @@ import {
|
|
|
27
27
|
Group,
|
|
28
28
|
GroupData,
|
|
29
29
|
buildThreads,
|
|
30
|
+
type JamRecording,
|
|
30
31
|
} from '@openpeepshq/common';
|
|
31
32
|
import { ProfileAvatar } from '../../../profile/Avatar';
|
|
33
|
+
import { ProfileFromId } from '../../../profile/ProfileFromId';
|
|
34
|
+
import { Button } from '../../../ui/button';
|
|
35
|
+
import { UpdatingDate } from '../../../custom/date/updating-date';
|
|
36
|
+
import { VideoPlayer } from '../../pieces/VideoPlayer';
|
|
32
37
|
import { profileName, truncateText } from '../../../../lib/utils';
|
|
33
38
|
import { useNavigation } from '@react-navigation/native';
|
|
34
39
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
@@ -48,6 +53,9 @@ import {
|
|
|
48
53
|
} from '../../../../lib/utils';
|
|
49
54
|
import { bottomSheetPresent } from '../../../../lib/bottom-sheet-ref';
|
|
50
55
|
import {
|
|
56
|
+
canAccessJamRecordings,
|
|
57
|
+
canModerateJam,
|
|
58
|
+
canViewJamAttendees,
|
|
51
59
|
effectiveEventTimes,
|
|
52
60
|
eventTimeZoneOptions,
|
|
53
61
|
formatEventClockTime,
|
|
@@ -117,7 +125,19 @@ export const FullEvent: React.FC<FullEventProps> = ({ post, occurrence }) => {
|
|
|
117
125
|
navigation.navigate('SelectPrivateMessageMembers');
|
|
118
126
|
};
|
|
119
127
|
|
|
120
|
-
const
|
|
128
|
+
const { data: serverInfo } = openpeepsApi.useServerInfo();
|
|
129
|
+
const livekitEnabled = !!serverInfo?.jams.livekit.enabled;
|
|
130
|
+
const myEvent = currentProfile?.id === post?.profile?.id;
|
|
131
|
+
const iAmModerator = canModerateJam(currentProfile, post);
|
|
132
|
+
const canExportAttendees = canViewJamAttendees(currentProfile, post);
|
|
133
|
+
const canViewRecordings = canAccessJamRecordings(currentProfile, post);
|
|
134
|
+
const jamAttendeesQuery = openpeepsApi.useJamAttendance(post.id);
|
|
135
|
+
const recordingsQuery = openpeepsApi.usePostRecordings(
|
|
136
|
+
post.id,
|
|
137
|
+
!!event.jam && canViewRecordings
|
|
138
|
+
);
|
|
139
|
+
const showJamAttendeesTab =
|
|
140
|
+
!!event.jam && canExportAttendees && jamAttendeesQuery.isSuccess;
|
|
121
141
|
|
|
122
142
|
let postContextQuery = openpeepsApi.usePostContext(post.id);
|
|
123
143
|
|
|
@@ -325,49 +345,93 @@ export const FullEvent: React.FC<FullEventProps> = ({ post, occurrence }) => {
|
|
|
325
345
|
/>
|
|
326
346
|
) : null}
|
|
327
347
|
<EventRsvpButton post={post as PublicPost} recurrenceId={occurrence} />
|
|
348
|
+
{event.jam && (myEvent || iAmModerator) ? (
|
|
349
|
+
livekitEnabled ? (
|
|
350
|
+
<Button
|
|
351
|
+
className="mt-2 w-full"
|
|
352
|
+
onPress={() =>
|
|
353
|
+
navigation.navigate('JamSession', { jamId: post.id })
|
|
354
|
+
}
|
|
355
|
+
>
|
|
356
|
+
<ThemedText numberOfLines={1}>
|
|
357
|
+
{t('events.jam.start', { defaultValue: 'Start jam' })}
|
|
358
|
+
</ThemedText>
|
|
359
|
+
</Button>
|
|
360
|
+
) : (
|
|
361
|
+
<ThemedText className="mt-2 text-sm text-destructive">
|
|
362
|
+
{t('jams.unavailable.message')}
|
|
363
|
+
</ThemedText>
|
|
364
|
+
)
|
|
365
|
+
) : null}
|
|
328
366
|
<Tabs
|
|
329
367
|
onValueChange={setTabValue}
|
|
330
368
|
value={tabValue}
|
|
331
|
-
className="w-full
|
|
369
|
+
className="mx-auto mt-5 w-full flex-col gap-1.5"
|
|
332
370
|
>
|
|
333
|
-
<TabsList className="
|
|
371
|
+
<TabsList className="w-full flex-row flex-wrap rounded-none border-b border-muted bg-transparent p-0 px-1">
|
|
334
372
|
{event?.content ? (
|
|
335
373
|
<TabsTrigger
|
|
336
374
|
value="description"
|
|
337
|
-
onPress={() =>
|
|
338
|
-
|
|
339
|
-
}}
|
|
340
|
-
className={`${
|
|
375
|
+
onPress={() => setTabValue('description')}
|
|
376
|
+
className={
|
|
341
377
|
tabValue === 'description' ? 'border-b-2 border-foreground' : ''
|
|
342
|
-
}
|
|
378
|
+
}
|
|
343
379
|
>
|
|
344
|
-
<ThemedText>
|
|
380
|
+
<ThemedText>
|
|
381
|
+
{t('events.tabs.description', { defaultValue: 'Description' })}
|
|
382
|
+
</ThemedText>
|
|
345
383
|
</TabsTrigger>
|
|
346
384
|
) : null}
|
|
347
385
|
<TabsTrigger
|
|
348
386
|
value="discussions"
|
|
349
|
-
className={
|
|
387
|
+
className={
|
|
350
388
|
tabValue === 'discussions' ? 'border-b-2 border-foreground' : ''
|
|
351
|
-
}
|
|
352
|
-
onPress={() =>
|
|
353
|
-
|
|
354
|
-
|
|
389
|
+
}
|
|
390
|
+
onPress={() => setTabValue('discussions')}
|
|
391
|
+
>
|
|
392
|
+
<ThemedText>
|
|
393
|
+
{t('events.tabs.discussion', { defaultValue: 'Discussion' })}
|
|
394
|
+
</ThemedText>
|
|
395
|
+
</TabsTrigger>
|
|
396
|
+
<TabsTrigger
|
|
397
|
+
value="rsvps"
|
|
398
|
+
className={
|
|
399
|
+
tabValue === 'rsvps' ? 'border-b-2 border-foreground' : ''
|
|
400
|
+
}
|
|
401
|
+
onPress={() => setTabValue('rsvps')}
|
|
355
402
|
>
|
|
356
|
-
<ThemedText>
|
|
403
|
+
<ThemedText>
|
|
404
|
+
{t('events.tabs.rsvps', { defaultValue: 'RSVPs' })}
|
|
405
|
+
</ThemedText>
|
|
357
406
|
</TabsTrigger>
|
|
358
|
-
{
|
|
407
|
+
{showJamAttendeesTab ? (
|
|
359
408
|
<TabsTrigger
|
|
360
409
|
value="attendees"
|
|
361
|
-
className={
|
|
410
|
+
className={
|
|
362
411
|
tabValue === 'attendees' ? 'border-b-2 border-foreground' : ''
|
|
363
|
-
}
|
|
364
|
-
onPress={() =>
|
|
365
|
-
setTabValue('attendees');
|
|
366
|
-
}}
|
|
412
|
+
}
|
|
413
|
+
onPress={() => setTabValue('attendees')}
|
|
367
414
|
>
|
|
368
|
-
<ThemedText>
|
|
415
|
+
<ThemedText>
|
|
416
|
+
{t('events.tabs.jamAttendees', {
|
|
417
|
+
defaultValue: 'Jam attendees',
|
|
418
|
+
})}
|
|
419
|
+
</ThemedText>
|
|
369
420
|
</TabsTrigger>
|
|
370
|
-
)}
|
|
421
|
+
) : null}
|
|
422
|
+
{event.jam ? (
|
|
423
|
+
<TabsTrigger
|
|
424
|
+
value="recordings"
|
|
425
|
+
className={
|
|
426
|
+
tabValue === 'recordings' ? 'border-b-2 border-foreground' : ''
|
|
427
|
+
}
|
|
428
|
+
onPress={() => setTabValue('recordings')}
|
|
429
|
+
>
|
|
430
|
+
<ThemedText>
|
|
431
|
+
{t('events.tabs.recordings', { defaultValue: 'Recordings' })}
|
|
432
|
+
</ThemedText>
|
|
433
|
+
</TabsTrigger>
|
|
434
|
+
) : null}
|
|
371
435
|
</TabsList>
|
|
372
436
|
{event?.content ? (
|
|
373
437
|
<TabsContent value="description" className="p-0">
|
|
@@ -380,22 +444,77 @@ export const FullEvent: React.FC<FullEventProps> = ({ post, occurrence }) => {
|
|
|
380
444
|
<ThreadedFeed key={thread.id} thread={thread} />
|
|
381
445
|
))}
|
|
382
446
|
</TabsContent>
|
|
383
|
-
|
|
447
|
+
<TabsContent value="rsvps" className="px-0 py-4">
|
|
448
|
+
<EventRsvpList
|
|
449
|
+
post={post as PublicPost}
|
|
450
|
+
occurrenceId={occurrence}
|
|
451
|
+
occurrences={upcomingOccurrences}
|
|
452
|
+
canManageRsvps={canManageRsvps}
|
|
453
|
+
onManage={(response, profileId, recurrenceId) =>
|
|
454
|
+
rsvpManage({ response, recurrenceId }, { id: post.id, profileId })
|
|
455
|
+
}
|
|
456
|
+
/>
|
|
457
|
+
</TabsContent>
|
|
458
|
+
{showJamAttendeesTab ? (
|
|
384
459
|
<TabsContent value="attendees" className="px-0 py-4">
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
{
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
460
|
+
{jamAttendeesQuery.data?.length ? (
|
|
461
|
+
jamAttendeesQuery.data.map((attendee) => (
|
|
462
|
+
<View
|
|
463
|
+
key={attendee.id}
|
|
464
|
+
className="flex-row items-center justify-between py-2"
|
|
465
|
+
>
|
|
466
|
+
<ProfileFromId id={attendee.profileId} />
|
|
467
|
+
<UpdatingDate date={attendee.createdAt} />
|
|
468
|
+
</View>
|
|
469
|
+
))
|
|
470
|
+
) : (
|
|
471
|
+
<ThemedText className="py-4 text-sm text-muted-foreground">
|
|
472
|
+
{t('events.noAttendees', { defaultValue: 'No attendees yet.' })}
|
|
473
|
+
</ThemedText>
|
|
474
|
+
)}
|
|
397
475
|
</TabsContent>
|
|
398
|
-
)}
|
|
476
|
+
) : null}
|
|
477
|
+
{event.jam ? (
|
|
478
|
+
<TabsContent value="recordings" className="px-0 py-4">
|
|
479
|
+
{!canViewRecordings ? (
|
|
480
|
+
<ThemedText className="py-4 text-center text-sm text-muted-foreground">
|
|
481
|
+
{t('error.jamRecordingForbidden', {
|
|
482
|
+
defaultValue:
|
|
483
|
+
"You don't have permission to view recordings for this jam.",
|
|
484
|
+
})}
|
|
485
|
+
</ThemedText>
|
|
486
|
+
) : recordingsQuery.isLoading ? (
|
|
487
|
+
<ThemedText className="py-4 text-sm text-muted-foreground">
|
|
488
|
+
{t('common.loading', { defaultValue: 'Loading…' })}
|
|
489
|
+
</ThemedText>
|
|
490
|
+
) : recordingsQuery.data?.length ? (
|
|
491
|
+
recordingsQuery.data.map((recording: JamRecording) => (
|
|
492
|
+
<View key={recording.id} className="gap-y-2 py-4">
|
|
493
|
+
<UpdatingDate date={recording.createdAt} />
|
|
494
|
+
{recording.status === 'completed' && recording.attachment ? (
|
|
495
|
+
<VideoPlayer attachment={recording.attachment} />
|
|
496
|
+
) : (
|
|
497
|
+
<ThemedText className="text-sm text-muted-foreground">
|
|
498
|
+
{recording.status === 'active'
|
|
499
|
+
? t('events.recordingInProgress', {
|
|
500
|
+
defaultValue: 'Recording in progress…',
|
|
501
|
+
})
|
|
502
|
+
: t('events.recordingProcessing', {
|
|
503
|
+
defaultValue: 'Processing recording…',
|
|
504
|
+
})}
|
|
505
|
+
</ThemedText>
|
|
506
|
+
)}
|
|
507
|
+
</View>
|
|
508
|
+
))
|
|
509
|
+
) : (
|
|
510
|
+
<ThemedText className="py-4 text-sm text-muted-foreground">
|
|
511
|
+
{t('events.noRecordings', {
|
|
512
|
+
defaultValue: 'No recordings yet.',
|
|
513
|
+
})}
|
|
514
|
+
</ThemedText>
|
|
515
|
+
)}
|
|
516
|
+
</TabsContent>
|
|
517
|
+
) : null}
|
|
399
518
|
</Tabs>
|
|
400
519
|
</ThemedView>
|
|
401
520
|
);
|
|
@@ -32,7 +32,11 @@ export const ProfileCard = ({
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<View
|
|
35
|
+
<View
|
|
36
|
+
className={`w-full flex-row items-center justify-between px-4 ${
|
|
37
|
+
actionType === 'select' ? 'mb-1 py-1' : 'mb-8'
|
|
38
|
+
}`}
|
|
39
|
+
>
|
|
36
40
|
<TouchableWithoutFeedback
|
|
37
41
|
onPress={() => {
|
|
38
42
|
if (actionType === 'select' && handleSelectProfile) {
|
|
@@ -44,7 +48,10 @@ export const ProfileCard = ({
|
|
|
44
48
|
}}
|
|
45
49
|
>
|
|
46
50
|
<View className="flex flex-row items-center gap-x-2">
|
|
47
|
-
<ProfileAvatar
|
|
51
|
+
<ProfileAvatar
|
|
52
|
+
profile={profile}
|
|
53
|
+
className={actionType === 'select' ? 'size-10' : 'size-16'}
|
|
54
|
+
/>
|
|
48
55
|
<View className="">
|
|
49
56
|
<ThemedText className="text-lg font-semibold">
|
|
50
57
|
{truncateText(profile.displayName, 18) || profile.handle}
|
|
@@ -16,7 +16,7 @@ export const ProfileFromId = ({ id }: AvatarFromIdProps) => {
|
|
|
16
16
|
<View>
|
|
17
17
|
{isLoading && <ActivityIndicator size={'small'} />}
|
|
18
18
|
{!isLoading && (
|
|
19
|
-
<ProfileAvatar className="
|
|
19
|
+
<ProfileAvatar className="-mr-2 size-8" profile={profile as Profile} />
|
|
20
20
|
)}
|
|
21
21
|
</View>
|
|
22
22
|
);
|
|
@@ -5,7 +5,7 @@ import { TextClassContext } from './themed-text';
|
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
|
-
'group flex items-center justify-center rounded-
|
|
8
|
+
'group flex items-center justify-center rounded-button web:ring-offset-background web:transition-colors web:focus-visible:outline-none web:focus-visible:ring-2 web:focus-visible:ring-ring web:focus-visible:ring-offset-2',
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
package/src/pages/About.tsx
CHANGED
|
@@ -2,10 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { ScrollView } from 'react-native';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useCommunityInfoPages } from '@openpeepshq/react';
|
|
5
|
-
import {
|
|
5
|
+
import { AuthLayout } from '../components/layout';
|
|
6
6
|
import { OpenpeepsMarkdown } from '../components/markdown/index';
|
|
7
7
|
import { MainScreenProps } from '../components/navigation/types/index';
|
|
8
|
-
import { ThemedSafeAreaView } from '../components/ui/themed-safe-area-view';
|
|
9
8
|
import { ThemedText } from '../components/ui/themed-text';
|
|
10
9
|
|
|
11
10
|
export const About: React.FC<MainScreenProps<'About'>> = () => {
|
|
@@ -13,8 +12,7 @@ export const About: React.FC<MainScreenProps<'About'>> = () => {
|
|
|
13
12
|
const { communityName, aboutPage } = useCommunityInfoPages();
|
|
14
13
|
|
|
15
14
|
return (
|
|
16
|
-
<
|
|
17
|
-
<GenericHeader title={t('navigation.about', { defaultValue: 'About' })} />
|
|
15
|
+
<AuthLayout noRedirect>
|
|
18
16
|
<ScrollView contentContainerClassName="p-4 pb-12">
|
|
19
17
|
<ThemedText className="text-2xl font-bold pb-4">
|
|
20
18
|
{t('about.welcomeTo', {
|
|
@@ -24,6 +22,6 @@ export const About: React.FC<MainScreenProps<'About'>> = () => {
|
|
|
24
22
|
</ThemedText>
|
|
25
23
|
<OpenpeepsMarkdown source={aboutPage} />
|
|
26
24
|
</ScrollView>
|
|
27
|
-
</
|
|
25
|
+
</AuthLayout>
|
|
28
26
|
);
|
|
29
27
|
};
|
|
@@ -2,23 +2,23 @@ import React from 'react';
|
|
|
2
2
|
import { ScrollView } from 'react-native';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useCommunityInfoPages } from '@openpeepshq/react';
|
|
5
|
-
import {
|
|
5
|
+
import { AuthLayout } from '../components/layout';
|
|
6
6
|
import { OpenpeepsMarkdown } from '../components/markdown/index';
|
|
7
7
|
import { MainScreenProps } from '../components/navigation/types/index';
|
|
8
|
-
import {
|
|
8
|
+
import { ThemedText } from '../components/ui/themed-text';
|
|
9
9
|
|
|
10
10
|
export const CodeOfConduct: React.FC<MainScreenProps<'CodeOfConduct'>> = () => {
|
|
11
11
|
const { t } = useTranslation();
|
|
12
12
|
const { codeOfConduct } = useCommunityInfoPages();
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
|
-
<
|
|
16
|
-
<GenericHeader
|
|
17
|
-
title={t('codeOfConduct.title', { defaultValue: 'Code of conduct' })}
|
|
18
|
-
/>
|
|
15
|
+
<AuthLayout noRedirect>
|
|
19
16
|
<ScrollView contentContainerClassName="p-4 pb-12">
|
|
17
|
+
<ThemedText className="text-2xl font-bold pb-4">
|
|
18
|
+
{t('codeOfConduct.title', { defaultValue: 'Code of conduct' })}
|
|
19
|
+
</ThemedText>
|
|
20
20
|
<OpenpeepsMarkdown source={codeOfConduct} />
|
|
21
21
|
</ScrollView>
|
|
22
|
-
</
|
|
22
|
+
</AuthLayout>
|
|
23
23
|
);
|
|
24
24
|
};
|
package/src/pages/Explore.tsx
CHANGED
|
@@ -14,8 +14,8 @@ import { CompositeScreenProps } from '@react-navigation/native';
|
|
|
14
14
|
import {
|
|
15
15
|
EmptyStateContainer,
|
|
16
16
|
InfiniteScrollContainer,
|
|
17
|
-
TabScreensHeader,
|
|
18
17
|
} from '../components/custom/index';
|
|
18
|
+
import { useSetPageHeader } from '../components/layout';
|
|
19
19
|
import { ThemedText } from '../components/ui/themed-text';
|
|
20
20
|
import { useTranslation } from 'react-i18next';
|
|
21
21
|
import { Pressable, TouchableOpacity, View, ScrollView } from 'react-native';
|
|
@@ -58,139 +58,99 @@ export const Explore: React.FC<ExploreScreenProps> = ({ navigation }) => {
|
|
|
58
58
|
[currentProfile]
|
|
59
59
|
);
|
|
60
60
|
|
|
61
|
+
useSetPageHeader(
|
|
62
|
+
t('navigation.explore'),
|
|
63
|
+
isSearchToggled ? (
|
|
64
|
+
<View className="max-w-[200px] flex-row items-center">
|
|
65
|
+
<Input
|
|
66
|
+
className="flex-1"
|
|
67
|
+
placeholder={t('explore.searchPlaceholder', {
|
|
68
|
+
defaultValue: 'Search',
|
|
69
|
+
})}
|
|
70
|
+
value={searchQuery}
|
|
71
|
+
onChangeText={setSearchQuery}
|
|
72
|
+
/>
|
|
73
|
+
<TouchableOpacity
|
|
74
|
+
className="items-center justify-center px-2"
|
|
75
|
+
onPress={() => {
|
|
76
|
+
setSearchQuery('');
|
|
77
|
+
setIsSearchToggled(false);
|
|
78
|
+
setTabValue('landing');
|
|
79
|
+
}}
|
|
80
|
+
>
|
|
81
|
+
<XIcon size={20} className="text-foreground" />
|
|
82
|
+
</TouchableOpacity>
|
|
83
|
+
</View>
|
|
84
|
+
) : (
|
|
85
|
+
<TouchableOpacity onPress={() => setIsSearchToggled(true)}>
|
|
86
|
+
<SearchIcon size={20} className="text-foreground" />
|
|
87
|
+
</TouchableOpacity>
|
|
88
|
+
)
|
|
89
|
+
);
|
|
90
|
+
|
|
61
91
|
return (
|
|
62
92
|
<ThemedView className="grow">
|
|
63
93
|
<Tabs
|
|
64
94
|
value={tabValue}
|
|
65
95
|
onValueChange={setTabValue}
|
|
66
|
-
className="w-full
|
|
96
|
+
className="mx-auto w-full flex-col gap-1.5"
|
|
67
97
|
>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
98
|
+
{isSearchToggled ? (
|
|
99
|
+
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
|
100
|
+
<TabsList className="flex-row w-full bg-transparent border-muted rounded-none border-b p-0">
|
|
101
|
+
<TabsTrigger
|
|
102
|
+
value="landing"
|
|
103
|
+
className="hidden"
|
|
104
|
+
onPress={() => setTabValue('hidden')}
|
|
105
|
+
/>
|
|
106
|
+
<TabsTrigger
|
|
107
|
+
value="members"
|
|
108
|
+
className={
|
|
109
|
+
tabValue === 'members' ? 'border-b-2 border-foreground' : ''
|
|
110
|
+
}
|
|
111
|
+
onPress={() => setTabValue('members')}
|
|
82
112
|
>
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}}
|
|
125
|
-
>
|
|
126
|
-
<ThemedText>Members</ThemedText>
|
|
127
|
-
</TabsTrigger>
|
|
128
|
-
<TabsTrigger
|
|
129
|
-
value="posts"
|
|
130
|
-
className={`${
|
|
131
|
-
tabValue === 'posts'
|
|
132
|
-
? 'border-b-2 border-foreground'
|
|
133
|
-
: ''
|
|
134
|
-
}`}
|
|
135
|
-
onPress={() => {
|
|
136
|
-
setTabValue('posts');
|
|
137
|
-
}}
|
|
138
|
-
>
|
|
139
|
-
<ThemedText>Posts</ThemedText>
|
|
140
|
-
</TabsTrigger>
|
|
141
|
-
<TabsTrigger
|
|
142
|
-
value="jams"
|
|
143
|
-
className={`${
|
|
144
|
-
tabValue === 'jams'
|
|
145
|
-
? 'border-b-2 border-foreground'
|
|
146
|
-
: ''
|
|
147
|
-
}`}
|
|
148
|
-
onPress={() => {
|
|
149
|
-
setTabValue('jams');
|
|
150
|
-
}}
|
|
151
|
-
>
|
|
152
|
-
<ThemedText>Jams</ThemedText>
|
|
153
|
-
</TabsTrigger>
|
|
154
|
-
<TabsTrigger
|
|
155
|
-
value="events"
|
|
156
|
-
className={`${
|
|
157
|
-
tabValue === 'events'
|
|
158
|
-
? 'border-b-2 border-foreground'
|
|
159
|
-
: ''
|
|
160
|
-
}`}
|
|
161
|
-
onPress={() => {
|
|
162
|
-
setTabValue('events');
|
|
163
|
-
}}
|
|
164
|
-
>
|
|
165
|
-
<ThemedText>Events</ThemedText>
|
|
166
|
-
</TabsTrigger>
|
|
167
|
-
<TabsTrigger
|
|
168
|
-
value="groups"
|
|
169
|
-
className={`${
|
|
170
|
-
tabValue === 'groups'
|
|
171
|
-
? 'border-b-2 border-foreground'
|
|
172
|
-
: ''
|
|
173
|
-
}`}
|
|
174
|
-
onPress={() => {
|
|
175
|
-
setTabValue('groups');
|
|
176
|
-
}}
|
|
177
|
-
>
|
|
178
|
-
<ThemedText>Groups</ThemedText>
|
|
179
|
-
</TabsTrigger>
|
|
180
|
-
</TabsList>
|
|
181
|
-
</ScrollView>
|
|
182
|
-
</>
|
|
183
|
-
) : (
|
|
184
|
-
<>
|
|
185
|
-
<TouchableOpacity onPress={() => setIsSearchToggled(true)}>
|
|
186
|
-
<SearchIcon size={20} className="text-foreground" />
|
|
187
|
-
</TouchableOpacity>
|
|
188
|
-
</>
|
|
189
|
-
)}
|
|
190
|
-
</View>
|
|
191
|
-
</View>
|
|
192
|
-
}
|
|
193
|
-
/>
|
|
113
|
+
<ThemedText>Members</ThemedText>
|
|
114
|
+
</TabsTrigger>
|
|
115
|
+
<TabsTrigger
|
|
116
|
+
value="posts"
|
|
117
|
+
className={
|
|
118
|
+
tabValue === 'posts' ? 'border-b-2 border-foreground' : ''
|
|
119
|
+
}
|
|
120
|
+
onPress={() => setTabValue('posts')}
|
|
121
|
+
>
|
|
122
|
+
<ThemedText>Posts</ThemedText>
|
|
123
|
+
</TabsTrigger>
|
|
124
|
+
<TabsTrigger
|
|
125
|
+
value="jams"
|
|
126
|
+
className={
|
|
127
|
+
tabValue === 'jams' ? 'border-b-2 border-foreground' : ''
|
|
128
|
+
}
|
|
129
|
+
onPress={() => setTabValue('jams')}
|
|
130
|
+
>
|
|
131
|
+
<ThemedText>Jams</ThemedText>
|
|
132
|
+
</TabsTrigger>
|
|
133
|
+
<TabsTrigger
|
|
134
|
+
value="events"
|
|
135
|
+
className={
|
|
136
|
+
tabValue === 'events' ? 'border-b-2 border-foreground' : ''
|
|
137
|
+
}
|
|
138
|
+
onPress={() => setTabValue('events')}
|
|
139
|
+
>
|
|
140
|
+
<ThemedText>Events</ThemedText>
|
|
141
|
+
</TabsTrigger>
|
|
142
|
+
<TabsTrigger
|
|
143
|
+
value="groups"
|
|
144
|
+
className={
|
|
145
|
+
tabValue === 'groups' ? 'border-b-2 border-foreground' : ''
|
|
146
|
+
}
|
|
147
|
+
onPress={() => setTabValue('groups')}
|
|
148
|
+
>
|
|
149
|
+
<ThemedText>Groups</ThemedText>
|
|
150
|
+
</TabsTrigger>
|
|
151
|
+
</TabsList>
|
|
152
|
+
</ScrollView>
|
|
153
|
+
) : null}
|
|
194
154
|
<TabsContent
|
|
195
155
|
value="landing"
|
|
196
156
|
className="w-full flex h-64 items-center justify-center"
|