@openpeepshq/rn-components 0.3.11 → 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.
Files changed (74) hide show
  1. package/package.json +3 -3
  2. package/src/components/custom/common/index.ts +0 -1
  3. package/src/components/custom/index.ts +0 -1
  4. package/src/components/index.ts +1 -0
  5. package/src/components/jams/CreateNewJam.tsx +11 -10
  6. package/src/components/layout/AuthLayout.tsx +120 -0
  7. package/src/components/layout/ContentHeader.tsx +62 -0
  8. package/src/components/layout/HeaderActionButton.tsx +23 -0
  9. package/src/components/layout/HeaderMobile.tsx +96 -0
  10. package/src/components/layout/PlusButton.tsx +26 -0
  11. package/src/components/layout/RootLayout.tsx +30 -0
  12. package/src/components/layout/index.ts +13 -0
  13. package/src/components/layout/pageChrome.tsx +75 -0
  14. package/src/components/navigation/auth-navigator.tsx +2 -2
  15. package/src/components/navigation/main-navigator.tsx +17 -1
  16. package/src/components/navigation/tab-navigator.tsx +2 -0
  17. package/src/components/post/NewEventButton.tsx +23 -16
  18. package/src/components/post/NewNoteButton.tsx +15 -13
  19. package/src/pages/About.tsx +3 -5
  20. package/src/pages/CodeOfConduct.tsx +7 -7
  21. package/src/pages/Explore.tsx +87 -127
  22. package/src/pages/Members.tsx +31 -39
  23. package/src/pages/Notifications.tsx +6 -13
  24. package/src/pages/PostDetail.tsx +12 -16
  25. package/src/pages/Profile.tsx +3 -2
  26. package/src/pages/Tags.tsx +74 -16
  27. package/src/pages/Welcome.tsx +3 -8
  28. package/src/pages/articles/Edit.tsx +18 -15
  29. package/src/pages/articles/Index.tsx +11 -21
  30. package/src/pages/articles/New.tsx +18 -15
  31. package/src/pages/conversations/Index.tsx +44 -68
  32. package/src/pages/conversations/Info.tsx +6 -5
  33. package/src/pages/conversations/New.tsx +14 -13
  34. package/src/pages/conversations/NewDraft.tsx +5 -5
  35. package/src/pages/conversations/Show.tsx +16 -20
  36. package/src/pages/events/Edit.tsx +14 -13
  37. package/src/pages/events/Index.tsx +28 -32
  38. package/src/pages/events/My.tsx +7 -7
  39. package/src/pages/events/New.tsx +14 -13
  40. package/src/pages/feeds/Bookmarks.tsx +3 -9
  41. package/src/pages/feeds/Local.tsx +3 -10
  42. package/src/pages/feeds/My.tsx +3 -9
  43. package/src/pages/groups/Edit.tsx +6 -7
  44. package/src/pages/groups/EditInfo.tsx +20 -17
  45. package/src/pages/groups/EditRoles.tsx +18 -19
  46. package/src/pages/groups/Index.tsx +82 -119
  47. package/src/pages/groups/Info.tsx +22 -23
  48. package/src/pages/groups/Members.tsx +9 -8
  49. package/src/pages/groups/New.tsx +18 -15
  50. package/src/pages/groups/Show.tsx +6 -5
  51. package/src/pages/jams/Index.tsx +8 -26
  52. package/src/pages/jams/New.tsx +14 -11
  53. package/src/pages/posts/Edit.tsx +20 -17
  54. package/src/pages/posts/New.tsx +30 -29
  55. package/src/pages/posts/Reply.tsx +20 -16
  56. package/src/pages/profile/Followers.tsx +9 -10
  57. package/src/pages/profile/Following.tsx +9 -10
  58. package/src/pages/settings/AccessTokens.tsx +6 -5
  59. package/src/pages/settings/Account.tsx +13 -12
  60. package/src/pages/settings/Blocked.tsx +5 -5
  61. package/src/pages/settings/Feed.tsx +13 -12
  62. package/src/pages/settings/Index.tsx +4 -24
  63. package/src/pages/settings/Language.tsx +36 -37
  64. package/src/pages/settings/NotificationPreferences.tsx +10 -12
  65. package/src/pages/settings/Notifications.tsx +10 -9
  66. package/src/pages/settings/PublicProfile.tsx +6 -6
  67. package/src/pages/settings/PushEnabledDevices.tsx +10 -9
  68. package/src/pages/settings/Theme.tsx +13 -12
  69. package/src/pages/settings/Timezone.tsx +27 -28
  70. package/src/components/custom/common/plus-fab.tsx +0 -23
  71. package/src/components/custom/headers/generic-header.tsx +0 -103
  72. package/src/components/custom/headers/index.ts +0 -2
  73. package/src/components/custom/headers/tab-screens-header.tsx +0 -206
  74. package/src/components/navigation/auth-wrapper.tsx +0 -107
@@ -4,13 +4,13 @@ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { groupName } from '@openpeepshq/common/lib';
6
6
  import { useOpenpeeps } from '@openpeepshq/react';
7
- import { GenericHeader } from '../../components/custom/index';
7
+ import { useSetPageHeader } from '../../components/layout';
8
+ import { ThemedView } from '../../components/ui/themed-view';
8
9
  import {
9
10
  AddGroupMembersButton,
10
11
  GroupMembersList,
11
12
  } from '../../components/groups/index';
12
13
  import { MainScreenProps } from '../../components/navigation/types/index';
13
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
14
14
  import { ThemedText } from '../../components/ui/themed-text';
15
15
  import { truncateText } from '../../lib/utils';
16
16
 
@@ -27,12 +27,13 @@ export const GroupMembers = ({ route }: GroupMembersProps) => {
27
27
  ? `${truncateText(groupName(group), 20)} - ${t('groups.members.title')}`
28
28
  : t('groups.members.title');
29
29
 
30
+ useSetPageHeader(
31
+ title,
32
+ group ? <AddGroupMembersButton group={group} /> : undefined
33
+ );
34
+
30
35
  return (
31
- <ThemedSafeAreaView className="relative flex-1">
32
- <GenericHeader
33
- title={title}
34
- rightElement={group ? <AddGroupMembersButton group={group} /> : null}
35
- />
36
+ <ThemedView className="relative flex-1">
36
37
  <KeyboardAwareScrollView
37
38
  contentContainerClassName="grow"
38
39
  className="relative flex w-full bg-background"
@@ -49,6 +50,6 @@ export const GroupMembers = ({ route }: GroupMembersProps) => {
49
50
  <GroupMembersList group={group} />
50
51
  )}
51
52
  </KeyboardAwareScrollView>
52
- </ThemedSafeAreaView>
53
+ </ThemedView>
53
54
  );
54
55
  };
@@ -4,12 +4,12 @@ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import Toast from 'react-native-toast-message';
6
6
  import { useCurrentProfile, useNewGroup } from '@openpeepshq/react';
7
- import { GenericHeader } from '../../components/custom/index';
7
+ import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
8
+ import { ThemedView } from '../../components/ui/themed-view';
8
9
  import { GroupForm } from '../../components/groups/index';
9
10
  import { MainScreenProps } from '../../components/navigation/types/index';
10
11
  import { ProfilesInput } from '../../components/profile/index';
11
12
  import { Label } from '../../components/ui/label';
12
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
13
13
 
14
14
  type NewGroupProps = MainScreenProps<'CreateGroup'>;
15
15
 
@@ -34,19 +34,22 @@ export const NewGroup: React.FC<NewGroupProps> = () => {
34
34
  clearError();
35
35
  }, [error, clearError]);
36
36
 
37
+ useSetPageHeader(
38
+ t('groups.new.title', { defaultValue: 'Create group' }),
39
+ <HeaderActionButton
40
+ title={
41
+ submitting
42
+ ? t('common.submitting', { defaultValue: 'Creating…' })
43
+ : t('common.submit', { defaultValue: 'Create group' })
44
+ }
45
+ onPress={() => void submit()}
46
+ disabled={submitting}
47
+ loading={submitting}
48
+ />
49
+ );
50
+
37
51
  return (
38
- <ThemedSafeAreaView className="flex-1">
39
- <GenericHeader
40
- title={t('groups.new.title', { defaultValue: 'Create group' })}
41
- rightButtonTitle={
42
- submitting
43
- ? t('common.submitting', { defaultValue: 'Creating…' })
44
- : t('common.submit', { defaultValue: 'Create group' })
45
- }
46
- onRightButtonPress={() => void submit()}
47
- rightButtonDisabled={submitting}
48
- rightType="button"
49
- />
52
+ <ThemedView className="flex-1">
50
53
  <KeyboardAwareScrollView
51
54
  contentContainerClassName="grow"
52
55
  className="w-full p-4"
@@ -72,6 +75,6 @@ export const NewGroup: React.FC<NewGroupProps> = () => {
72
75
  </View>
73
76
  </View>
74
77
  </KeyboardAwareScrollView>
75
- </ThemedSafeAreaView>
78
+ </ThemedView>
76
79
  );
77
80
  };
@@ -11,7 +11,8 @@ import { CompositeScreenProps } from '@react-navigation/native';
11
11
  import { NativeStackScreenProps } from '@react-navigation/native-stack';
12
12
  import { groupName } from '@openpeepshq/common/lib';
13
13
  import { useCurrentProfile, useOpenpeeps } from '@openpeepshq/react';
14
- import { GenericHeader } from '../../components/custom/index';
14
+ import { useSetPageHeader } from '../../components/layout';
15
+ import { ThemedView } from '../../components/ui/themed-view';
15
16
  import { GroupFeed, GroupHeader } from '../../components/groups/index';
16
17
  import {
17
18
  MainStackParamList,
@@ -28,7 +29,6 @@ import {
28
29
  TabsList,
29
30
  TabsTrigger,
30
31
  } from '../../components/ui/tabs';
31
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
32
32
  import { ThemedText } from '../../components/ui/themed-text';
33
33
  import { truncateText } from '../../lib/utils';
34
34
  import { GroupInfoAsComponent } from './Info';
@@ -77,9 +77,10 @@ export const GroupShow = ({ route, navigation }: GroupProps) => {
77
77
  const tabClass = (value: Tab) =>
78
78
  tab === value ? 'border-b-2 border-primary font-semibold' : '';
79
79
 
80
+ useSetPageHeader(truncateText(group ? groupName(group) : '', 30));
81
+
80
82
  return (
81
- <ThemedSafeAreaView className="relative flex-1">
82
- <GenericHeader title={truncateText(group ? groupName(group) : '', 30)} />
83
+ <ThemedView className="relative flex-1">
83
84
  <KeyboardAwareScrollView
84
85
  refreshControl={
85
86
  <RefreshControl
@@ -179,6 +180,6 @@ export const GroupShow = ({ route, navigation }: GroupProps) => {
179
180
  group={group}
180
181
  />
181
182
  ) : null}
182
- </ThemedSafeAreaView>
183
+ </ThemedView>
183
184
  );
184
185
  };
@@ -4,7 +4,8 @@ import { useTranslation } from 'react-i18next';
4
4
  import { useNavigation } from '@react-navigation/native';
5
5
  import { NativeStackNavigationProp } from '@react-navigation/native-stack';
6
6
  import { useOpenpeeps, useServerInfo } from '@openpeepshq/react';
7
- import { GenericHeader, TabScreensHeader } from '../../components/custom/index';
7
+ import { useSetPageHeader } from '../../components/layout';
8
+ import { ThemedView } from '../../components/ui/themed-view';
8
9
  import {
9
10
  ChevronRightIcon,
10
11
  MoreHorizontalIcon,
@@ -20,7 +21,6 @@ import {
20
21
  DropdownMenuItem,
21
22
  DropdownMenuTrigger,
22
23
  } from '../../components/ui/dropdown-menu';
23
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
24
24
  import { ThemedText } from '../../components/ui/themed-text';
25
25
 
26
26
  interface Props {
@@ -123,33 +123,15 @@ export const JamsIndex = ({ my = false }: Props) => {
123
123
  </ScrollView>
124
124
  );
125
125
 
126
- if (my) {
127
- return (
128
- <ThemedSafeAreaView className="relative flex-1">
129
- <GenericHeader
130
- title={t('navigation.myJams')}
131
- rightElement={headerActions}
132
- />
133
- {livekitEnabled ? <CreateNewJam /> : null}
134
- {body}
135
- </ThemedSafeAreaView>
136
- );
137
- }
126
+ useSetPageHeader(
127
+ my ? t('navigation.myJams') : t('navigation.jams'),
128
+ headerActions
129
+ );
138
130
 
139
131
  return (
140
- <View className="relative flex-1">
141
- <TabScreensHeader
142
- children={
143
- <View className="flex-row items-center justify-between p-2">
144
- <ThemedText className="text-2xl font-semibold">
145
- {t('navigation.jams')}
146
- </ThemedText>
147
- {headerActions}
148
- </View>
149
- }
150
- />
132
+ <ThemedView className="relative flex-1">
151
133
  {livekitEnabled ? <CreateNewJam /> : null}
152
134
  {body}
153
- </View>
135
+ </ThemedView>
154
136
  );
155
137
  };
@@ -3,7 +3,8 @@ import { View } from 'react-native';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
5
5
  import { useCreateNewJamForm } from '@openpeepshq/react';
6
- import { GenericHeader } from '../../components/custom/index';
6
+ import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
7
+ import { ThemedView } from '../../components/ui/themed-view';
7
8
  import { EyeOnIcon } from '../../components/icons/index';
8
9
  import { MainScreenProps } from '../../components/navigation/types/index';
9
10
  import { VisibilitySelector } from '../../components/post/post-form/VisibilitySelector';
@@ -12,7 +13,6 @@ import { Button } from '../../components/ui/button';
12
13
  import { Checkbox } from '../../components/ui/checkbox';
13
14
  import { Input } from '../../components/ui/input';
14
15
  import { Label } from '../../components/ui/label';
15
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
16
16
  import { ThemedText } from '../../components/ui/themed-text';
17
17
 
18
18
  type NewJamProps = MainScreenProps<'CreateNewJam'>;
@@ -34,15 +34,18 @@ export const NewJam: React.FC<NewJamProps> = ({ navigation }) => {
34
34
  handleSchedule,
35
35
  } = useCreateNewJamForm({ onClose: () => navigation.goBack() });
36
36
 
37
+ useSetPageHeader(
38
+ t('jams.create.title'),
39
+ <HeaderActionButton
40
+ title={t('jams.start.submit')}
41
+ onPress={() => void handleCreate()}
42
+ disabled={submitting}
43
+ loading={submitting}
44
+ />
45
+ );
46
+
37
47
  return (
38
- <ThemedSafeAreaView className="grow">
39
- <GenericHeader
40
- title={t('jams.create.title')}
41
- rightButtonTitle={t('jams.start.submit')}
42
- onRightButtonPress={() => void handleCreate()}
43
- rightButtonDisabled={submitting}
44
- rightType="button"
45
- />
48
+ <ThemedView className="grow">
46
49
  <KeyboardAwareScrollView
47
50
  className="w-full bg-background p-4"
48
51
  contentContainerClassName="gap-4"
@@ -113,6 +116,6 @@ export const NewJam: React.FC<NewJamProps> = ({ navigation }) => {
113
116
  </Button>
114
117
  ) : null}
115
118
  </KeyboardAwareScrollView>
116
- </ThemedSafeAreaView>
119
+ </ThemedView>
117
120
  );
118
121
  };
@@ -1,8 +1,8 @@
1
1
  import React, { useEffect, useMemo, useState } from 'react';
2
2
  import { useOpenpeeps } from '@openpeepshq/react';
3
- import { GenericHeader } from '../../components/custom/index';
3
+ import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
4
+ import { ThemedView } from '../../components/ui/themed-view';
4
5
  import Toast from 'react-native-toast-message';
5
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
6
6
  import { PostForm } from '../../components/post/post-form/PostForm';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { MainScreenProps } from '../../components/navigation/types/index';
@@ -110,25 +110,28 @@ export const EditPost = ({ route, navigation }: PostProps) => {
110
110
  });
111
111
  };
112
112
 
113
+ useSetPageHeader(
114
+ t('posts.edit.title'),
115
+ <HeaderActionButton
116
+ title={
117
+ isPosting
118
+ ? t('posts.edit.loading')
119
+ : attachmentsProcessing
120
+ ? t('posts.create.processing', 'Processing…')
121
+ : t('posts.edit.submit')
122
+ }
123
+ onPress={() => void handlePostUpdate()}
124
+ disabled={!canSubmit}
125
+ loading={isPosting}
126
+ />
127
+ );
128
+
113
129
  return (
114
- <ThemedSafeAreaView className="flex-1 bg-background">
130
+ <ThemedView className="flex-1 bg-background">
115
131
  {isLoading && !postData ? (
116
132
  <ActivityIndicator />
117
133
  ) : (
118
134
  <>
119
- <GenericHeader
120
- title={t('posts.edit.title')}
121
- rightType="button"
122
- rightButtonTitle={
123
- isPosting
124
- ? t('posts.edit.loading')
125
- : attachmentsProcessing
126
- ? t('posts.create.processing', 'Processing…')
127
- : t('posts.edit.submit')
128
- }
129
- onRightButtonPress={handlePostUpdate}
130
- rightButtonDisabled={!canSubmit}
131
- />
132
135
  {postData && (
133
136
  <>
134
137
  {postData.type === 'article' && (
@@ -149,6 +152,6 @@ export const EditPost = ({ route, navigation }: PostProps) => {
149
152
  )}
150
153
  </>
151
154
  )}
152
- </ThemedSafeAreaView>
155
+ </ThemedView>
153
156
  );
154
157
  };
@@ -14,11 +14,12 @@ import {
14
14
  import { useOpenpeeps } from '@openpeepshq/react';
15
15
  import {
16
16
  AudioPickerSheet,
17
- GenericHeader,
18
17
  ImagePickerSheet,
19
18
  DocumentPickerSheet,
20
19
  type DocumentPickerSheetHandle,
21
20
  } from '../../components/custom/index';
21
+ import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
22
+ import { ThemedView } from '../../components/ui/themed-view';
22
23
  import {
23
24
  checkRoleCapabilities,
24
25
  MediaAttachment,
@@ -29,7 +30,6 @@ import {
29
30
  } from '@openpeepshq/common';
30
31
  import { CompositeScreenProps } from '@react-navigation/native';
31
32
  import Toast from 'react-native-toast-message';
32
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
33
33
  import { useLocalPostStore } from '../../stores/useLocalPostStore';
34
34
  import { PostForm } from '../../components/post/post-form/PostForm';
35
35
  import { useTranslation } from 'react-i18next';
@@ -259,33 +259,34 @@ export const NewPost = ({ route, navigation }: PostProps) => {
259
259
  const isArticle = postData.type === 'article';
260
260
  const composerType = postData.data.type === 'question' ? 'question' : 'note';
261
261
 
262
+ useSetPageHeader(
263
+ isArticle ? t('articles.create.title') : t('posts.newPost.title'),
264
+ <HeaderActionButton
265
+ title={
266
+ isPosting
267
+ ? t('posts.create.loading')
268
+ : attachmentsProcessing
269
+ ? t('posts.create.processing', 'Processing…')
270
+ : t('posts.create.submit')
271
+ }
272
+ onPress={() => void handlePostCreation()}
273
+ disabled={!canSubmit}
274
+ loading={isPosting}
275
+ />,
276
+ () => {
277
+ if (route.params?.triggeredFrom === 'group') {
278
+ navigation.pop();
279
+ navigation.navigate('Group', {
280
+ id: route.params?.originatorId!,
281
+ });
282
+ } else {
283
+ navigation.goBack();
284
+ }
285
+ }
286
+ );
287
+
262
288
  return (
263
- <ThemedSafeAreaView className="flex-1 bg-background">
264
- <GenericHeader
265
- title={
266
- isArticle ? t('articles.create.title') : t('posts.newPost.title')
267
- }
268
- rightType="button"
269
- rightButtonTitle={
270
- isPosting
271
- ? t('posts.create.loading')
272
- : attachmentsProcessing
273
- ? t('posts.create.processing', 'Processing…')
274
- : t('posts.create.submit')
275
- }
276
- handleGoBack={() => {
277
- if (route.params?.triggeredFrom === 'group') {
278
- navigation.pop();
279
- navigation.navigate('Group', {
280
- id: route.params?.originatorId!,
281
- });
282
- } else {
283
- navigation.goBack();
284
- }
285
- }}
286
- rightButtonDisabled={!canSubmit}
287
- onRightButtonPress={handlePostCreation}
288
- />
289
+ <ThemedView className="flex-1 bg-background">
289
290
  <KeyboardAwareScrollView className="flex-1">
290
291
  {isArticle ? (
291
292
  <ArticleForm postData={postData} onChange={setPostData} />
@@ -328,6 +329,6 @@ export const NewPost = ({ route, navigation }: PostProps) => {
328
329
  ref={documentPickerModalRef}
329
330
  onSelect={handleAddAttachments}
330
331
  />
331
- </ThemedSafeAreaView>
332
+ </ThemedView>
332
333
  );
333
334
  };
@@ -10,9 +10,10 @@ import {
10
10
  AudioPickerSheet,
11
11
  DocumentPickerSheet,
12
12
  type DocumentPickerSheetHandle,
13
- GenericHeader,
14
13
  ImagePickerSheet,
15
14
  } from '../../components/custom/index';
15
+ import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
16
+ import { ThemedView } from '../../components/ui/themed-view';
16
17
  import {
17
18
  MediaAttachment,
18
19
  pollOptionsWithinLimit,
@@ -21,7 +22,6 @@ import {
21
22
  resolvePollOptionContents,
22
23
  } from '@openpeepshq/common';
23
24
  import Toast from 'react-native-toast-message';
24
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
25
25
  import {
26
26
  postDataDefaults,
27
27
  useLocalPostStore,
@@ -233,20 +233,24 @@ export const ReplyPost = ({ route, navigation }: PostProps) => {
233
233
  }
234
234
  }, [t]);
235
235
 
236
+ useSetPageHeader(
237
+ t('posts.reply.title', { defaultValue: 'Reply' }),
238
+ <HeaderActionButton
239
+ title={
240
+ isPosting
241
+ ? t('posts.create.loading')
242
+ : attachmentsProcessing
243
+ ? t('posts.create.processing', 'Processing…')
244
+ : t('posts.create.submit')
245
+ }
246
+ onPress={() => void handlePostCreation()}
247
+ disabled={!canSubmit}
248
+ loading={isPosting}
249
+ />
250
+ );
251
+
236
252
  return (
237
- <ThemedSafeAreaView className="flex-1 bg-background">
238
- <GenericHeader
239
- rightType="button"
240
- rightButtonTitle={
241
- isPosting
242
- ? t('posts.create.loading')
243
- : attachmentsProcessing
244
- ? t('posts.create.processing', 'Processing…')
245
- : t('posts.create.submit')
246
- }
247
- onRightButtonPress={handlePostCreation}
248
- rightButtonDisabled={!canSubmit}
249
- />
253
+ <ThemedView className="flex-1 bg-background">
250
254
  <KeyboardAwareScrollView
251
255
  ref={scrollRef}
252
256
  className="flex-1"
@@ -342,6 +346,6 @@ export const ReplyPost = ({ route, navigation }: PostProps) => {
342
346
  ref={documentPickerModalRef}
343
347
  onSelect={handleAddAttachments}
344
348
  />
345
- </ThemedSafeAreaView>
349
+ </ThemedView>
346
350
  );
347
351
  };
@@ -2,12 +2,10 @@ import React from 'react';
2
2
  import { useOpenpeeps } from '@openpeepshq/react';
3
3
  import { MainScreenProps } from '../../components/navigation/types/index';
4
4
  import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
5
- import {
6
- EmptyStateContainer,
7
- GenericHeader,
8
- } from '../../components/custom/index';
5
+ import { EmptyStateContainer } from '../../components/custom/index';
6
+ import { useSetPageHeader } from '../../components/layout';
7
+ import { ThemedView } from '../../components/ui/themed-view';
9
8
  import { ActivityIndicator } from 'react-native';
10
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
11
9
 
12
10
  import { ProfileCard } from '../../components/profile/index';
13
11
  type ProfileFollowersProps = MainScreenProps<'ProfileFollowers'>;
@@ -21,11 +19,12 @@ export const Followers: React.FC<ProfileFollowersProps> = ({ route }) => {
21
19
  const { data: profile, isLoading: isProfileFetching } =
22
20
  openpeepsApi.useProfile(id);
23
21
 
22
+ useSetPageHeader(
23
+ `${!isProfileFetching ? `@${profile?.handle}` : ''} Followers`
24
+ );
25
+
24
26
  return (
25
- <ThemedSafeAreaView className="flex-1">
26
- <GenericHeader
27
- title={`${!isProfileFetching ? `@${profile?.handle}` : ''} Followers`}
28
- />
27
+ <ThemedView className="flex-1">
29
28
  <KeyboardAwareScrollView
30
29
  contentContainerClassName="grow"
31
30
  className="w-full flex bg-background"
@@ -41,6 +40,6 @@ export const Followers: React.FC<ProfileFollowersProps> = ({ route }) => {
41
40
  />
42
41
  )}
43
42
  </KeyboardAwareScrollView>
44
- </ThemedSafeAreaView>
43
+ </ThemedView>
45
44
  );
46
45
  };
@@ -2,12 +2,10 @@ import React from 'react';
2
2
  import { useOpenpeeps } from '@openpeepshq/react';
3
3
  import { MainScreenProps } from '../../components/navigation/types/index';
4
4
  import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
5
- import {
6
- EmptyStateContainer,
7
- GenericHeader,
8
- } from '../../components/custom/index';
5
+ import { EmptyStateContainer } from '../../components/custom/index';
6
+ import { useSetPageHeader } from '../../components/layout';
7
+ import { ThemedView } from '../../components/ui/themed-view';
9
8
  import { ActivityIndicator } from 'react-native';
10
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
11
9
 
12
10
  import { ProfileCard } from '../../components/profile/index';
13
11
  type ProfileFollowingProps = MainScreenProps<'ProfileFollowing'>;
@@ -20,11 +18,12 @@ export const Following: React.FC<ProfileFollowingProps> = ({ route }) => {
20
18
  openpeepsApi.useProfileFollowing(id);
21
19
  const { data: profile, isLoading: isProfileFetching } =
22
20
  openpeepsApi.useProfile(id);
21
+ useSetPageHeader(
22
+ `${!isProfileFetching ? `@${profile?.handle}` : ''} Following`
23
+ );
24
+
23
25
  return (
24
- <ThemedSafeAreaView className="flex-1">
25
- <GenericHeader
26
- title={`${!isProfileFetching ? `@${profile?.handle}` : ''} Followers`}
27
- />
26
+ <ThemedView className="flex-1">
28
27
  <KeyboardAwareScrollView
29
28
  contentContainerClassName="grow"
30
29
  className="w-full flex bg-background"
@@ -40,6 +39,6 @@ export const Following: React.FC<ProfileFollowingProps> = ({ route }) => {
40
39
  />
41
40
  )}
42
41
  </KeyboardAwareScrollView>
43
- </ThemedSafeAreaView>
42
+ </ThemedView>
44
43
  );
45
44
  };
@@ -12,7 +12,7 @@ import {
12
12
  useAccessTokens,
13
13
  type AccessTokenResourceType,
14
14
  } from '@openpeepshq/react';
15
- import { GenericHeader } from '../../components/custom/index';
15
+ import { useSetPageHeader } from '../../components/layout';
16
16
  import { ChevronDownIcon, CopyIcon } from '../../components/icons/index';
17
17
  import { MainScreenProps } from '../../components/navigation/types/index';
18
18
  import { Button } from '../../components/ui/button';
@@ -24,8 +24,8 @@ import {
24
24
  } from '../../components/ui/dropdown-menu';
25
25
  import { Input } from '../../components/ui/input';
26
26
  import { Label } from '../../components/ui/label';
27
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
28
27
  import { ThemedText } from '../../components/ui/themed-text';
28
+ import { ThemedView } from '../../components/ui/themed-view';
29
29
 
30
30
  type AccessTokensSettingsProps = MainScreenProps<'AccessTokensSettings'>;
31
31
 
@@ -93,9 +93,10 @@ export const AccessTokensSettings: React.FC<AccessTokensSettingsProps> = () => {
93
93
  ?.labelKey ?? value
94
94
  );
95
95
 
96
+ useSetPageHeader(t('settings.accessTokens.title'));
97
+
96
98
  return (
97
- <ThemedSafeAreaView className="flex-1">
98
- <GenericHeader title={t('settings.accessTokens.title')} />
99
+ <ThemedView className="flex-1">
99
100
  <ScrollView contentContainerClassName="gap-6 p-4">
100
101
  <View className="gap-3 rounded-md border border-border p-4">
101
102
  <ThemedText className="text-lg font-medium">
@@ -270,6 +271,6 @@ export const AccessTokensSettings: React.FC<AccessTokensSettingsProps> = () => {
270
271
  )}
271
272
  </View>
272
273
  </ScrollView>
273
- </ThemedSafeAreaView>
274
+ </ThemedView>
274
275
  );
275
276
  };
@@ -1,6 +1,6 @@
1
1
  import { MainScreenProps } from '../../components/navigation/types/index';
2
2
  import { useOpenpeeps } from '@openpeepshq/react';
3
- import { GenericHeader } from '../../components/custom/index';
3
+ import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
4
4
  import React, { useEffect, useState } from 'react';
5
5
  import { ThemedText } from '../../components/ui/themed-text';
6
6
  import { ThemedView } from '../../components/ui/themed-view';
@@ -12,7 +12,6 @@ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view
12
12
  import { Account } from '@openpeepshq/common';
13
13
  import { View } from 'react-native';
14
14
  import { useTranslation } from 'react-i18next';
15
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
16
15
 
17
16
  type AccountSettingsProps = MainScreenProps<'AccountSettings'>;
18
17
 
@@ -126,16 +125,18 @@ export const AccountSettings: React.FC<AccountSettingsProps> = ({}) => {
126
125
  form.setValue('email', (currentAccount as Account)?.email ?? '');
127
126
  }, [currentAccount, form]);
128
127
 
128
+ useSetPageHeader(
129
+ t('settings.account.title', { defaultValue: 'Account' }),
130
+ <HeaderActionButton
131
+ title={isSubmitting ? t('common.form.loading') : t('common.form.save')}
132
+ onPress={() => void handleSubmit()}
133
+ disabled={isSubmitting}
134
+ loading={isSubmitting}
135
+ />
136
+ );
137
+
129
138
  return (
130
- <ThemedSafeAreaView className="flex-1">
131
- <GenericHeader
132
- title="Account"
133
- rightButtonTitle={
134
- isSubmitting ? t('common.form.loading') : t('common.form.save')
135
- }
136
- onRightButtonPress={handleSubmit}
137
- rightButtonDisabled={isSubmitting}
138
- />
139
+ <ThemedView className="flex-1">
139
140
  <ThemedView className="flex-1">
140
141
  <KeyboardAwareScrollView
141
142
  contentContainerClassName="grow"
@@ -266,6 +267,6 @@ export const AccountSettings: React.FC<AccountSettingsProps> = ({}) => {
266
267
  </Form>
267
268
  </KeyboardAwareScrollView>
268
269
  </ThemedView>
269
- </ThemedSafeAreaView>
270
+ </ThemedView>
270
271
  );
271
272
  };