@openpeepshq/rn-components 0.7.2 → 0.8.1
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/README.md +1 -1
- package/package.json +11 -6
- package/src/components/custom/modals/media/audio-picker-sheet.tsx +21 -25
- package/src/components/custom/modals/media/document-picker-sheet.tsx +22 -16
- package/src/components/custom/modals/media/video-picker-sheet.tsx +4 -2
- package/src/components/custom/navigation/side-menu.tsx +59 -11
- package/src/components/icons/iconWithClassName.tsx +21 -0
- package/src/components/jams/JamActionsFooter.tsx +8 -2
- package/src/components/jams/JamCapacityGate.tsx +1 -1
- package/src/components/jams/JamCard.tsx +8 -4
- package/src/components/jams/JamConference.tsx +6 -1
- package/src/components/jams/JamParticipantConference.tsx +2 -0
- package/src/components/jams/JamRoom.tsx +2 -3
- package/src/components/jams/LiveJamsSection.tsx +12 -1
- package/src/components/jams/LivekitUnavailableNotice.tsx +25 -0
- package/src/components/jams/index.ts +1 -0
- package/src/components/markdown/MarkdownOverlay.tsx +75 -0
- package/src/components/markdown/OpenpeepsMarkdown.tsx +3 -1
- package/src/components/markdown/extensions/link.tsx +34 -0
- package/src/components/markdown/index.ts +2 -0
- package/src/components/navigation/tab-navigator.tsx +39 -17
- package/src/components/notifications/NotificationItem.tsx +27 -2
- package/src/components/notifications/types/JamStarted.tsx +13 -3
- package/src/components/notifications/types/Reply.tsx +1 -5
- package/src/components/notifications/types/WaitlistOffer.tsx +61 -0
- package/src/components/notifications/types/index.ts +1 -0
- package/src/components/post/CompactReplyParent.tsx +16 -15
- package/src/components/post/TruncatedMarkdown.tsx +60 -0
- package/src/components/post/helpers.ts +2 -2
- package/src/components/post/index.ts +2 -0
- package/src/components/post/pieces/EventRsvpButton.tsx +99 -5
- package/src/components/post/pieces/EventRsvpList.tsx +46 -0
- package/src/components/post/pieces/EventRsvpScopeDialog.tsx +30 -19
- package/src/components/post/pieces/EventWaitlistJoinDialog.tsx +62 -0
- package/src/components/post/pieces/PollContent.tsx +7 -7
- package/src/components/post/pieces/PostActions.tsx +89 -23
- package/src/components/post/pieces/ShareMenu.tsx +2 -2
- package/src/components/post/post-form/DescriptionEditModal.tsx +1 -0
- package/src/components/post/post-form/EventForm.tsx +50 -10
- package/src/components/post/post-form/ResourceForm.tsx +131 -8
- package/src/components/post/types/Article.tsx +6 -2
- package/src/components/post/types/Poll.tsx +4 -1
- package/src/components/post/types/event/CardEvent.tsx +101 -76
- package/src/components/post/types/event/FullEvent.tsx +60 -23
- package/src/components/post/types/event/ProfileEventRelationship.tsx +2 -0
- package/src/components/post/types/resource/FullResource.tsx +9 -1
- package/src/components/preview-link/LocalPreviewLink.tsx +4 -1
- package/src/components/preview-link/helpers.ts +5 -1
- package/src/components/preview-link/index.ts +1 -0
- package/src/components/preview-link/local/WelcomePreview.tsx +59 -0
- package/src/components/profile/Avatar.tsx +0 -1
- package/src/components/profile/EditProfileForm.tsx +23 -2
- package/src/components/profile/ProfileSheet.tsx +1 -1
- package/src/components/resources/ResourceCard.tsx +62 -14
- package/src/components/resources/ResourceLibrary.tsx +2 -2
- package/src/components/ui/badge.tsx +2 -3
- package/src/components/ui/bottom-sheet.tsx +0 -6
- package/src/components/ui/popup-menu-button.tsx +2 -2
- package/src/components/ui/popup-menu-separator.tsx +1 -1
- package/src/components/ui/popup-menu.tsx +2 -2
- package/src/lib/utils.ts +10 -3
- package/src/pages/auth/Register.tsx +34 -4
- package/src/pages/conversations/Show.tsx +38 -7
- package/src/pages/feeds/Bookmarks.tsx +1 -1
- package/src/pages/jams/Index.tsx +6 -4
- package/src/pages/posts/New.tsx +1 -1
- package/src/pages/resources/Edit.tsx +2 -1
- package/src/pages/resources/New.tsx +6 -1
- package/src/pages/settings/Account.tsx +46 -2
- package/src/pages/settings/Index.tsx +3 -4
- package/src/pages/settings/NotificationPreferences.tsx +3 -3
- package/src/pages/settings/Theme.tsx +1 -1
- package/src/components/icons/iconWithClassName.ts +0 -12
|
@@ -16,6 +16,7 @@ export const NewResource: React.FC<NewResourceProps> = () => {
|
|
|
16
16
|
postData,
|
|
17
17
|
setPostData,
|
|
18
18
|
canSubmit,
|
|
19
|
+
groupOnly,
|
|
19
20
|
submitting,
|
|
20
21
|
error,
|
|
21
22
|
clearError,
|
|
@@ -48,7 +49,11 @@ export const NewResource: React.FC<NewResourceProps> = () => {
|
|
|
48
49
|
contentContainerClassName="grow"
|
|
49
50
|
className="pb-12"
|
|
50
51
|
>
|
|
51
|
-
<ResourceForm
|
|
52
|
+
<ResourceForm
|
|
53
|
+
postData={postData}
|
|
54
|
+
onChange={setPostData}
|
|
55
|
+
groupOnly={groupOnly}
|
|
56
|
+
/>
|
|
52
57
|
</KeyboardAwareScrollView>
|
|
53
58
|
</ThemedView>
|
|
54
59
|
);
|
|
@@ -10,7 +10,7 @@ import Toast from 'react-native-toast-message';
|
|
|
10
10
|
import { Button } from '../../components/ui/button';
|
|
11
11
|
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
|
|
12
12
|
import { Account } from '@openpeepshq/common';
|
|
13
|
-
import { View } from 'react-native';
|
|
13
|
+
import { ActivityIndicator, View } from 'react-native';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
|
|
16
16
|
type AccountSettingsProps = MainScreenProps<'AccountSettings'>;
|
|
@@ -22,7 +22,7 @@ type AccountFormValues = {
|
|
|
22
22
|
confirmPassword: string | undefined;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export const AccountSettings: React.FC<AccountSettingsProps> = (
|
|
25
|
+
export const AccountSettings: React.FC<AccountSettingsProps> = () => {
|
|
26
26
|
const { openpeepsApi, queryClient } = useOpenpeeps();
|
|
27
27
|
const { data: currentAccount } = openpeepsApi.useCurrentAccount();
|
|
28
28
|
const logout = openpeepsApi.logoutAction();
|
|
@@ -31,7 +31,9 @@ export const AccountSettings: React.FC<AccountSettingsProps> = ({}) => {
|
|
|
31
31
|
const [isConfirmPasswordVisible, setIsConfirmPasswordVisible] =
|
|
32
32
|
React.useState(false);
|
|
33
33
|
const updateCurrentAccount = openpeepsApi.updateCurrentAccountAction();
|
|
34
|
+
const validateEmail = openpeepsApi.validationEmailAction();
|
|
34
35
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
36
|
+
const [verifying, setVerifying] = useState(false);
|
|
35
37
|
const { t } = useTranslation();
|
|
36
38
|
|
|
37
39
|
const form = useForm<AccountFormValues>({
|
|
@@ -116,6 +118,28 @@ export const AccountSettings: React.FC<AccountSettingsProps> = ({}) => {
|
|
|
116
118
|
setIsSubmitting(false);
|
|
117
119
|
});
|
|
118
120
|
};
|
|
121
|
+
const handleVerifyEmail = async () => {
|
|
122
|
+
setVerifying(true);
|
|
123
|
+
try {
|
|
124
|
+
await validateEmail();
|
|
125
|
+
Toast.show({
|
|
126
|
+
type: 'success',
|
|
127
|
+
text1: t('settings.account.verifyEmailSent', {
|
|
128
|
+
defaultValue: 'Verification email sent',
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
131
|
+
} catch {
|
|
132
|
+
Toast.show({
|
|
133
|
+
type: 'error',
|
|
134
|
+
text1: t('settings.account.verifyEmailError', {
|
|
135
|
+
defaultValue: 'Failed to send verification email',
|
|
136
|
+
}),
|
|
137
|
+
});
|
|
138
|
+
} finally {
|
|
139
|
+
setVerifying(false);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
119
143
|
const handleSubmit = async () => {
|
|
120
144
|
const values = form.getValues();
|
|
121
145
|
await onSubmit(values);
|
|
@@ -165,6 +189,26 @@ export const AccountSettings: React.FC<AccountSettingsProps> = ({}) => {
|
|
|
165
189
|
)}
|
|
166
190
|
/>
|
|
167
191
|
</View>
|
|
192
|
+
{!(currentAccount as Account)?.emailValidated ? (
|
|
193
|
+
<View className="w-full gap-y-2">
|
|
194
|
+
<ThemedText className="text-sm text-muted-foreground">
|
|
195
|
+
{t('settings.account.verifyEmailDescription')}
|
|
196
|
+
</ThemedText>
|
|
197
|
+
<Button
|
|
198
|
+
variant="outline"
|
|
199
|
+
onPress={() => void handleVerifyEmail()}
|
|
200
|
+
disabled={verifying}
|
|
201
|
+
>
|
|
202
|
+
{verifying ? (
|
|
203
|
+
<ActivityIndicator size={16} />
|
|
204
|
+
) : (
|
|
205
|
+
<ThemedText className="text-sm">
|
|
206
|
+
{t('settings.account.verifyEmailButton')}
|
|
207
|
+
</ThemedText>
|
|
208
|
+
)}
|
|
209
|
+
</Button>
|
|
210
|
+
</View>
|
|
211
|
+
) : null}
|
|
168
212
|
|
|
169
213
|
<View className="relative w-full">
|
|
170
214
|
<Button
|
|
@@ -15,10 +15,9 @@ import { ConfigMenuButton } from '../../components/configuration/index';
|
|
|
15
15
|
import { useSetPageHeader } from '../../components/layout';
|
|
16
16
|
import { ThemedView } from '../../components/ui/themed-view';
|
|
17
17
|
|
|
18
|
-
export const Settings = (
|
|
19
|
-
TabStackParamList,
|
|
20
|
-
|
|
21
|
-
>) => {
|
|
18
|
+
export const Settings = (
|
|
19
|
+
_: NativeStackScreenProps<TabStackParamList, 'Settings'>
|
|
20
|
+
) => {
|
|
22
21
|
const profile = useCurrentProfile();
|
|
23
22
|
const { t } = useTranslation();
|
|
24
23
|
const navigation =
|
|
@@ -28,9 +28,9 @@ const notificationTypeDefaults: Record<
|
|
|
28
28
|
|
|
29
29
|
type NotificationsSettingsProps = MainScreenProps<'NotificationsSettings'>;
|
|
30
30
|
|
|
31
|
-
export const NotificationPreferences: React.FC<
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
export const NotificationPreferences: React.FC<NotificationsSettingsProps> = (
|
|
32
|
+
_props
|
|
33
|
+
) => {
|
|
34
34
|
const { t } = useTranslation();
|
|
35
35
|
const { types } = useNotificationPreferences();
|
|
36
36
|
|
|
@@ -16,7 +16,7 @@ import { toAbsoluteMediaUrl } from '../../lib/media-url';
|
|
|
16
16
|
|
|
17
17
|
type ThemeSettingsProps = MainScreenProps<'ThemeSettings'>;
|
|
18
18
|
|
|
19
|
-
export const ThemeSettings: React.FC<ThemeSettingsProps> = (
|
|
19
|
+
export const ThemeSettings: React.FC<ThemeSettingsProps> = () => {
|
|
20
20
|
const { theme, setTheme, submitting, save } = useThemePreference();
|
|
21
21
|
const serverInfo = useServerInfo();
|
|
22
22
|
const { refresh } = useOpenPeepsTheme();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { LucideIcon } from 'lucide-react-native';
|
|
2
|
-
import { cssInterop } from 'nativewind';
|
|
3
|
-
export const iconWithClassName = (icon: LucideIcon) =>
|
|
4
|
-
cssInterop(icon, {
|
|
5
|
-
className: {
|
|
6
|
-
target: 'style',
|
|
7
|
-
nativeStyleToProp: {
|
|
8
|
-
color: true,
|
|
9
|
-
opacity: true,
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
});
|