@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import { ThemedView } from '../../components/ui/themed-view';
|
|
3
3
|
import { ProfileCard } from '../../components/profile/index';
|
|
4
|
-
import {
|
|
4
|
+
import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
|
|
5
5
|
import { EmptyStateContainer } from '../../components/custom/common/index';
|
|
6
6
|
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
7
7
|
import { useOpenpeeps } from '@openpeepshq/react';
|
|
@@ -12,8 +12,8 @@ import { MainScreenProps } from '../../components/navigation/types/index';
|
|
|
12
12
|
import { useNewConversationStore } from '../../stores/useNewConversationStore';
|
|
13
13
|
import { Input } from '../../components/ui/input';
|
|
14
14
|
import { profileMatchesQuery } from '../../lib/utils';
|
|
15
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
16
15
|
import { blockedPairIds } from '@openpeepshq/common/lib';
|
|
16
|
+
import { useTranslation } from 'react-i18next';
|
|
17
17
|
|
|
18
18
|
type SelectPrivateMessageMembersProps =
|
|
19
19
|
MainScreenProps<'SelectPrivateMessageMembers'>;
|
|
@@ -21,6 +21,7 @@ type SelectPrivateMessageMembersProps =
|
|
|
21
21
|
export const NewConversation = ({
|
|
22
22
|
navigation,
|
|
23
23
|
}: SelectPrivateMessageMembersProps) => {
|
|
24
|
+
const { t } = useTranslation();
|
|
24
25
|
const { openpeepsApi, currentProfile } = useOpenpeeps();
|
|
25
26
|
const { data: allProfiles, isLoading } = openpeepsApi.useProfiles();
|
|
26
27
|
const [filteredProfiles, setFilteredProfiles] = React.useState(allProfiles);
|
|
@@ -44,17 +45,17 @@ export const NewConversation = ({
|
|
|
44
45
|
}
|
|
45
46
|
}, [currentProfile, allProfiles, searchQuery]);
|
|
46
47
|
|
|
48
|
+
useSetPageHeader(
|
|
49
|
+
t('conversations.selectMembers', { defaultValue: 'Select Members' }),
|
|
50
|
+
<HeaderActionButton
|
|
51
|
+
title={t('common.next', { defaultValue: 'Next' })}
|
|
52
|
+
onPress={() => navigation.navigate('DraftMessage')}
|
|
53
|
+
disabled={members.length === 0}
|
|
54
|
+
/>
|
|
55
|
+
);
|
|
56
|
+
|
|
47
57
|
return (
|
|
48
|
-
<
|
|
49
|
-
<GenericHeader
|
|
50
|
-
title={'Select Members'}
|
|
51
|
-
rightButtonTitle="Next"
|
|
52
|
-
rightType="button"
|
|
53
|
-
rightButtonDisabled={members.length === 0}
|
|
54
|
-
onRightButtonPress={() => {
|
|
55
|
-
navigation.navigate('DraftMessage');
|
|
56
|
-
}}
|
|
57
|
-
/>
|
|
58
|
+
<ThemedView className="flex-1 relative">
|
|
58
59
|
<View className="w-full flex flex-row justify-between items-center p-4">
|
|
59
60
|
<Input
|
|
60
61
|
className="flex-1"
|
|
@@ -129,6 +130,6 @@ export const NewConversation = ({
|
|
|
129
130
|
</View>
|
|
130
131
|
)}
|
|
131
132
|
</KeyboardAwareScrollView>
|
|
132
|
-
</
|
|
133
|
+
</ThemedView>
|
|
133
134
|
);
|
|
134
135
|
};
|
|
@@ -9,12 +9,11 @@ import { ThemedView } from '../../components/ui/themed-view';
|
|
|
9
9
|
import { MainScreenProps } from '../../components/navigation/types/index';
|
|
10
10
|
import { useNewConversationStore } from '../../stores/useNewConversationStore';
|
|
11
11
|
import { TouchableOpacity } from 'react-native';
|
|
12
|
-
import {
|
|
12
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
13
13
|
import { SendHorizonalIcon } from '../../components/icons/index';
|
|
14
14
|
import { useCreateConversation, useOpenpeeps } from '@openpeepshq/react';
|
|
15
15
|
import { ThemedText } from '../../components/ui/themed-text';
|
|
16
16
|
import { Profile, PublicProfile } from '@openpeepshq/common';
|
|
17
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
18
17
|
import { OpenpeepsMarkdownInput } from '../../components/post/post-form/OpenpeepsMarkdownInput';
|
|
19
18
|
import { useTranslation } from 'react-i18next';
|
|
20
19
|
import { maxContentLength } from '../../lib/utils';
|
|
@@ -42,9 +41,10 @@ export const DraftMessage = ({ navigation }: DraftMessageProps) => {
|
|
|
42
41
|
if (contnt) setMessage(contnt);
|
|
43
42
|
}, [contnt, setMessage]);
|
|
44
43
|
|
|
44
|
+
useSetPageHeader(t('conversations.draft.title'));
|
|
45
|
+
|
|
45
46
|
return (
|
|
46
|
-
<
|
|
47
|
-
<GenericHeader title={t('conversations.draft.title')} />
|
|
47
|
+
<ThemedView className="flex-1 relative">
|
|
48
48
|
<KeyboardAvoidingView className="flex-1" behavior="padding">
|
|
49
49
|
<ScrollView
|
|
50
50
|
ref={scrollViewRef}
|
|
@@ -97,6 +97,6 @@ export const DraftMessage = ({ navigation }: DraftMessageProps) => {
|
|
|
97
97
|
</View>
|
|
98
98
|
</ThemedView>
|
|
99
99
|
</KeyboardAvoidingView>
|
|
100
|
-
</
|
|
100
|
+
</ThemedView>
|
|
101
101
|
);
|
|
102
102
|
};
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
usePostViewFlush,
|
|
7
7
|
} from '@openpeepshq/react';
|
|
8
8
|
import { useTranslation } from 'react-i18next';
|
|
9
|
-
import {
|
|
9
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
10
|
+
import { ThemedView } from '../../components/ui/themed-view';
|
|
10
11
|
import {
|
|
11
12
|
KeyboardAvoidingView,
|
|
12
13
|
ScrollView,
|
|
@@ -16,7 +17,6 @@ import {
|
|
|
16
17
|
ActivityIndicator,
|
|
17
18
|
} from 'react-native';
|
|
18
19
|
import { InfoIcon, SendHorizonalIcon } from '../../components/icons/index';
|
|
19
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
20
20
|
import { MediaAttachmentData } from '@openpeepshq/common';
|
|
21
21
|
import { ComposeAttachments } from '../../components/post/post-form/ComposeAttachments';
|
|
22
22
|
import { OpenpeepsMarkdownInput } from '../../components/post/post-form/OpenpeepsMarkdownInput';
|
|
@@ -106,26 +106,22 @@ export const ConversationShow = ({ route, navigation }: ConversationProps) => {
|
|
|
106
106
|
void markPostsSeen({ postIds: unseenIds });
|
|
107
107
|
}, [id, currentProfile, messages, isLoading, markPostsSeen]);
|
|
108
108
|
|
|
109
|
+
useSetPageHeader(
|
|
110
|
+
<ConversationProfileHeader
|
|
111
|
+
participants={headerParticipants}
|
|
112
|
+
onPress={isGroupChat ? () => setParticipantsOpen(true) : undefined}
|
|
113
|
+
/>,
|
|
114
|
+
<TouchableOpacity
|
|
115
|
+
onPress={() => navigation.navigate('ConversationInfo', { id })}
|
|
116
|
+
>
|
|
117
|
+
<InfoIcon size={20} className="text-foreground" />
|
|
118
|
+
</TouchableOpacity>
|
|
119
|
+
);
|
|
120
|
+
|
|
109
121
|
return (
|
|
110
|
-
<
|
|
122
|
+
<ThemedView className="flex-1">
|
|
111
123
|
<View className="flex-1">
|
|
112
124
|
<DropdownMenu>
|
|
113
|
-
<GenericHeader
|
|
114
|
-
title={
|
|
115
|
-
<ConversationProfileHeader
|
|
116
|
-
participants={headerParticipants}
|
|
117
|
-
onPress={
|
|
118
|
-
isGroupChat ? () => setParticipantsOpen(true) : undefined
|
|
119
|
-
}
|
|
120
|
-
/>
|
|
121
|
-
}
|
|
122
|
-
rightType="icon"
|
|
123
|
-
rightButtonIcon={<InfoIcon size={20} className="text-foreground" />}
|
|
124
|
-
onRightButtonPress={() =>
|
|
125
|
-
navigation.navigate('ConversationInfo', { id: id })
|
|
126
|
-
}
|
|
127
|
-
/>
|
|
128
|
-
|
|
129
125
|
<KeyboardAvoidingView
|
|
130
126
|
className="flex-1"
|
|
131
127
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
@@ -248,6 +244,6 @@ export const ConversationShow = ({ route, navigation }: ConversationProps) => {
|
|
|
248
244
|
/>
|
|
249
245
|
) : null}
|
|
250
246
|
</View>
|
|
251
|
-
</
|
|
247
|
+
</ThemedView>
|
|
252
248
|
);
|
|
253
249
|
};
|
|
@@ -5,10 +5,10 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
5
|
import Toast from 'react-native-toast-message';
|
|
6
6
|
import { truncateText } from '@openpeepshq/common/lib';
|
|
7
7
|
import { useEditEvent } from '@openpeepshq/react';
|
|
8
|
-
import {
|
|
8
|
+
import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
|
|
9
|
+
import { ThemedView } from '../../components/ui/themed-view';
|
|
9
10
|
import { MainScreenProps } from '../../components/navigation/types/index';
|
|
10
11
|
import { EventForm } from '../../components/post/index';
|
|
11
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
12
12
|
import { ThemedText } from '../../components/ui/themed-text';
|
|
13
13
|
|
|
14
14
|
type EditEventProps = MainScreenProps<'EditEvent'>;
|
|
@@ -38,17 +38,18 @@ export const EditEvent = ({ route }: EditEventProps) => {
|
|
|
38
38
|
? `${t('events.edit')} ${truncateText(eventName)}`
|
|
39
39
|
: t('events.edit');
|
|
40
40
|
|
|
41
|
+
useSetPageHeader(
|
|
42
|
+
title,
|
|
43
|
+
<HeaderActionButton
|
|
44
|
+
title={submitting ? t('common.saving') : t('events.update.title')}
|
|
45
|
+
onPress={() => void submit()}
|
|
46
|
+
disabled={submitting || !canSubmit}
|
|
47
|
+
loading={submitting}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
|
|
41
51
|
return (
|
|
42
|
-
<
|
|
43
|
-
<GenericHeader
|
|
44
|
-
title={title}
|
|
45
|
-
rightButtonTitle={
|
|
46
|
-
submitting ? t('common.saving') : t('events.update.title')
|
|
47
|
-
}
|
|
48
|
-
onRightButtonPress={() => void submit()}
|
|
49
|
-
rightButtonDisabled={submitting || !canSubmit}
|
|
50
|
-
rightType="button"
|
|
51
|
-
/>
|
|
52
|
+
<ThemedView className="flex-1">
|
|
52
53
|
{postQuery.isLoading ? (
|
|
53
54
|
<ActivityIndicator size="small" />
|
|
54
55
|
) : !postQuery.data || !postData ? (
|
|
@@ -68,6 +69,6 @@ export const EditEvent = ({ route }: EditEventProps) => {
|
|
|
68
69
|
/>
|
|
69
70
|
</KeyboardAwareScrollView>
|
|
70
71
|
)}
|
|
71
|
-
</
|
|
72
|
+
</ThemedView>
|
|
72
73
|
);
|
|
73
74
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Pressable
|
|
2
|
+
import { Pressable } from 'react-native';
|
|
3
3
|
import { NativeStackScreenProps } from '@react-navigation/native-stack';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import {
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
useDefaultVisibility,
|
|
8
8
|
useOpenpeeps,
|
|
9
9
|
} from '@openpeepshq/react';
|
|
10
|
-
import { AgendaTabs
|
|
10
|
+
import { AgendaTabs } from '../../components/custom/index';
|
|
11
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
11
12
|
import {
|
|
12
13
|
ChevronRightIcon,
|
|
13
14
|
MoreHorizontalIcon,
|
|
@@ -44,37 +45,32 @@ export const EventsIndex = ({
|
|
|
44
45
|
|
|
45
46
|
const visibility = useDefaultVisibility();
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
useSetPageHeader(
|
|
49
|
+
t('navigation.events', { defaultValue: 'Events' }),
|
|
50
|
+
<DropdownMenu>
|
|
51
|
+
<DropdownMenuTrigger asChild className="px-2">
|
|
52
|
+
<Pressable>
|
|
53
|
+
<MoreHorizontalIcon className="text-foreground" />
|
|
54
|
+
</Pressable>
|
|
55
|
+
</DropdownMenuTrigger>
|
|
56
|
+
<DropdownMenuContent className="mt-1">
|
|
57
|
+
<DropdownMenuGroup>
|
|
58
|
+
<DropdownMenuItem
|
|
59
|
+
className="flex-row items-center gap-x-2"
|
|
60
|
+
onPress={() => navigation.navigate('MyEvents')}
|
|
61
|
+
>
|
|
62
|
+
<ChevronRightIcon size={16} className="text-foreground" />
|
|
63
|
+
<ThemedText>
|
|
64
|
+
{t('navigation.myEvents', { defaultValue: 'My events' })}
|
|
54
65
|
</ThemedText>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<DropdownMenuItem
|
|
64
|
-
className="flex-row gap-x-2 items-center"
|
|
65
|
-
onPress={() => navigation.navigate('MyEvents')}
|
|
66
|
-
>
|
|
67
|
-
<ChevronRightIcon size={16} className="text-foreground" />
|
|
68
|
-
<ThemedText>
|
|
69
|
-
{t('navigation.myEvents', { defaultValue: 'My events' })}
|
|
70
|
-
</ThemedText>
|
|
71
|
-
</DropdownMenuItem>
|
|
72
|
-
</DropdownMenuGroup>
|
|
73
|
-
</DropdownMenuContent>
|
|
74
|
-
</DropdownMenu>
|
|
75
|
-
</View>
|
|
76
|
-
}
|
|
77
|
-
/>
|
|
66
|
+
</DropdownMenuItem>
|
|
67
|
+
</DropdownMenuGroup>
|
|
68
|
+
</DropdownMenuContent>
|
|
69
|
+
</DropdownMenu>
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<ThemedView className="relative flex-1">
|
|
78
74
|
<AgendaTabs<Tab>
|
|
79
75
|
accessibilityLabel={t('events.feed.label', {
|
|
80
76
|
defaultValue: 'Event timeframe',
|
package/src/pages/events/My.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { useOpenpeeps } from '@openpeepshq/react';
|
|
4
|
-
import { AgendaTabs
|
|
4
|
+
import { AgendaTabs } from '../../components/custom/index';
|
|
5
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
6
|
+
import { ThemedView } from '../../components/ui/themed-view';
|
|
5
7
|
import { MainScreenProps } from '../../components/navigation/types/index';
|
|
6
8
|
import { EventsView, Feed } from '../../components/post/index';
|
|
7
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
8
9
|
|
|
9
10
|
type Tab = 'upcoming' | 'current' | 'past';
|
|
10
11
|
|
|
@@ -24,11 +25,10 @@ export const EventsMy: React.FC<MainScreenProps<'MyEvents'>> = () => {
|
|
|
24
25
|
? currentQuery
|
|
25
26
|
: pastQuery;
|
|
26
27
|
|
|
28
|
+
useSetPageHeader(t('navigation.myEvents', { defaultValue: 'My events' }));
|
|
29
|
+
|
|
27
30
|
return (
|
|
28
|
-
<
|
|
29
|
-
<GenericHeader
|
|
30
|
-
title={t('navigation.myEvents', { defaultValue: 'My events' })}
|
|
31
|
-
/>
|
|
31
|
+
<ThemedView className="flex-1">
|
|
32
32
|
<AgendaTabs<Tab>
|
|
33
33
|
accessibilityLabel={t('events.feed.label', {
|
|
34
34
|
defaultValue: 'Event timeframe',
|
|
@@ -55,6 +55,6 @@ export const EventsMy: React.FC<MainScreenProps<'MyEvents'>> = () => {
|
|
|
55
55
|
agenda={tab}
|
|
56
56
|
list={<Feed query={activeQuery} formatSwitch={false} />}
|
|
57
57
|
/>
|
|
58
|
-
</
|
|
58
|
+
</ThemedView>
|
|
59
59
|
);
|
|
60
60
|
};
|
package/src/pages/events/New.tsx
CHANGED
|
@@ -3,10 +3,10 @@ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import Toast from 'react-native-toast-message';
|
|
5
5
|
import { useNewEvent } from '@openpeepshq/react';
|
|
6
|
-
import {
|
|
6
|
+
import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
|
|
7
|
+
import { ThemedView } from '../../components/ui/themed-view';
|
|
7
8
|
import { MainScreenProps } from '../../components/navigation/types/index';
|
|
8
9
|
import { EventForm } from '../../components/post/index';
|
|
9
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
10
10
|
|
|
11
11
|
type NewEventProps = MainScreenProps<'NewEvent'>;
|
|
12
12
|
|
|
@@ -28,23 +28,24 @@ export const NewEvent = (_props: NewEventProps) => {
|
|
|
28
28
|
clearError();
|
|
29
29
|
}, [error, clearError]);
|
|
30
30
|
|
|
31
|
+
useSetPageHeader(
|
|
32
|
+
t('events.create.title'),
|
|
33
|
+
<HeaderActionButton
|
|
34
|
+
title={submitting ? t('common.submitting') : t('events.create.title')}
|
|
35
|
+
onPress={() => void submit()}
|
|
36
|
+
disabled={submitting || !canSubmit}
|
|
37
|
+
loading={submitting}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
|
|
31
41
|
return (
|
|
32
|
-
<
|
|
33
|
-
<GenericHeader
|
|
34
|
-
title={t('events.create.title')}
|
|
35
|
-
rightButtonTitle={
|
|
36
|
-
submitting ? t('common.submitting') : t('events.create.title')
|
|
37
|
-
}
|
|
38
|
-
onRightButtonPress={() => void submit()}
|
|
39
|
-
rightButtonDisabled={submitting || !canSubmit}
|
|
40
|
-
rightType="button"
|
|
41
|
-
/>
|
|
42
|
+
<ThemedView className="flex-1">
|
|
42
43
|
<KeyboardAwareScrollView
|
|
43
44
|
contentContainerClassName="grow"
|
|
44
45
|
className="pb-12"
|
|
45
46
|
>
|
|
46
47
|
<EventForm postData={postData} onChange={setPostData} />
|
|
47
48
|
</KeyboardAwareScrollView>
|
|
48
|
-
</
|
|
49
|
+
</ThemedView>
|
|
49
50
|
);
|
|
50
51
|
};
|
|
@@ -4,8 +4,7 @@ import {
|
|
|
4
4
|
TabStackParamList,
|
|
5
5
|
} from '../../components/navigation/types/index';
|
|
6
6
|
import { useFeedListParams, useOpenpeeps } from '@openpeepshq/react';
|
|
7
|
-
import {
|
|
8
|
-
import { ThemedText } from '../../components/ui/themed-text';
|
|
7
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
9
8
|
import { CompositeScreenProps } from '@react-navigation/native';
|
|
10
9
|
import { NativeStackScreenProps } from '@react-navigation/native-stack';
|
|
11
10
|
import { RefreshControl, ScrollView } from 'react-native';
|
|
@@ -31,15 +30,10 @@ export const FeedsBookmarks: React.FC<HomeScreenProps> = ({}) => {
|
|
|
31
30
|
setRefreshing(false);
|
|
32
31
|
}, [query]);
|
|
33
32
|
|
|
33
|
+
useSetPageHeader(t('navigation.bookmarks'));
|
|
34
|
+
|
|
34
35
|
return (
|
|
35
36
|
<>
|
|
36
|
-
<TabScreensHeader
|
|
37
|
-
children={
|
|
38
|
-
<ThemedText className="text-xl font-bold">
|
|
39
|
-
{t('navigation.bookmarks')}
|
|
40
|
-
</ThemedText>
|
|
41
|
-
}
|
|
42
|
-
/>
|
|
43
37
|
<ScrollView
|
|
44
38
|
className="bg-background"
|
|
45
39
|
refreshControl={
|
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
useOpenpeeps,
|
|
11
11
|
} from '@openpeepshq/react';
|
|
12
12
|
import { CompositeScreenProps } from '@react-navigation/native';
|
|
13
|
-
import {
|
|
14
|
-
import { ThemedText } from '../../components/ui/themed-text';
|
|
13
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
15
14
|
import { useTranslation } from 'react-i18next';
|
|
16
15
|
import { Feed, NewNoteButton } from '../../components/post/index';
|
|
17
16
|
|
|
@@ -31,16 +30,10 @@ export const FeedsLocal: React.FC<HomeScreenProps> = () => {
|
|
|
31
30
|
|
|
32
31
|
const query = openpeepsApi.useLocalFeed(useFeedListParams({ limit: 15 }));
|
|
33
32
|
|
|
33
|
+
useSetPageHeader(t('navigation.community'));
|
|
34
|
+
|
|
34
35
|
return (
|
|
35
36
|
<>
|
|
36
|
-
<TabScreensHeader
|
|
37
|
-
children={
|
|
38
|
-
<ThemedText className="text-xl font-bold">
|
|
39
|
-
{t('navigation.community')}
|
|
40
|
-
</ThemedText>
|
|
41
|
-
}
|
|
42
|
-
/>
|
|
43
|
-
|
|
44
37
|
<Feed
|
|
45
38
|
query={query}
|
|
46
39
|
pinnedPostId={pinnedPostId}
|
package/src/pages/feeds/My.tsx
CHANGED
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
useOpenpeeps,
|
|
11
11
|
} from '@openpeepshq/react';
|
|
12
12
|
import { CompositeScreenProps } from '@react-navigation/native';
|
|
13
|
-
import {
|
|
14
|
-
import { ThemedText } from '../../components/ui/themed-text';
|
|
13
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
15
14
|
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
17
16
|
import { Feed, NewNoteButton } from '../../components/post/index';
|
|
@@ -27,15 +26,10 @@ export const FeedsMy: React.FC<HomeScreenProps> = () => {
|
|
|
27
26
|
const query = openpeepsApi.useMyFeed(useFeedListParams({ limit: 15 }));
|
|
28
27
|
const visibility = useDefaultVisibility();
|
|
29
28
|
|
|
29
|
+
useSetPageHeader(t('navigation.myFeed'));
|
|
30
|
+
|
|
30
31
|
return (
|
|
31
32
|
<>
|
|
32
|
-
<TabScreensHeader
|
|
33
|
-
children={
|
|
34
|
-
<ThemedText className="text-xl font-bold">
|
|
35
|
-
{t('navigation.myFeed')}
|
|
36
|
-
</ThemedText>
|
|
37
|
-
}
|
|
38
|
-
/>
|
|
39
33
|
<Feed query={query} />
|
|
40
34
|
<NewNoteButton visibility={visibility} />
|
|
41
35
|
</>
|
|
@@ -4,9 +4,9 @@ import { useTranslation } from 'react-i18next';
|
|
|
4
4
|
import { checkGroupCapabilities } from '@openpeepshq/common';
|
|
5
5
|
import { useAuthData, useOpenpeeps } from '@openpeepshq/react';
|
|
6
6
|
import { ConfigMenuButton } from '../../components/configuration/index';
|
|
7
|
-
import {
|
|
7
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
8
|
+
import { ThemedView } from '../../components/ui/themed-view';
|
|
8
9
|
import { MainScreenProps } from '../../components/navigation/types/index';
|
|
9
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
10
10
|
import { ThemedText } from '../../components/ui/themed-text';
|
|
11
11
|
|
|
12
12
|
type EditGroupProps = MainScreenProps<'EditGroupDetails'>;
|
|
@@ -27,11 +27,10 @@ export const EditGroup = ({ route, navigation }: EditGroupProps) => {
|
|
|
27
27
|
checkGroupCapabilities(authData, ['core-groups-updateCapabilities'], group)
|
|
28
28
|
.success;
|
|
29
29
|
|
|
30
|
+
useSetPageHeader(t('groups.edit.title', { defaultValue: 'Edit group' }));
|
|
31
|
+
|
|
30
32
|
return (
|
|
31
|
-
<
|
|
32
|
-
<GenericHeader
|
|
33
|
-
title={t('groups.edit.title', { defaultValue: 'Edit group' })}
|
|
34
|
-
/>
|
|
33
|
+
<ThemedView className="flex-1">
|
|
35
34
|
{groupQuery.isLoading ? (
|
|
36
35
|
<ActivityIndicator size="small" />
|
|
37
36
|
) : !group ? (
|
|
@@ -54,6 +53,6 @@ export const EditGroup = ({ route, navigation }: EditGroupProps) => {
|
|
|
54
53
|
) : null}
|
|
55
54
|
</View>
|
|
56
55
|
)}
|
|
57
|
-
</
|
|
56
|
+
</ThemedView>
|
|
58
57
|
);
|
|
59
58
|
};
|
|
@@ -4,10 +4,10 @@ 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 { useEditGroup } from '@openpeepshq/react';
|
|
7
|
-
import {
|
|
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
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
11
11
|
import { ThemedText } from '../../components/ui/themed-text';
|
|
12
12
|
|
|
13
13
|
type EditGroupInfoProps = MainScreenProps<'EditGroupInfo'>;
|
|
@@ -32,21 +32,24 @@ export const EditGroupInfo = ({ route }: EditGroupInfoProps) => {
|
|
|
32
32
|
clearError();
|
|
33
33
|
}, [error, clearError]);
|
|
34
34
|
|
|
35
|
+
useSetPageHeader(
|
|
36
|
+
t('groups.edit.info.title', {
|
|
37
|
+
defaultValue: 'Group information',
|
|
38
|
+
}),
|
|
39
|
+
<HeaderActionButton
|
|
40
|
+
title={
|
|
41
|
+
submitting
|
|
42
|
+
? t('common.saving', { defaultValue: 'Saving…' })
|
|
43
|
+
: t('common.save', { defaultValue: 'Save' })
|
|
44
|
+
}
|
|
45
|
+
onPress={() => void submit()}
|
|
46
|
+
disabled={submitting || !groupData}
|
|
47
|
+
loading={submitting}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
|
|
35
51
|
return (
|
|
36
|
-
<
|
|
37
|
-
<GenericHeader
|
|
38
|
-
title={t('groups.edit.info.title', {
|
|
39
|
-
defaultValue: 'Group information',
|
|
40
|
-
})}
|
|
41
|
-
rightButtonTitle={
|
|
42
|
-
submitting
|
|
43
|
-
? t('common.saving', { defaultValue: 'Saving…' })
|
|
44
|
-
: t('common.save', { defaultValue: 'Save' })
|
|
45
|
-
}
|
|
46
|
-
onRightButtonPress={() => void submit()}
|
|
47
|
-
rightButtonDisabled={submitting || !groupData}
|
|
48
|
-
rightType="button"
|
|
49
|
-
/>
|
|
52
|
+
<ThemedView className="flex-1">
|
|
50
53
|
{groupQuery.isLoading || !groupData ? (
|
|
51
54
|
groupQuery.isLoading ? (
|
|
52
55
|
<ActivityIndicator size="small" />
|
|
@@ -71,6 +74,6 @@ export const EditGroupInfo = ({ route }: EditGroupInfoProps) => {
|
|
|
71
74
|
</View>
|
|
72
75
|
</KeyboardAwareScrollView>
|
|
73
76
|
)}
|
|
74
|
-
</
|
|
77
|
+
</ThemedView>
|
|
75
78
|
);
|
|
76
79
|
};
|
|
@@ -3,10 +3,10 @@ import { ActivityIndicator, ScrollView, View } from 'react-native';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import Toast from 'react-native-toast-message';
|
|
5
5
|
import { useEditGroup } from '@openpeepshq/react';
|
|
6
|
-
import {
|
|
6
|
+
import { HeaderActionButton, useSetPageHeader } from '../../components/layout';
|
|
7
|
+
import { ThemedView } from '../../components/ui/themed-view';
|
|
7
8
|
import { GroupForm } from '../../components/groups/index';
|
|
8
9
|
import { MainScreenProps } from '../../components/navigation/types/index';
|
|
9
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
10
10
|
import { ThemedText } from '../../components/ui/themed-text';
|
|
11
11
|
|
|
12
12
|
type EditGroupRolesProps = MainScreenProps<'EditGroupRoles'>;
|
|
@@ -64,22 +64,21 @@ export const EditGroupRoles = ({ route }: EditGroupRolesProps) => {
|
|
|
64
64
|
);
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
/>
|
|
82
|
-
{body()}
|
|
83
|
-
</ThemedSafeAreaView>
|
|
67
|
+
useSetPageHeader(
|
|
68
|
+
t('groups.edit.roles.title', {
|
|
69
|
+
defaultValue: 'Roles & capabilities',
|
|
70
|
+
}),
|
|
71
|
+
<HeaderActionButton
|
|
72
|
+
title={
|
|
73
|
+
submitting
|
|
74
|
+
? t('common.saving', { defaultValue: 'Saving…' })
|
|
75
|
+
: t('common.save', { defaultValue: 'Save' })
|
|
76
|
+
}
|
|
77
|
+
onPress={() => void submit()}
|
|
78
|
+
disabled={submitting || !groupData || !canEditCapabilities}
|
|
79
|
+
loading={submitting}
|
|
80
|
+
/>
|
|
84
81
|
);
|
|
82
|
+
|
|
83
|
+
return <ThemedView className="flex-1">{body()}</ThemedView>;
|
|
85
84
|
};
|