@openpeepshq/rn-components 0.3.6 → 0.3.8

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 (46) hide show
  1. package/package.json +1 -1
  2. package/src/components/custom/common/empty-state-container.tsx +42 -114
  3. package/src/components/custom/common/index.ts +1 -0
  4. package/src/components/custom/common/plus-fab.tsx +23 -0
  5. package/src/components/custom/headers/tab-screens-header.tsx +3 -4
  6. package/src/components/custom/navigation/side-menu.tsx +40 -78
  7. package/src/components/icons/index.ts +6 -0
  8. package/src/components/jams/CreateNewJam.tsx +3 -4
  9. package/src/components/navigation/auth-wrapper.tsx +1 -1
  10. package/src/components/notifications/NotificationItem.tsx +1 -1
  11. package/src/components/notifications/NotificationsList.tsx +5 -1
  12. package/src/components/post/Feed.tsx +3 -1
  13. package/src/components/post/FeedPost.tsx +32 -37
  14. package/src/components/post/FeedPostContent.tsx +6 -8
  15. package/src/components/post/NewEventButton.tsx +3 -8
  16. package/src/components/post/NewNoteButton.tsx +3 -5
  17. package/src/components/post/feed/events/EventsFeed.tsx +1 -0
  18. package/src/components/post/pieces/PostActions.tsx +46 -121
  19. package/src/components/post/pieces/PostInfoHeader.tsx +9 -5
  20. package/src/components/post/post-form/Footer.tsx +47 -64
  21. package/src/components/post/post-form/OpenpeepsMarkdownInput.tsx +3 -0
  22. package/src/components/post/post-form/PollComposerFields.tsx +2 -2
  23. package/src/components/post/post-form/PostForm.tsx +133 -129
  24. package/src/components/post/types/Note.tsx +1 -1
  25. package/src/components/post/types/Poll.tsx +1 -1
  26. package/src/components/post/types/article/CardArticle.tsx +1 -1
  27. package/src/components/post/types/event/CardEvent.tsx +1 -1
  28. package/src/components/post/types/event/FullEvent.tsx +21 -20
  29. package/src/components/profile/ProfileCard.tsx +1 -1
  30. package/src/components/profile/ProfileHeader.tsx +8 -10
  31. package/src/pages/Explore.tsx +30 -5
  32. package/src/pages/Members.tsx +2 -2
  33. package/src/pages/Tags.tsx +8 -2
  34. package/src/pages/articles/Index.tsx +18 -2
  35. package/src/pages/conversations/Index.tsx +21 -4
  36. package/src/pages/conversations/New.tsx +8 -1
  37. package/src/pages/feeds/Local.tsx +8 -2
  38. package/src/pages/feeds/My.tsx +13 -3
  39. package/src/pages/groups/Index.tsx +23 -1
  40. package/src/pages/groups/Info.tsx +4 -4
  41. package/src/pages/groups/Show.tsx +42 -3
  42. package/src/pages/posts/Edit.tsx +43 -5
  43. package/src/pages/posts/New.tsx +121 -74
  44. package/src/pages/posts/Reply.tsx +77 -49
  45. package/src/pages/profile/Followers.tsx +4 -1
  46. package/src/pages/profile/Following.tsx +4 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openpeepshq/rn-components",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "React Native community screens and shared UI (extracted from the Black Ambition app) for the OpenPeeps stack.",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./src/index.ts",
@@ -1,5 +1,6 @@
1
1
  import { View } from 'react-native';
2
2
  import React from 'react';
3
+ import { useTranslation } from 'react-i18next';
3
4
  import { ThemedText } from '../../ui/themed-text';
4
5
  import {
5
6
  BellOffIcon,
@@ -10,121 +11,48 @@ import {
10
11
  UserRoundXIcon,
11
12
  } from '../../icons/index';
12
13
  import { EmptyStateContainerType } from '../../../types';
14
+
13
15
  interface EmptyStateContainerProps {
14
16
  type: EmptyStateContainerType;
17
+ copyKey: string;
18
+ defaultValue?: string;
15
19
  }
16
- export const EmptyStateContainer = ({ type }: EmptyStateContainerProps) => {
17
- switch (type) {
18
- case 'posts':
19
- return (
20
- <View className="flex flex-1 h-64 items-center justify-center">
21
- <RssIcon size={64} className="text-foreground" />
22
- <ThemedText className="mt-6">No posts yet</ThemedText>
23
- </View>
24
- );
25
- case 'reply':
26
- return (
27
- <View className="flex flex-1 h-64 items-center justify-center">
28
- <RssIcon size={64} className="text-foreground" />
29
- <ThemedText className="mt-6">No replies yet</ThemedText>
30
- </View>
31
- );
32
- case 'events':
33
- return (
34
- <View className="flex flex-1 h-64 items-center justify-center">
35
- <CalendarXIcon size={64} className="text-foreground" />
36
- <ThemedText className="mt-6">No events yet</ThemedText>
37
- </View>
38
- );
39
- case 'groups':
40
- return (
41
- <View className="flex flex-1 h-64 items-center justify-center">
42
- <UserRoundXIcon size={64} className="text-foreground" />
43
- <ThemedText className="mt-6">No Groups Found</ThemedText>
44
- </View>
45
- );
46
- case 'profiles':
47
- return (
48
- <View className="flex flex-1 h-64 items-center justify-center">
49
- <UserRoundXIcon size={64} className="text-foreground" />
50
- <ThemedText className="mt-6">No Profile Found</ThemedText>
51
- </View>
52
- );
53
- case 'followers':
54
- return (
55
- <View className="flex flex-1 h-64 items-center justify-center">
56
- <UserRoundXIcon size={64} className="text-foreground" />
57
- <ThemedText className="mt-6">No followers yet</ThemedText>
58
- </View>
59
- );
60
- case 'following':
61
- return (
62
- <View className="flex flex-1 h-64 items-center justify-center">
63
- <UserRoundXIcon size={64} className="text-foreground" />
64
- <ThemedText className="mt-6">No followings yet</ThemedText>
65
- </View>
66
- );
67
- case 'messages':
68
- return (
69
- <View className="flex flex-1 h-64 items-center justify-center">
70
- <MessageSquareOffIcon size={64} className="text-foreground" />
71
- <ThemedText className="mt-6">No conversations here</ThemedText>
72
- </View>
73
- );
74
- case 'notifications':
75
- return (
76
- <View className="flex flex-1 h-64 items-center justify-center">
77
- <BellOffIcon size={64} className="text-foreground" />
78
- <ThemedText className="mt-6">No Notifications yet</ThemedText>
79
- </View>
80
- );
81
- case 'live-jams':
82
- return (
83
- <View className="flex flex-1 h-64 items-center justify-center">
84
- <PhoneOffIcon size={64} className="text-foreground" />
85
- <ThemedText className="mt-6">No live jam to join yet</ThemedText>
86
- </View>
87
- );
88
- case 'upcoming-jams':
89
- return (
90
- <View className="flex flex-1 h-64 items-center justify-center">
91
- <PhoneOffIcon size={64} className="text-foreground" />
92
- <ThemedText className="mt-6">No upcoming jams yet</ThemedText>
93
- </View>
94
- );
95
- case 'my-jams':
96
- return (
97
- <View className="flex flex-1 h-64 items-center justify-center">
98
- <PhoneOffIcon size={64} className="text-foreground" />
99
- <ThemedText className="mt-6">No jams yet</ThemedText>
100
- </View>
101
- );
102
- case 'recorded-jams':
103
- return (
104
- <View className="flex flex-1 h-64 items-center justify-center">
105
- <PhoneOffIcon size={64} className="text-foreground" />
106
- <ThemedText className="mt-6">No jams yet</ThemedText>
107
- </View>
108
- );
109
- case 'event-attendees':
110
- return (
111
- <View className="flex flex-1 h-64 items-center justify-center">
112
- <UserRoundXIcon size={64} className="text-foreground" />
113
- <ThemedText className="mt-6">No attendees yet</ThemedText>
114
- </View>
115
- );
116
- case 'event-description':
117
- return (
118
- <View className="flex flex-1 h-64 items-center justify-center">
119
- <RssIcon size={64} className="text-foreground" />
120
- <ThemedText className="mt-6">No description added</ThemedText>
121
- </View>
122
- );
123
- default:
124
- return (
125
- <View className="flex flex-1 h-64 items-center justify-center">
126
- <ThemedText className="mt-6">Empty State Container</ThemedText>
127
- </View>
128
- );
129
- }
20
+
21
+ export const EmptyStateContainer = ({
22
+ type,
23
+ copyKey,
24
+ defaultValue,
25
+ }: EmptyStateContainerProps) => {
26
+ const { t } = useTranslation();
27
+ const iconClass = 'text-muted-foreground';
28
+ const icon =
29
+ type === 'events' ? (
30
+ <CalendarXIcon size={80} className={iconClass} />
31
+ ) : type === 'messages' ? (
32
+ <MessageSquareOffIcon size={80} className={iconClass} />
33
+ ) : type === 'notifications' ? (
34
+ <BellOffIcon size={80} className={iconClass} />
35
+ ) : type === 'live-jams' ||
36
+ type === 'upcoming-jams' ||
37
+ type === 'my-jams' ||
38
+ type === 'recorded-jams' ? (
39
+ <PhoneOffIcon size={80} className={iconClass} />
40
+ ) : type === 'groups' ||
41
+ type === 'profiles' ||
42
+ type === 'followers' ||
43
+ type === 'following' ||
44
+ type === 'event-attendees' ? (
45
+ <UserRoundXIcon size={80} className={iconClass} />
46
+ ) : (
47
+ <RssIcon size={80} className={iconClass} />
48
+ );
49
+
50
+ return (
51
+ <View className="h-96 w-full flex-col items-center justify-center gap-y-4 bg-surface">
52
+ {icon}
53
+ <ThemedText className="text-xl">
54
+ {t(copyKey, defaultValue ? { defaultValue } : undefined)}
55
+ </ThemedText>
56
+ </View>
57
+ );
130
58
  };
@@ -8,5 +8,6 @@ export * from './infinite-scroll-container';
8
8
  export * from './Loader';
9
9
  export * from './media-upload-progress';
10
10
  export * from './participant-avatar';
11
+ export * from './plus-fab';
11
12
  export * from './popover';
12
13
  export * from './select';
@@ -0,0 +1,23 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import { Pressable } from 'react-native';
3
+
4
+ interface PlusFabProps {
5
+ accessibilityLabel: string;
6
+ onPress: () => void;
7
+ children: ReactNode;
8
+ }
9
+
10
+ export const PlusFab = ({
11
+ accessibilityLabel,
12
+ onPress,
13
+ children,
14
+ }: PlusFabProps) => (
15
+ <Pressable
16
+ accessibilityRole="button"
17
+ accessibilityLabel={accessibilityLabel}
18
+ onPress={onPress}
19
+ className="absolute bottom-10 right-6 z-20 size-16 items-center justify-center rounded-full bg-foreground"
20
+ >
21
+ {children}
22
+ </Pressable>
23
+ );
@@ -11,8 +11,7 @@ import {
11
11
  import { ThemedText } from '../../ui/themed-text';
12
12
  import { Avatar, AvatarImage, AvatarFallback } from '../../ui/avatar';
13
13
  import { Button } from '../../ui/button';
14
- import { BellIcon } from '../../icons/index';
15
- import { User } from 'lucide-react-native';
14
+ import { BellIcon, UserIcon } from '../../icons/index';
16
15
  import { useDrawer } from '../../../contexts/drawer-context';
17
16
  import { formatBadgeCount } from '@openpeepshq/common';
18
17
  import { useOpenpeeps } from '@openpeepshq/react';
@@ -104,7 +103,7 @@ export const TabScreensHeader = ({
104
103
  <SafeAreaView edges={['top']} className="">
105
104
  {!isProduction && (
106
105
  <View className="mb-2 w-full rounded-lg bg-white/50 p-2">
107
- <ThemedText className="text-center text-red-500">
106
+ <ThemedText className="text-center text-destructive">
108
107
  Test Backend ({BASE_URL})
109
108
  </ThemedText>
110
109
  </View>
@@ -125,7 +124,7 @@ export const TabScreensHeader = ({
125
124
  <AvatarImage source={{ uri: currentProfile.avatar }} />
126
125
  ) : (
127
126
  <AvatarFallback className="h-6 w-6 -bottom-2 -right-2 bg-black">
128
- <User size={20} color="#a3a5aaff" />
127
+ <UserIcon size={20} className="text-muted-foreground" />
129
128
  </AvatarFallback>
130
129
  )}
131
130
  </Avatar>
@@ -5,87 +5,47 @@ import { Image, TouchableOpacity, View } from 'react-native';
5
5
  import { Button } from '../../ui/button';
6
6
  import {
7
7
  BellIcon,
8
- BookTextIcon,
9
- CalendarIcon,
10
- DoorOpenIcon,
8
+ BookCheckIcon,
9
+ BookmarkIcon,
10
+ BookUserIcon,
11
+ CalendarDaysIcon,
11
12
  HomeIcon,
12
13
  LogOutIcon,
13
14
  MessageSquareTextIcon,
14
15
  NewspaperIcon,
15
16
  PhoneCallIcon,
17
+ ScrollTextIcon,
18
+ SearchIcon,
16
19
  SettingsIcon,
20
+ SquarePenIcon,
17
21
  UsersIcon,
18
22
  XIcon,
19
- SearchIcon,
20
- ScrollTextIcon,
21
- BookmarkIcon,
22
23
  } from '../../icons/index';
23
24
  import { ThemedText } from '../../ui/themed-text';
24
25
  import { useWindowSize } from '../../../hooks/helper';
25
26
  import { useAppImagesStore } from '../../../stores/useAppImagesStore';
26
27
  import { formatBadgeCount } from '@openpeepshq/common';
27
- import { useOpenpeeps } from '@openpeepshq/react';
28
- import { LucideProps, SquarePenIcon } from 'lucide-react-native';
28
+ import { buildMainNavItems, useOpenpeeps } from '@openpeepshq/react';
29
29
  import { useTranslation } from 'react-i18next';
30
30
  import { ProfileAvatar } from '../../profile/Avatar';
31
31
  import type { GotoHandlerParams } from '../../../types/goto';
32
+ import type { LucideProps } from 'lucide-react-native';
32
33
 
33
- type MenuItem = {
34
- icon: React.ComponentType<LucideProps>;
35
- target: string;
34
+ const menuIcons: Record<string, React.ComponentType<LucideProps>> = {
35
+ community: HomeIcon,
36
+ welcome: BookCheckIcon,
37
+ explore: SearchIcon,
38
+ myFeed: NewspaperIcon,
39
+ jams: PhoneCallIcon,
40
+ groups: UsersIcon,
41
+ events: CalendarDaysIcon,
42
+ articles: ScrollTextIcon,
43
+ messages: MessageSquareTextIcon,
44
+ members: BookUserIcon,
45
+ bookmarks: BookmarkIcon,
46
+ settings: SettingsIcon,
36
47
  };
37
48
 
38
- const menuItems: MenuItem[] = [
39
- {
40
- icon: HomeIcon,
41
- target: 'community',
42
- },
43
- {
44
- icon: SearchIcon,
45
- target: 'explore',
46
- },
47
- {
48
- icon: NewspaperIcon,
49
- target: 'myFeed',
50
- },
51
- {
52
- icon: DoorOpenIcon,
53
- target: 'welcome',
54
- },
55
- {
56
- icon: PhoneCallIcon,
57
- target: 'jams',
58
- },
59
- {
60
- icon: UsersIcon,
61
- target: 'groups',
62
- },
63
- {
64
- icon: CalendarIcon,
65
- target: 'events',
66
- },
67
- {
68
- icon: ScrollTextIcon,
69
- target: 'articles',
70
- },
71
- {
72
- icon: MessageSquareTextIcon,
73
- target: 'messages',
74
- },
75
- {
76
- icon: BookmarkIcon,
77
- target: 'bookmarks',
78
- },
79
- {
80
- icon: BookTextIcon,
81
- target: 'members',
82
- },
83
- {
84
- icon: SettingsIcon,
85
- target: 'settings',
86
- },
87
- ];
88
-
89
49
  interface SideMenuProps {
90
50
  handleNavigation: ({
91
51
  target,
@@ -126,6 +86,11 @@ export const SideMenu = ({
126
86
  messages: unreadConversationThreads,
127
87
  };
128
88
 
89
+ const menuItems = buildMainNavItems({
90
+ jamsEnabled: !!serverInfo?.jams.livekit.enabled,
91
+ showAdmin: false,
92
+ });
93
+
129
94
  const { t } = useTranslation();
130
95
 
131
96
  const [currentRoute, setCurrentRoute] = React.useState<string | undefined>(
@@ -136,7 +101,6 @@ export const SideMenu = ({
136
101
  (currentProfile && (
137
102
  <View className="sm:w-56 md:w-80 bg-background flex-1">
138
103
  <TouchableOpacity onPress={onProfilePress} className="mt-12 mb-6 px-4">
139
- {/* Header: Logo + Avatar + Name */}
140
104
  <View className="w-full flex-row items-center justify-between">
141
105
  <Image
142
106
  source={{ uri: logoSmall! }}
@@ -182,29 +146,28 @@ export const SideMenu = ({
182
146
  className="flex-row gap-4 items-center text-black mb-4 justify-center px-4 w-full"
183
147
  >
184
148
  <SquarePenIcon size={20} />
185
- <ThemedText>New Post</ThemedText>
149
+ <ThemedText>{t('posts.form.title')}</ThemedText>
186
150
  </Button>
187
151
  )}
188
152
 
189
153
  <Separator />
190
154
 
191
- {/* Scrollable Content */}
192
155
  <View className="flex-1">
193
156
  <ScrollView contentContainerClassName="grow" className="mt-5 px-4">
194
- {menuItems.map((item, index) => {
195
- const isActive = currentRoute === item.target;
196
- const Icon = item.icon;
197
- if (!serverInfo?.jams.livekit.enabled && item.target === 'jams') {
157
+ {menuItems.map((item) => {
158
+ const isActive = currentRoute === item.id;
159
+ const Icon = menuIcons[item.id];
160
+ if (!Icon) {
198
161
  return null;
199
162
  }
200
163
  return (
201
164
  <Button
202
- key={`drawer-${index}`}
165
+ key={item.id}
203
166
  variant="ghost"
204
167
  className="flex-row items-center w-full mb-4 justify-start p-4"
205
168
  onPress={() => {
206
- setCurrentRoute(item.target);
207
- handleNavigation({ target: item.target });
169
+ setCurrentRoute(item.id);
170
+ handleNavigation({ target: item.id });
208
171
  }}
209
172
  >
210
173
  <View className="flex-row items-center flex-1 justify-between">
@@ -220,13 +183,13 @@ export const SideMenu = ({
220
183
  className={`
221
184
  ${isActive ? 'text-foreground' : 'text-muted-foreground'}`}
222
185
  >
223
- {t(`navigation.${item.target}`)}
186
+ {t(item.labelKey)}
224
187
  </ThemedText>
225
188
  </View>
226
- {(menuUnreadCounts[item.target] ?? 0) > 0 ? (
189
+ {(menuUnreadCounts[item.id] ?? 0) > 0 ? (
227
190
  <View className="bg-destructive size-5 min-w-5 items-center justify-center rounded-full px-1">
228
191
  <ThemedText className="text-xs font-semibold text-destructive-foreground">
229
- {formatBadgeCount(menuUnreadCounts[item.target] ?? 0)}
192
+ {formatBadgeCount(menuUnreadCounts[item.id] ?? 0)}
230
193
  </ThemedText>
231
194
  </View>
232
195
  ) : null}
@@ -242,15 +205,14 @@ export const SideMenu = ({
242
205
  close?.();
243
206
  }}
244
207
  >
245
- <LogOutIcon size={20} className="text-red-700 mr-5" />
246
- <ThemedText className="text-red-700 native:text-lg tracking-wider -mt-1">
208
+ <LogOutIcon size={20} className="mr-5 text-destructive" />
209
+ <ThemedText className="-mt-1 tracking-wider text-destructive native:text-lg">
247
210
  {t('navigation.logOut')}
248
211
  </ThemedText>
249
212
  </Button>
250
213
  </ScrollView>
251
214
  </View>
252
215
 
253
- {/* Footer */}
254
216
  <Separator />
255
217
  <View className="pl-6 pr-4 pt-4 pb-12">
256
218
  <ThemedText className="text-muted-foreground text-base tracking-wider">
@@ -31,7 +31,10 @@ import {
31
31
  User,
32
32
  MessageSquareText,
33
33
  Settings,
34
+ BookCheck,
34
35
  BookText,
36
+ BookUser,
37
+ FilePlus,
35
38
  LogOut,
36
39
  Heart,
37
40
  MessageSquare,
@@ -158,7 +161,10 @@ export const SquarePlusIcon = iconWithClassName(SquarePlus);
158
161
  export const XIcon = iconWithClassName(X);
159
162
  export const EllipsisIcon = iconWithClassName(Ellipsis);
160
163
  export const DotIcon = iconWithClassName(Dot);
164
+ export const BookCheckIcon = iconWithClassName(BookCheck);
161
165
  export const BookTextIcon = iconWithClassName(BookText);
166
+ export const BookUserIcon = iconWithClassName(BookUser);
167
+ export const FilePlusIcon = iconWithClassName(FilePlus);
162
168
  export const LogOutIcon = iconWithClassName(LogOut);
163
169
  export const HeartIcon = iconWithClassName(Heart);
164
170
  export const CornerUpLeftIcon = iconWithClassName(CornerUpLeft);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { Pressable } from 'react-native';
3
2
  import { useTranslation } from 'react-i18next';
3
+ import { PlusFab } from '../custom/common/plus-fab';
4
4
  import { PhoneCallIcon } from '../icons/index';
5
5
  import { useCreateNewJam } from './CreateNewJamContext';
6
6
 
@@ -9,12 +9,11 @@ export const CreateNewJam = () => {
9
9
  const { openCreateJam } = useCreateNewJam();
10
10
 
11
11
  return (
12
- <Pressable
12
+ <PlusFab
13
13
  accessibilityLabel={t('jams.create.title')}
14
14
  onPress={openCreateJam}
15
- className="z-20 absolute bottom-10 right-6 size-16 flex items-center justify-center bg-foreground rounded-full"
16
15
  >
17
16
  <PhoneCallIcon size={24} className="text-background" />
18
- </Pressable>
17
+ </PlusFab>
19
18
  );
20
19
  };
@@ -13,7 +13,7 @@ import { toAbsoluteMediaUrl } from '../../lib/media-url';
13
13
  const DevBanner = () =>
14
14
  (!isProduction && (
15
15
  <View className="absolute bg-white/80 z-10 ml-8 mr-8 w-auto top-64 p-4 rounded-lg">
16
- <ThemedText className="text-red-800 text-center">
16
+ <ThemedText className="text-center text-destructive">
17
17
  Test Backend ({BASE_URL})
18
18
  </ThemedText>
19
19
  </View>
@@ -64,7 +64,7 @@ export const NotificationItem: React.FC<NotificationComponentProps> = ({
64
64
  if (!NotificationToRender) {
65
65
  return (
66
66
  <View className="p-4">
67
- <ThemedText className="text-red-500 font-bold">
67
+ <ThemedText className="font-bold text-destructive">
68
68
  Unknown notification type: {notification.type}
69
69
  </ThemedText>
70
70
  </View>
@@ -61,7 +61,11 @@ export const NotificationsList = ({
61
61
  {query.isFetchingNextPage && <ActivityIndicator size={'small'} />}
62
62
  </>
63
63
  ) : (
64
- <EmptyStateContainer type="notifications" />
64
+ <EmptyStateContainer
65
+ type="notifications"
66
+ copyKey="notification.empty"
67
+ defaultValue="No notifications"
68
+ />
65
69
  )}
66
70
  </>
67
71
  )}
@@ -82,7 +82,9 @@ export const Feed = ({
82
82
  );
83
83
  })}
84
84
  </View>
85
- {allPosts.length === 0 && <EmptyStateContainer type={type} />}
85
+ {allPosts.length === 0 && !pinnedPostId && (
86
+ <EmptyStateContainer type={type} copyKey="feed.empty" />
87
+ )}
86
88
  {query.isFetchingNextPage && <CustomLoader page="community" />}
87
89
  </>
88
90
  )}
@@ -2,6 +2,7 @@ import { type PublicPost } from '@openpeepshq/common';
2
2
  import { useFeedPostPresentation } from '@openpeepshq/react';
3
3
  import { useNavigation } from '@react-navigation/native';
4
4
  import { NativeStackNavigationProp } from '@react-navigation/native-stack';
5
+ import { Pressable } from 'react-native';
5
6
  import { MainStackParamList } from '../navigation/types/index';
6
7
  import {
7
8
  PostInfoHeader,
@@ -73,45 +74,39 @@ export const FeedPost = ({
73
74
  }
74
75
 
75
76
  return (
76
- <ThemedView
77
- ref={postViewRef}
78
- className="relative py-5 border-b border-border"
79
- >
80
- <UnreadPostIndicator show={isUnread} />
81
- {hasReactionHeader && (
82
- <PostReactionHeader
83
- post={post}
84
- inGroup={inGroup}
85
- hideReply={hideReply}
86
- previewMode={previewMode}
87
- />
88
- )}
89
- {showsReplyTo && displayedPost.replyTo ? (
90
- <CompactReplyParent post={displayedPost.replyTo as PublicPost} />
91
- ) : null}
77
+ <Pressable disabled={previewMode} onPress={handlePostPress}>
78
+ <ThemedView
79
+ ref={postViewRef}
80
+ className="relative border-b border-border p-4"
81
+ >
82
+ <UnreadPostIndicator show={isUnread} />
83
+ {hasReactionHeader && (
84
+ <PostReactionHeader
85
+ post={post}
86
+ inGroup={inGroup}
87
+ hideReply={hideReply}
88
+ previewMode={previewMode}
89
+ />
90
+ )}
91
+ {showsReplyTo && displayedPost.replyTo ? (
92
+ <CompactReplyParent post={displayedPost.replyTo as PublicPost} />
93
+ ) : null}
92
94
 
93
- <PostInfoHeader
94
- post={displayedPost}
95
- showMenu={!post.repost && !post.inReplyToId && !previewMode && showMenu}
96
- deleteCallback={deleteCallback}
97
- />
95
+ <PostInfoHeader
96
+ post={displayedPost}
97
+ showMenu={!hasReactionHeader && !previewMode && showMenu}
98
+ deleteCallback={deleteCallback}
99
+ />
98
100
 
99
- <ThemedView className="px-5">
100
- {content ?? <FeedPostContent post={displayedPost} />}
101
- </ThemedView>
102
- {hasStats && (
103
- <ThemedView className="px-5">
104
- <FeedPostStats post={displayedPost} />
101
+ <ThemedView>
102
+ {content ?? <FeedPostContent post={displayedPost} />}
105
103
  </ThemedView>
106
- )}
107
- <PostActions
108
- post={displayedPost}
109
- previewMode={previewMode}
110
- onPostPress={handlePostPress}
111
- />
112
- {!hideReply && showThreadPreview ? (
113
- <FeedThreadPreview post={displayedPost} />
114
- ) : null}
115
- </ThemedView>
104
+ {hasStats && <FeedPostStats post={displayedPost} />}
105
+ <PostActions post={displayedPost} previewMode={previewMode} />
106
+ {!hideReply && showThreadPreview ? (
107
+ <FeedThreadPreview post={displayedPost} />
108
+ ) : null}
109
+ </ThemedView>
110
+ </Pressable>
116
111
  );
117
112
  };
@@ -25,7 +25,11 @@ export const FeedPostContent = ({ post }: FeedPostContentProps) => {
25
25
  }
26
26
  if (post.deletedAt) {
27
27
  return (
28
- <View className="text-sm text-gray-500">This post has been deleted.</View>
28
+ <View>
29
+ <ThemedText className="text-sm text-muted-foreground">
30
+ {t('posts.compact.deleted')}
31
+ </ThemedText>
32
+ </View>
29
33
  );
30
34
  }
31
35
  if (post.type === 'note') {
@@ -40,11 +44,5 @@ export const FeedPostContent = ({ post }: FeedPostContentProps) => {
40
44
  if (post.type === 'article') {
41
45
  return <FeedArticle {...{ post }} />;
42
46
  }
43
- return (
44
- <View>
45
- <ThemedText className="text-red-500">
46
- This post type is not supported.
47
- </ThemedText>
48
- </View>
49
- );
47
+ return null;
50
48
  };