@openpeepshq/rn-components 0.3.11 → 0.3.13
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 -10
- package/src/components/custom/common/index.ts +0 -1
- package/src/components/custom/index.ts +0 -1
- package/src/components/index.ts +1 -0
- package/src/components/jams/CreateNewJam.tsx +11 -10
- 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.test.tsx +147 -0
- package/src/components/layout/pageChrome.tsx +110 -0
- package/src/components/navigation/auth-navigator.tsx +2 -2
- package/src/components/navigation/main-navigator.tsx +17 -1
- package/src/components/navigation/tab-navigator.tsx +2 -0
- package/src/components/post/NewEventButton.tsx +23 -16
- package/src/components/post/NewNoteButton.tsx +15 -13
- 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 +12 -16
- package/src/pages/Profile.tsx +3 -2
- package/src/pages/Tags.tsx +74 -16
- 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 +16 -20
- 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 +4 -24
- 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/components/custom/common/plus-fab.tsx +0 -23
- package/src/components/custom/headers/generic-header.tsx +0 -103
- package/src/components/custom/headers/index.ts +0 -2
- package/src/components/custom/headers/tab-screens-header.tsx +0 -206
- package/src/components/navigation/auth-wrapper.tsx +0 -107
package/src/pages/posts/New.tsx
CHANGED
|
@@ -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
|
-
<
|
|
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
|
-
</
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
-
|
|
7
|
-
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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
|
-
|
|
7
|
-
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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 {
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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 {
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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 {
|
|
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
|
-
<
|
|
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
|
-
</
|
|
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 {
|
|
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
|
-
<
|
|
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
|
-
</
|
|
76
|
+
</ThemedView>
|
|
76
77
|
);
|
|
77
78
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { View } from 'react-native';
|
|
3
3
|
import { useNavigation } from '@react-navigation/native';
|
|
4
4
|
import {
|
|
5
5
|
NativeStackNavigationProp,
|
|
@@ -12,9 +12,7 @@ import {
|
|
|
12
12
|
TabStackParamList,
|
|
13
13
|
} from '../../components/navigation/types/index';
|
|
14
14
|
import { ConfigMenuButton } from '../../components/configuration/index';
|
|
15
|
-
import {
|
|
16
|
-
import { ChevronLeftIcon } from '../../components/icons/index';
|
|
17
|
-
import { ThemedText } from '../../components/ui/themed-text';
|
|
15
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
18
16
|
import { ThemedView } from '../../components/ui/themed-view';
|
|
19
17
|
|
|
20
18
|
export const Settings = ({}: NativeStackScreenProps<
|
|
@@ -26,28 +24,10 @@ export const Settings = ({}: NativeStackScreenProps<
|
|
|
26
24
|
const navigation =
|
|
27
25
|
useNavigation<NativeStackNavigationProp<MainStackParamList>>();
|
|
28
26
|
|
|
27
|
+
useSetPageHeader(t('settings.menu'));
|
|
28
|
+
|
|
29
29
|
return (
|
|
30
30
|
<ThemedView className="flex-1 relative">
|
|
31
|
-
<TabScreensHeader
|
|
32
|
-
children={
|
|
33
|
-
<View className="flex-row items-center p-2">
|
|
34
|
-
{profile ? (
|
|
35
|
-
<Pressable
|
|
36
|
-
accessibilityRole="button"
|
|
37
|
-
onPress={() =>
|
|
38
|
-
navigation.navigate('Profile', { handle: profile.handle })
|
|
39
|
-
}
|
|
40
|
-
className="mr-1 p-1"
|
|
41
|
-
>
|
|
42
|
-
<ChevronLeftIcon size={28} className="text-foreground" />
|
|
43
|
-
</Pressable>
|
|
44
|
-
) : null}
|
|
45
|
-
<ThemedText className="text-2xl font-semibold">
|
|
46
|
-
{t('settings.menu')}
|
|
47
|
-
</ThemedText>
|
|
48
|
-
</View>
|
|
49
|
-
}
|
|
50
|
-
/>
|
|
51
31
|
<View className="grow p-4">
|
|
52
32
|
{profile ? (
|
|
53
33
|
<ConfigMenuButton
|
|
@@ -6,10 +6,9 @@ import {
|
|
|
6
6
|
AVAILABLE_UI_LANGUAGES,
|
|
7
7
|
useLanguagePreference,
|
|
8
8
|
} from '@openpeepshq/react';
|
|
9
|
-
import {
|
|
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
|
-
<
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
<
|
|
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
|
-
</
|
|
83
|
+
</ThemedView>
|
|
86
84
|
);
|
|
87
85
|
};
|
|
88
86
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import {
|
|
4
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
5
5
|
import { ConfigMenuButton } from '../../components/configuration/index';
|
|
6
6
|
import { MainScreenProps } from '../../components/navigation/types/index';
|
|
7
|
-
import {
|
|
7
|
+
import { ThemedView } from '../../components/ui/themed-view';
|
|
8
8
|
|
|
9
9
|
type NotificationSettingsProps = MainScreenProps<'NotificationSettings'>;
|
|
10
10
|
|
|
@@ -13,13 +13,14 @@ export const NotificationSettings: React.FC<NotificationSettingsProps> = ({
|
|
|
13
13
|
}) => {
|
|
14
14
|
const { t } = useTranslation();
|
|
15
15
|
|
|
16
|
+
useSetPageHeader(
|
|
17
|
+
t('settings.notifications.title', {
|
|
18
|
+
defaultValue: 'Notifications',
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
|
|
16
22
|
return (
|
|
17
|
-
<
|
|
18
|
-
<GenericHeader
|
|
19
|
-
title={t('settings.notifications.title', {
|
|
20
|
-
defaultValue: 'Notifications',
|
|
21
|
-
})}
|
|
22
|
-
/>
|
|
23
|
+
<ThemedView className="flex-1">
|
|
23
24
|
<View className="p-4">
|
|
24
25
|
<ConfigMenuButton
|
|
25
26
|
translationPrefix="settings.notifications.preferences"
|
|
@@ -30,6 +31,6 @@ export const NotificationSettings: React.FC<NotificationSettingsProps> = ({
|
|
|
30
31
|
onPress={() => navigation.navigate('PushEnabledDevices')}
|
|
31
32
|
/>
|
|
32
33
|
</View>
|
|
33
|
-
</
|
|
34
|
+
</ThemedView>
|
|
34
35
|
);
|
|
35
36
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MainScreenProps } from '../../components/navigation/types/index';
|
|
3
3
|
import { useOpenpeeps } from '@openpeepshq/react';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
4
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
5
|
+
import { ThemedView } from '../../components/ui/themed-view';
|
|
7
6
|
|
|
8
7
|
import { EditProfileForm } from '../../components/profile/index';
|
|
9
8
|
type EditProfileProps = MainScreenProps<'EditProfile'>;
|
|
@@ -11,10 +10,11 @@ type EditProfileProps = MainScreenProps<'EditProfile'>;
|
|
|
11
10
|
export const PublicProfileSettings: React.FC<EditProfileProps> = () => {
|
|
12
11
|
const { currentProfile } = useOpenpeeps();
|
|
13
12
|
|
|
13
|
+
useSetPageHeader('Edit Profile');
|
|
14
|
+
|
|
14
15
|
return (
|
|
15
|
-
<
|
|
16
|
-
<GenericHeader title="Edit Profile" />
|
|
16
|
+
<ThemedView className="flex-1">
|
|
17
17
|
<EditProfileForm handle={currentProfile?.handle as string} />
|
|
18
|
-
</
|
|
18
|
+
</ThemedView>
|
|
19
19
|
);
|
|
20
20
|
};
|