@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.
Files changed (94) hide show
  1. package/package.json +3 -3
  2. package/src/components/conversations/ConversationMessageBubble.tsx +1 -1
  3. package/src/components/custom/common/index.ts +0 -1
  4. package/src/components/custom/index.ts +0 -1
  5. package/src/components/custom/navigation/side-menu.tsx +2 -2
  6. package/src/components/groups/GroupOptionsMenu.tsx +13 -5
  7. package/src/components/index.ts +1 -0
  8. package/src/components/jams/CreateNewJam.tsx +11 -10
  9. package/src/components/jams/JamActionsFooter.tsx +37 -51
  10. package/src/components/jams/JamCard.tsx +5 -5
  11. package/src/components/jams/JamLobby.tsx +2 -1
  12. package/src/components/layout/AuthLayout.tsx +120 -0
  13. package/src/components/layout/ContentHeader.tsx +62 -0
  14. package/src/components/layout/HeaderActionButton.tsx +23 -0
  15. package/src/components/layout/HeaderMobile.tsx +96 -0
  16. package/src/components/layout/PlusButton.tsx +26 -0
  17. package/src/components/layout/RootLayout.tsx +30 -0
  18. package/src/components/layout/index.ts +13 -0
  19. package/src/components/layout/pageChrome.tsx +75 -0
  20. package/src/components/navigation/auth-navigator.tsx +2 -2
  21. package/src/components/navigation/main-navigator.tsx +17 -1
  22. package/src/components/navigation/parent-back.ts +139 -0
  23. package/src/components/navigation/tab-navigator.tsx +2 -0
  24. package/src/components/notifications/types/JamStarted.tsx +8 -6
  25. package/src/components/notifications/types/Reply.tsx +7 -10
  26. package/src/components/post/NewEventButton.tsx +23 -16
  27. package/src/components/post/NewNoteButton.tsx +15 -13
  28. package/src/components/post/pieces/EventRsvpButton.tsx +22 -18
  29. package/src/components/post/pieces/ParticipantsCard.tsx +4 -20
  30. package/src/components/post/types/Article.tsx +3 -1
  31. package/src/components/post/types/event/CardEvent.tsx +1 -1
  32. package/src/components/post/types/event/FullEvent.tsx +156 -37
  33. package/src/components/profile/ProfileCard.tsx +9 -2
  34. package/src/components/profile/ProfileFromId.tsx +1 -1
  35. package/src/components/ui/button.tsx +1 -1
  36. package/src/pages/About.tsx +3 -5
  37. package/src/pages/CodeOfConduct.tsx +7 -7
  38. package/src/pages/Explore.tsx +87 -127
  39. package/src/pages/Members.tsx +31 -39
  40. package/src/pages/Notifications.tsx +6 -13
  41. package/src/pages/PostDetail.tsx +22 -16
  42. package/src/pages/Profile.tsx +3 -2
  43. package/src/pages/Tags.tsx +72 -13
  44. package/src/pages/Welcome.tsx +3 -8
  45. package/src/pages/articles/Edit.tsx +18 -15
  46. package/src/pages/articles/Index.tsx +11 -21
  47. package/src/pages/articles/New.tsx +18 -15
  48. package/src/pages/conversations/Index.tsx +44 -68
  49. package/src/pages/conversations/Info.tsx +6 -5
  50. package/src/pages/conversations/New.tsx +14 -13
  51. package/src/pages/conversations/NewDraft.tsx +5 -5
  52. package/src/pages/conversations/Show.tsx +24 -22
  53. package/src/pages/events/Edit.tsx +14 -13
  54. package/src/pages/events/Index.tsx +28 -32
  55. package/src/pages/events/My.tsx +7 -7
  56. package/src/pages/events/New.tsx +14 -13
  57. package/src/pages/feeds/Bookmarks.tsx +3 -9
  58. package/src/pages/feeds/Local.tsx +3 -10
  59. package/src/pages/feeds/My.tsx +3 -9
  60. package/src/pages/groups/Edit.tsx +6 -7
  61. package/src/pages/groups/EditInfo.tsx +20 -17
  62. package/src/pages/groups/EditRoles.tsx +18 -19
  63. package/src/pages/groups/Index.tsx +82 -119
  64. package/src/pages/groups/Info.tsx +22 -23
  65. package/src/pages/groups/Members.tsx +9 -8
  66. package/src/pages/groups/New.tsx +18 -15
  67. package/src/pages/groups/Show.tsx +6 -5
  68. package/src/pages/jams/Index.tsx +8 -26
  69. package/src/pages/jams/New.tsx +14 -11
  70. package/src/pages/posts/Edit.tsx +20 -17
  71. package/src/pages/posts/New.tsx +30 -29
  72. package/src/pages/posts/Reply.tsx +20 -16
  73. package/src/pages/profile/Followers.tsx +9 -10
  74. package/src/pages/profile/Following.tsx +9 -10
  75. package/src/pages/settings/AccessTokens.tsx +6 -5
  76. package/src/pages/settings/Account.tsx +13 -12
  77. package/src/pages/settings/Blocked.tsx +5 -5
  78. package/src/pages/settings/Feed.tsx +13 -12
  79. package/src/pages/settings/Index.tsx +3 -11
  80. package/src/pages/settings/Language.tsx +36 -37
  81. package/src/pages/settings/NotificationPreferences.tsx +10 -12
  82. package/src/pages/settings/Notifications.tsx +10 -9
  83. package/src/pages/settings/PublicProfile.tsx +6 -6
  84. package/src/pages/settings/PushEnabledDevices.tsx +10 -9
  85. package/src/pages/settings/Theme.tsx +13 -12
  86. package/src/pages/settings/Timezone.tsx +27 -28
  87. package/src/theme/OpenPeepsThemeProvider.tsx +23 -12
  88. package/src/theme/utils.ts +10 -5
  89. package/tailwind.config.js +6 -0
  90. package/src/components/custom/common/plus-fab.tsx +0 -23
  91. package/src/components/custom/headers/generic-header.tsx +0 -88
  92. package/src/components/custom/headers/index.ts +0 -2
  93. package/src/components/custom/headers/tab-screens-header.tsx +0 -199
  94. package/src/components/navigation/auth-wrapper.tsx +0 -107
@@ -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
  };
@@ -4,10 +4,9 @@ import { useTranslation } from 'react-i18next';
4
4
  import { useOpenpeeps } from '@openpeepshq/react';
5
5
  import type { PublicProfile } from '@openpeepshq/common';
6
6
  import { MainScreenProps } from '../../components/navigation/types/index';
7
- import { GenericHeader } from '../../components/custom/index';
7
+ import { useSetPageHeader } from '../../components/layout';
8
8
  import { ThemedText } from '../../components/ui/themed-text';
9
9
  import { ThemedView } from '../../components/ui/themed-view';
10
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
11
10
  import { Button } from '../../components/ui/button';
12
11
 
13
12
  type BlockedSettingsProps = MainScreenProps<'BlockedSettings'>;
@@ -19,9 +18,10 @@ export const BlockedSettings: React.FC<BlockedSettingsProps> = () => {
19
18
  const currentQuery = openpeepsApi.useCurrentProfile();
20
19
  const profiles = blockedQuery.data ?? [];
21
20
 
21
+ useSetPageHeader(t('settings.blocked.title'));
22
+
22
23
  return (
23
- <ThemedSafeAreaView className="flex-1">
24
- <GenericHeader title={t('settings.blocked.title')} />
24
+ <ThemedView className="flex-1">
25
25
  <ThemedView className="flex-1 p-4">
26
26
  <ThemedText className="text-muted-foreground mb-4">
27
27
  {t('settings.blocked.description')}
@@ -43,7 +43,7 @@ export const BlockedSettings: React.FC<BlockedSettingsProps> = () => {
43
43
  ))
44
44
  )}
45
45
  </ThemedView>
46
- </ThemedSafeAreaView>
46
+ </ThemedView>
47
47
  );
48
48
  };
49
49
 
@@ -5,10 +5,9 @@ import { Pressable } from 'react-native';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import Toast from 'react-native-toast-message';
7
7
  import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
8
- import { GenericHeader } from '../../components/custom/index';
8
+ import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
9
9
  import { MainScreenProps } from '../../components/navigation/types/index';
10
10
  import { RadioGroup, RadioGroupItem } from '../../components/ui/radio-group';
11
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
12
11
  import { ThemedText } from '../../components/ui/themed-text';
13
12
  import { ThemedView } from '../../components/ui/themed-view';
14
13
 
@@ -33,16 +32,18 @@ export const FeedSettings: React.FC<FeedSettingsProps> = () => {
33
32
  }
34
33
  };
35
34
 
35
+ useSetPageHeader(
36
+ t('settings.feed.title'),
37
+ <HeaderActionButton
38
+ title={submitting ? t('common.form.loading') : t('common.form.save')}
39
+ onPress={() => void handleSubmit()}
40
+ disabled={submitting}
41
+ loading={submitting}
42
+ />
43
+ );
44
+
36
45
  return (
37
- <ThemedSafeAreaView className="flex-1">
38
- <GenericHeader
39
- title={t('settings.feed.title')}
40
- rightButtonTitle={
41
- submitting ? t('common.form.loading') : t('common.form.save')
42
- }
43
- onRightButtonPress={handleSubmit}
44
- rightButtonDisabled={submitting}
45
- />
46
+ <ThemedView className="flex-1">
46
47
  <ThemedView className="flex-1">
47
48
  <KeyboardAwareScrollView
48
49
  contentContainerClassName="grow"
@@ -72,6 +73,6 @@ export const FeedSettings: React.FC<FeedSettingsProps> = () => {
72
73
  </ThemedView>
73
74
  </KeyboardAwareScrollView>
74
75
  </ThemedView>
75
- </ThemedSafeAreaView>
76
+ </ThemedView>
76
77
  );
77
78
  };
@@ -12,8 +12,7 @@ import {
12
12
  TabStackParamList,
13
13
  } from '../../components/navigation/types/index';
14
14
  import { ConfigMenuButton } from '../../components/configuration/index';
15
- import { TabScreensHeader } from '../../components/custom/index';
16
- import { ThemedText } from '../../components/ui/themed-text';
15
+ import { useSetPageHeader } from '../../components/layout';
17
16
  import { ThemedView } from '../../components/ui/themed-view';
18
17
 
19
18
  export const Settings = ({}: NativeStackScreenProps<
@@ -25,17 +24,10 @@ export const Settings = ({}: NativeStackScreenProps<
25
24
  const navigation =
26
25
  useNavigation<NativeStackNavigationProp<MainStackParamList>>();
27
26
 
27
+ useSetPageHeader(t('settings.menu'));
28
+
28
29
  return (
29
30
  <ThemedView className="flex-1 relative">
30
- <TabScreensHeader
31
- children={
32
- <View className="p-2">
33
- <ThemedText className="text-2xl font-semibold">
34
- {t('settings.menu')}
35
- </ThemedText>
36
- </View>
37
- }
38
- />
39
31
  <View className="grow p-4">
40
32
  {profile ? (
41
33
  <ConfigMenuButton
@@ -6,10 +6,9 @@ import {
6
6
  AVAILABLE_UI_LANGUAGES,
7
7
  useLanguagePreference,
8
8
  } from '@openpeepshq/react';
9
- import { GenericHeader } from '../../components/custom/index';
9
+ import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
10
10
  import { MainScreenProps } from '../../components/navigation/types/index';
11
11
  import { RadioGroup, RadioGroupItem } from '../../components/ui/radio-group';
12
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
13
12
  import { ThemedText } from '../../components/ui/themed-text';
14
13
  import { ThemedView } from '../../components/ui/themed-view';
15
14
 
@@ -40,43 +39,43 @@ export const LanguageSettings: React.FC<LanguageSettingsProps> = () => {
40
39
  clearStatus();
41
40
  }, [status, clearStatus]);
42
41
 
42
+ useSetPageHeader(
43
+ t('settings.language.title'),
44
+ <HeaderActionButton
45
+ title={saving ? t('common.form.loading') : t('common.form.save')}
46
+ onPress={() => void save()}
47
+ disabled={saving}
48
+ loading={saving}
49
+ />
50
+ );
51
+
43
52
  if (!profile) return null;
44
53
 
45
54
  return (
46
- <ThemedSafeAreaView className="flex-1">
47
- <GenericHeader
48
- title={t('settings.language.title')}
49
- rightButtonTitle={
50
- saving ? t('common.form.loading') : t('common.form.save')
51
- }
52
- onRightButtonPress={() => void save()}
53
- rightButtonDisabled={saving}
54
- />
55
- <ThemedView className="flex-1 p-4">
56
- <ThemedText className="text-lg text-muted-foreground mb-4">
57
- {t('settings.language.languageDescription')}
58
- </ThemedText>
59
- <RadioGroup value={language} onValueChange={setLanguage}>
60
- {AVAILABLE_UI_LANGUAGES.map((code) => (
61
- <Pressable
62
- key={code}
63
- onPress={() => setLanguage(code)}
64
- className="py-3 mb-2 flex-row items-center gap-x-3"
65
- >
66
- <RadioGroupItem value={code} />
67
- <ThemedText className="text-lg">
68
- {LANGUAGE_LABELS[code]}
69
- {code === communityDefaultLanguage ? (
70
- <ThemedText className="text-sm text-muted-foreground">
71
- {' '}
72
- {t('settings.language.default')}
73
- </ThemedText>
74
- ) : null}
75
- </ThemedText>
76
- </Pressable>
77
- ))}
78
- </RadioGroup>
79
- </ThemedView>
80
- </ThemedSafeAreaView>
55
+ <ThemedView className="flex-1 p-4">
56
+ <ThemedText className="text-lg text-muted-foreground mb-4">
57
+ {t('settings.language.languageDescription')}
58
+ </ThemedText>
59
+ <RadioGroup value={language} onValueChange={setLanguage}>
60
+ {AVAILABLE_UI_LANGUAGES.map((code) => (
61
+ <Pressable
62
+ key={code}
63
+ onPress={() => setLanguage(code)}
64
+ className="mb-2 flex-row items-center gap-x-3 py-3"
65
+ >
66
+ <RadioGroupItem value={code} />
67
+ <ThemedText className="text-lg">
68
+ {LANGUAGE_LABELS[code]}
69
+ {code === communityDefaultLanguage ? (
70
+ <ThemedText className="text-sm text-muted-foreground">
71
+ {' '}
72
+ {t('settings.language.default')}
73
+ </ThemedText>
74
+ ) : null}
75
+ </ThemedText>
76
+ </Pressable>
77
+ ))}
78
+ </RadioGroup>
79
+ </ThemedView>
81
80
  );
82
81
  };
@@ -1,12 +1,9 @@
1
1
  import { MainScreenProps } from '../../components/navigation/types/index';
2
- import {
3
- EditNotificationsSheet,
4
- GenericHeader,
5
- } from '../../components/custom/index';
2
+ import { EditNotificationsSheet } from '../../components/custom/index';
3
+ import { useSetPageHeader } from '../../components/layout';
6
4
  import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
7
5
  import { Pressable, View } from 'react-native';
8
6
  import { useTranslation } from 'react-i18next';
9
- import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
10
7
  import React, { useCallback, useRef } from 'react';
11
8
  import { ThemedText } from '../../components/ui/themed-text';
12
9
  import { ThemedView } from '../../components/ui/themed-view';
@@ -37,13 +34,14 @@ export const NotificationPreferences: React.FC<
37
34
  const { t } = useTranslation();
38
35
  const { types } = useNotificationPreferences();
39
36
 
37
+ useSetPageHeader(
38
+ t('settings.notifications.title', {
39
+ defaultValue: 'Notification Settings',
40
+ })
41
+ );
42
+
40
43
  return (
41
- <ThemedSafeAreaView className="flex-1">
42
- <GenericHeader
43
- title={t('settings.notifications.title', {
44
- defaultValue: 'Notification Settings',
45
- })}
46
- />
44
+ <ThemedView className="flex-1">
47
45
  <KeyboardAwareScrollView
48
46
  contentContainerClassName="grow"
49
47
  className="w-full flex py-3 px-5"
@@ -82,7 +80,7 @@ export const NotificationPreferences: React.FC<
82
80
  </KeyboardAwareScrollView>
83
81
  </ThemedView>
84
82
  </KeyboardAwareScrollView>
85
- </ThemedSafeAreaView>
83
+ </ThemedView>
86
84
  );
87
85
  };
88
86