@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.
Files changed (73) hide show
  1. package/README.md +1 -1
  2. package/package.json +11 -6
  3. package/src/components/custom/modals/media/audio-picker-sheet.tsx +21 -25
  4. package/src/components/custom/modals/media/document-picker-sheet.tsx +22 -16
  5. package/src/components/custom/modals/media/video-picker-sheet.tsx +4 -2
  6. package/src/components/custom/navigation/side-menu.tsx +59 -11
  7. package/src/components/icons/iconWithClassName.tsx +21 -0
  8. package/src/components/jams/JamActionsFooter.tsx +8 -2
  9. package/src/components/jams/JamCapacityGate.tsx +1 -1
  10. package/src/components/jams/JamCard.tsx +8 -4
  11. package/src/components/jams/JamConference.tsx +6 -1
  12. package/src/components/jams/JamParticipantConference.tsx +2 -0
  13. package/src/components/jams/JamRoom.tsx +2 -3
  14. package/src/components/jams/LiveJamsSection.tsx +12 -1
  15. package/src/components/jams/LivekitUnavailableNotice.tsx +25 -0
  16. package/src/components/jams/index.ts +1 -0
  17. package/src/components/markdown/MarkdownOverlay.tsx +75 -0
  18. package/src/components/markdown/OpenpeepsMarkdown.tsx +3 -1
  19. package/src/components/markdown/extensions/link.tsx +34 -0
  20. package/src/components/markdown/index.ts +2 -0
  21. package/src/components/navigation/tab-navigator.tsx +39 -17
  22. package/src/components/notifications/NotificationItem.tsx +27 -2
  23. package/src/components/notifications/types/JamStarted.tsx +13 -3
  24. package/src/components/notifications/types/Reply.tsx +1 -5
  25. package/src/components/notifications/types/WaitlistOffer.tsx +61 -0
  26. package/src/components/notifications/types/index.ts +1 -0
  27. package/src/components/post/CompactReplyParent.tsx +16 -15
  28. package/src/components/post/TruncatedMarkdown.tsx +60 -0
  29. package/src/components/post/helpers.ts +2 -2
  30. package/src/components/post/index.ts +2 -0
  31. package/src/components/post/pieces/EventRsvpButton.tsx +99 -5
  32. package/src/components/post/pieces/EventRsvpList.tsx +46 -0
  33. package/src/components/post/pieces/EventRsvpScopeDialog.tsx +30 -19
  34. package/src/components/post/pieces/EventWaitlistJoinDialog.tsx +62 -0
  35. package/src/components/post/pieces/PollContent.tsx +7 -7
  36. package/src/components/post/pieces/PostActions.tsx +89 -23
  37. package/src/components/post/pieces/ShareMenu.tsx +2 -2
  38. package/src/components/post/post-form/DescriptionEditModal.tsx +1 -0
  39. package/src/components/post/post-form/EventForm.tsx +50 -10
  40. package/src/components/post/post-form/ResourceForm.tsx +131 -8
  41. package/src/components/post/types/Article.tsx +6 -2
  42. package/src/components/post/types/Poll.tsx +4 -1
  43. package/src/components/post/types/event/CardEvent.tsx +101 -76
  44. package/src/components/post/types/event/FullEvent.tsx +60 -23
  45. package/src/components/post/types/event/ProfileEventRelationship.tsx +2 -0
  46. package/src/components/post/types/resource/FullResource.tsx +9 -1
  47. package/src/components/preview-link/LocalPreviewLink.tsx +4 -1
  48. package/src/components/preview-link/helpers.ts +5 -1
  49. package/src/components/preview-link/index.ts +1 -0
  50. package/src/components/preview-link/local/WelcomePreview.tsx +59 -0
  51. package/src/components/profile/Avatar.tsx +0 -1
  52. package/src/components/profile/EditProfileForm.tsx +23 -2
  53. package/src/components/profile/ProfileSheet.tsx +1 -1
  54. package/src/components/resources/ResourceCard.tsx +62 -14
  55. package/src/components/resources/ResourceLibrary.tsx +2 -2
  56. package/src/components/ui/badge.tsx +2 -3
  57. package/src/components/ui/bottom-sheet.tsx +0 -6
  58. package/src/components/ui/popup-menu-button.tsx +2 -2
  59. package/src/components/ui/popup-menu-separator.tsx +1 -1
  60. package/src/components/ui/popup-menu.tsx +2 -2
  61. package/src/lib/utils.ts +10 -3
  62. package/src/pages/auth/Register.tsx +34 -4
  63. package/src/pages/conversations/Show.tsx +38 -7
  64. package/src/pages/feeds/Bookmarks.tsx +1 -1
  65. package/src/pages/jams/Index.tsx +6 -4
  66. package/src/pages/posts/New.tsx +1 -1
  67. package/src/pages/resources/Edit.tsx +2 -1
  68. package/src/pages/resources/New.tsx +6 -1
  69. package/src/pages/settings/Account.tsx +46 -2
  70. package/src/pages/settings/Index.tsx +3 -4
  71. package/src/pages/settings/NotificationPreferences.tsx +3 -3
  72. package/src/pages/settings/Theme.tsx +1 -1
  73. 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 postData={postData} onChange={setPostData} />
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 = ({}: NativeStackScreenProps<
19
- TabStackParamList,
20
- 'Settings'
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
- NotificationsSettingsProps
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
- });