@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.
- package/package.json +3 -3
- 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.tsx +75 -0
- package/src/components/navigation/auth-navigator.tsx +2 -2
- package/src/components/navigation/main-navigator.tsx +17 -1
- package/src/components/navigation/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/Welcome.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
2
2
|
import { ThemedView } from '../components/ui/themed-view';
|
|
3
3
|
import { ActivityIndicator, ScrollView, TouchableOpacity } from 'react-native';
|
|
4
4
|
import { useOpenpeeps } from '@openpeepshq/react';
|
|
5
|
-
import {
|
|
5
|
+
import { useSetPageHeader } from '../components/layout';
|
|
6
6
|
import {
|
|
7
7
|
UserCheckIcon,
|
|
8
8
|
MailCheckIcon,
|
|
@@ -122,15 +122,10 @@ export const Welcome = () => {
|
|
|
122
122
|
]
|
|
123
123
|
);
|
|
124
124
|
|
|
125
|
+
useSetPageHeader(t('navigation.welcome'));
|
|
126
|
+
|
|
125
127
|
return (
|
|
126
128
|
<ThemedView className="flex-1">
|
|
127
|
-
<TabScreensHeader
|
|
128
|
-
children={
|
|
129
|
-
<ThemedText className="text-2xl font-semibold">
|
|
130
|
-
{t('navigation.welcome')}
|
|
131
|
-
</ThemedText>
|
|
132
|
-
}
|
|
133
|
-
/>
|
|
134
129
|
<ScrollView className="p-4 w-full">
|
|
135
130
|
{isLoading && <ActivityIndicator size={'small'} />}
|
|
136
131
|
<ThemedView className="w-full mt-2">
|
|
@@ -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 { useEditArticle } 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 { ArticleForm } 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 EditArticleProps = MainScreenProps<'EditArticle'>;
|
|
@@ -37,19 +37,22 @@ export const EditArticle: React.FC<EditArticleProps> = ({ route }) => {
|
|
|
37
37
|
? `${t('articles.edit', { defaultValue: 'Edit article' })} ${truncateText(articleTitle)}`
|
|
38
38
|
: t('articles.edit', { defaultValue: 'Edit article' });
|
|
39
39
|
|
|
40
|
+
useSetPageHeader(
|
|
41
|
+
title,
|
|
42
|
+
<HeaderActionButton
|
|
43
|
+
title={
|
|
44
|
+
submitting
|
|
45
|
+
? t('common.saving', { defaultValue: 'Saving…' })
|
|
46
|
+
: t('articles.update.title', { defaultValue: 'Update article' })
|
|
47
|
+
}
|
|
48
|
+
onPress={() => void submit()}
|
|
49
|
+
disabled={submitting || !postData}
|
|
50
|
+
loading={submitting}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
|
|
40
54
|
return (
|
|
41
|
-
<
|
|
42
|
-
<GenericHeader
|
|
43
|
-
title={title}
|
|
44
|
-
rightButtonTitle={
|
|
45
|
-
submitting
|
|
46
|
-
? t('common.saving', { defaultValue: 'Saving…' })
|
|
47
|
-
: t('articles.update.title', { defaultValue: 'Update article' })
|
|
48
|
-
}
|
|
49
|
-
onRightButtonPress={() => void submit()}
|
|
50
|
-
rightButtonDisabled={submitting || !postData}
|
|
51
|
-
rightType="button"
|
|
52
|
-
/>
|
|
55
|
+
<ThemedView className="flex-1">
|
|
53
56
|
{postQuery.isLoading ? (
|
|
54
57
|
<ActivityIndicator size="small" />
|
|
55
58
|
) : !postQuery.data || !postData ? (
|
|
@@ -64,6 +67,6 @@ export const EditArticle: React.FC<EditArticleProps> = ({ route }) => {
|
|
|
64
67
|
<ArticleForm postData={postData} onChange={setPostData} isEdit />
|
|
65
68
|
</KeyboardAwareScrollView>
|
|
66
69
|
)}
|
|
67
|
-
</
|
|
70
|
+
</ThemedView>
|
|
68
71
|
);
|
|
69
72
|
};
|
|
@@ -3,10 +3,11 @@ import { useNavigation } from '@react-navigation/native';
|
|
|
3
3
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { useFeedListParams, useOpenpeeps } from '@openpeepshq/react';
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
useSetPageHeader,
|
|
8
|
+
useSetPlusButtonActions,
|
|
9
|
+
} from '../../components/layout';
|
|
8
10
|
import { MainStackParamList } from '../../components/navigation/types/index';
|
|
9
|
-
import { ThemedText } from '../../components/ui/themed-text';
|
|
10
11
|
|
|
11
12
|
import { Feed } from '../../components/post/index';
|
|
12
13
|
export const ArticlesIndex = () => {
|
|
@@ -20,22 +21,11 @@ export const ArticlesIndex = () => {
|
|
|
20
21
|
useFeedListParams({ limit: 15 })
|
|
21
22
|
);
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
/>
|
|
32
|
-
<Feed query={articlesQuery} />
|
|
33
|
-
<PlusFab
|
|
34
|
-
accessibilityLabel={t('articles.new')}
|
|
35
|
-
onPress={() => navigation.navigate('NewArticle')}
|
|
36
|
-
>
|
|
37
|
-
<FilePlusIcon size={24} className="text-background" />
|
|
38
|
-
</PlusFab>
|
|
39
|
-
</>
|
|
40
|
-
);
|
|
24
|
+
useSetPageHeader(t('navigation.articles'));
|
|
25
|
+
useSetPlusButtonActions({
|
|
26
|
+
title: t('articles.new'),
|
|
27
|
+
action: () => navigation.navigate('NewArticle'),
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return <Feed query={articlesQuery} />;
|
|
41
31
|
};
|
|
@@ -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 { useNewArticle } 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 { ArticleForm } from '../../components/post/index';
|
|
9
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
10
10
|
|
|
11
11
|
type NewArticleProps = MainScreenProps<'NewArticle'>;
|
|
12
12
|
|
|
@@ -28,25 +28,28 @@ export const NewArticle: React.FC<NewArticleProps> = () => {
|
|
|
28
28
|
clearError();
|
|
29
29
|
}, [error, clearError]);
|
|
30
30
|
|
|
31
|
+
useSetPageHeader(
|
|
32
|
+
t('articles.new', { defaultValue: 'New article' }),
|
|
33
|
+
<HeaderActionButton
|
|
34
|
+
title={
|
|
35
|
+
submitting
|
|
36
|
+
? t('common.submitting', { defaultValue: 'Publishing…' })
|
|
37
|
+
: t('articles.create.title', { defaultValue: 'Create article' })
|
|
38
|
+
}
|
|
39
|
+
onPress={() => void submit()}
|
|
40
|
+
disabled={submitting || !canSubmit}
|
|
41
|
+
loading={submitting}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
|
|
31
45
|
return (
|
|
32
|
-
<
|
|
33
|
-
<GenericHeader
|
|
34
|
-
title={t('articles.new', { defaultValue: 'New article' })}
|
|
35
|
-
rightButtonTitle={
|
|
36
|
-
submitting
|
|
37
|
-
? t('common.submitting', { defaultValue: 'Publishing…' })
|
|
38
|
-
: t('articles.create.title', { defaultValue: 'Create article' })
|
|
39
|
-
}
|
|
40
|
-
onRightButtonPress={() => void submit()}
|
|
41
|
-
rightButtonDisabled={submitting || !canSubmit}
|
|
42
|
-
rightType="button"
|
|
43
|
-
/>
|
|
46
|
+
<ThemedView className="flex-1">
|
|
44
47
|
<KeyboardAwareScrollView
|
|
45
48
|
contentContainerClassName="grow"
|
|
46
49
|
className="pb-12"
|
|
47
50
|
>
|
|
48
51
|
<ArticleForm postData={postData} onChange={setPostData} />
|
|
49
52
|
</KeyboardAwareScrollView>
|
|
50
|
-
</
|
|
53
|
+
</ThemedView>
|
|
51
54
|
);
|
|
52
55
|
};
|
|
@@ -5,18 +5,14 @@ import {
|
|
|
5
5
|
View,
|
|
6
6
|
} from 'react-native';
|
|
7
7
|
import React, { useEffect, useRef } from 'react';
|
|
8
|
+
import { EmptyStateContainer } from '../../components/custom/index';
|
|
8
9
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from '../../components/custom/index';
|
|
10
|
+
useSetPageHeader,
|
|
11
|
+
useSetPlusButtonActions,
|
|
12
|
+
} from '../../components/layout';
|
|
13
13
|
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
14
14
|
import { useAuthData, useOpenpeeps } from '@openpeepshq/react';
|
|
15
|
-
import {
|
|
16
|
-
MessageSquarePlusIcon,
|
|
17
|
-
SearchIcon,
|
|
18
|
-
XIcon,
|
|
19
|
-
} from '../../components/icons/index';
|
|
15
|
+
import { SearchIcon, XIcon } from '../../components/icons/index';
|
|
20
16
|
import { CompositeScreenProps } from '@react-navigation/native';
|
|
21
17
|
import { NativeStackScreenProps } from '@react-navigation/native-stack';
|
|
22
18
|
import {
|
|
@@ -25,7 +21,6 @@ import {
|
|
|
25
21
|
} from '../../components/navigation/types/index';
|
|
26
22
|
import { canCreatePost, PublicPost } from '@openpeepshq/common';
|
|
27
23
|
import { Input } from '../../components/ui/input';
|
|
28
|
-
import { ThemedText } from '../../components/ui/themed-text';
|
|
29
24
|
import { profileMatchesQuery } from '../../lib/utils';
|
|
30
25
|
import { BottomSheetModal } from '@gorhom/bottom-sheet';
|
|
31
26
|
|
|
@@ -85,57 +80,46 @@ export const ConversationsIndex: React.FC<MessagesProps> = ({ navigation }) => {
|
|
|
85
80
|
}
|
|
86
81
|
}, [conversations, searchQuery]);
|
|
87
82
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</View>
|
|
123
|
-
) : (
|
|
124
|
-
<>
|
|
125
|
-
<TouchableOpacity onPress={() => setIsSearchToggled(true)}>
|
|
126
|
-
<SearchIcon size={20} className="text-foreground" />
|
|
127
|
-
</TouchableOpacity>
|
|
128
|
-
<DirectMessagesHeaderActions />
|
|
129
|
-
{/* TODO Uncomment when conversation settings are implemented */}
|
|
130
|
-
{/* <TouchableOpacity onPress={handleSettingsPress}>
|
|
131
|
-
<Settings2Icon size={20} className="text-foreground" />
|
|
132
|
-
</TouchableOpacity> */}
|
|
133
|
-
</>
|
|
134
|
-
)}
|
|
135
|
-
</View>
|
|
136
|
-
</View>
|
|
83
|
+
useSetPageHeader(
|
|
84
|
+
t('navigation.messages'),
|
|
85
|
+
<View className="flex-row items-center gap-x-3">
|
|
86
|
+
{isSearchToggled ? (
|
|
87
|
+
<View className="max-w-[180px] flex-row items-center">
|
|
88
|
+
<Input
|
|
89
|
+
className="flex-1"
|
|
90
|
+
placeholder={t('conversations.search.placeholder')}
|
|
91
|
+
value={searchQuery}
|
|
92
|
+
onChangeText={setSearchQuery}
|
|
93
|
+
/>
|
|
94
|
+
<TouchableOpacity
|
|
95
|
+
className="items-center justify-center px-2"
|
|
96
|
+
onPress={() => {
|
|
97
|
+
setSearchQuery('');
|
|
98
|
+
setIsSearchToggled(false);
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
<XIcon size={20} className="text-foreground" />
|
|
102
|
+
</TouchableOpacity>
|
|
103
|
+
</View>
|
|
104
|
+
) : (
|
|
105
|
+
<TouchableOpacity onPress={() => setIsSearchToggled(true)}>
|
|
106
|
+
<SearchIcon size={20} className="text-foreground" />
|
|
107
|
+
</TouchableOpacity>
|
|
108
|
+
)}
|
|
109
|
+
<DirectMessagesHeaderActions />
|
|
110
|
+
</View>
|
|
111
|
+
);
|
|
112
|
+
useSetPlusButtonActions(
|
|
113
|
+
canCreate
|
|
114
|
+
? {
|
|
115
|
+
title: t('conversations.newMessage'),
|
|
116
|
+
action: () => openCreateConversation(),
|
|
137
117
|
}
|
|
138
|
-
|
|
118
|
+
: undefined
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<View className="relative flex-1">
|
|
139
123
|
<KeyboardAwareScrollView
|
|
140
124
|
refreshControl={
|
|
141
125
|
<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
|
|
@@ -165,14 +149,6 @@ export const ConversationsIndex: React.FC<MessagesProps> = ({ navigation }) => {
|
|
|
165
149
|
/>
|
|
166
150
|
))}
|
|
167
151
|
</KeyboardAwareScrollView>
|
|
168
|
-
{canCreate ? (
|
|
169
|
-
<PlusFab
|
|
170
|
-
accessibilityLabel={t('conversations.newMessage')}
|
|
171
|
-
onPress={() => openCreateConversation()}
|
|
172
|
-
>
|
|
173
|
-
<MessageSquarePlusIcon size={24} className="text-background" />
|
|
174
|
-
</PlusFab>
|
|
175
|
-
) : null}
|
|
176
152
|
<ConversationSettingsSheet
|
|
177
153
|
ref={settingsRef}
|
|
178
154
|
onMessageRequestChange={(value) => {
|
|
@@ -9,12 +9,12 @@ import { ScrollView, TouchableOpacity, View } from 'react-native';
|
|
|
9
9
|
import { ThemedText } from '../../components/ui/themed-text';
|
|
10
10
|
import { FollowUnfollowButton } from '../../components/profile/FollowUnfollowButton';
|
|
11
11
|
|
|
12
|
-
import { ThemedSafeAreaView } from '../../components/ui/themed-safe-area-view';
|
|
13
12
|
import { useNavigation } from '@react-navigation/native';
|
|
14
13
|
import { NativeStackNavigationProp } from '@react-navigation/native-stack';
|
|
15
14
|
import { ProfileAvatar } from '../../components/profile/Avatar';
|
|
16
15
|
|
|
17
|
-
import {
|
|
16
|
+
import { useSetPageHeader } from '../../components/layout';
|
|
17
|
+
import { ThemedView } from '../../components/ui/themed-view';
|
|
18
18
|
import {
|
|
19
19
|
ProfileBio,
|
|
20
20
|
ProfileHandle,
|
|
@@ -35,9 +35,10 @@ export const ConversationInfo = ({ route }: ConversationInfoProps) => {
|
|
|
35
35
|
const navigation =
|
|
36
36
|
useNavigation<NativeStackNavigationProp<MainStackParamList>>();
|
|
37
37
|
|
|
38
|
+
useSetPageHeader(t('conversations.info'));
|
|
39
|
+
|
|
38
40
|
return (
|
|
39
|
-
<
|
|
40
|
-
<GenericHeader title={t('conversations.info')} />
|
|
41
|
+
<ThemedView className="flex-1">
|
|
41
42
|
<ScrollView className="flex-1">
|
|
42
43
|
{isGroupChat ? (
|
|
43
44
|
<>
|
|
@@ -93,6 +94,6 @@ export const ConversationInfo = ({ route }: ConversationInfoProps) => {
|
|
|
93
94
|
</View>
|
|
94
95
|
)}
|
|
95
96
|
</ScrollView>
|
|
96
|
-
</
|
|
97
|
+
</ThemedView>
|
|
97
98
|
);
|
|
98
99
|
};
|
|
@@ -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',
|