@openpeepshq/rn-components 0.4.0 → 0.5.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/package.json +2 -2
- package/src/assets/audio/click-notification.wav +0 -0
- package/src/components/groups/GroupAvatar.tsx +41 -12
- package/src/components/jams/JamCallParticipant.tsx +25 -1
- package/src/components/navigation/tab-navigator.tsx +11 -8
- package/src/components/post/pieces/PostActions.tsx +2 -0
- package/src/components/post/pieces/PostMenu.tsx +315 -340
- package/src/components/post/pieces/ShareMenu.tsx +68 -67
- package/src/components/profile/Avatar.tsx +24 -8
- package/src/components/profile/FollowUnfollowButton.tsx +4 -2
- package/src/components/profile/ProfileCard.tsx +48 -18
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/index.ts +6 -0
- package/src/components/ui/loading-spinner.tsx +24 -0
- package/src/components/ui/popup-menu-button.tsx +99 -0
- package/src/components/ui/popup-menu-section.tsx +21 -0
- package/src/components/ui/popup-menu-separator.tsx +10 -0
- package/src/components/ui/popup-menu.tsx +75 -0
- package/src/lib/utils.ts +11 -23
- package/src/pages/Members.tsx +1 -1
package/src/lib/utils.ts
CHANGED
|
@@ -72,22 +72,6 @@ export const formatEventDate = (dateString: string) => {
|
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
export const getInitials = (profile?: Profile) => {
|
|
76
|
-
if (!profile?.displayName) {
|
|
77
|
-
return profile?.handle?.charAt(0)?.toUpperCase();
|
|
78
|
-
}
|
|
79
|
-
let initials = '';
|
|
80
|
-
const [first, last] = profile?.displayName.split(' ');
|
|
81
|
-
if (first) {
|
|
82
|
-
initials += first.charAt(0).toUpperCase();
|
|
83
|
-
}
|
|
84
|
-
if (last) {
|
|
85
|
-
initials += last.charAt(0).toUpperCase();
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return initials;
|
|
89
|
-
};
|
|
90
|
-
|
|
91
75
|
export const ChatDateFormatter = (date: string) => {
|
|
92
76
|
const options: Intl.DateTimeFormatOptions = {
|
|
93
77
|
weekday: 'long',
|
|
@@ -216,13 +200,17 @@ export const isPostPath = (path: string) =>
|
|
|
216
200
|
path.startsWith('/posts/') && path.substring(7);
|
|
217
201
|
|
|
218
202
|
export const isLocalLink = (url: string, origin: string) => {
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
203
|
+
try {
|
|
204
|
+
const urlObj = new URL(url);
|
|
205
|
+
return (
|
|
206
|
+
urlObj.origin === origin &&
|
|
207
|
+
(isPostPath(urlObj.pathname) ||
|
|
208
|
+
isJamPath(urlObj.pathname) ||
|
|
209
|
+
isGroupPath(urlObj.pathname))
|
|
210
|
+
);
|
|
211
|
+
} catch {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
226
214
|
};
|
|
227
215
|
|
|
228
216
|
export const isValidUrl = (url?: string) => {
|
package/src/pages/Members.tsx
CHANGED
|
@@ -100,7 +100,7 @@ export const Members: React.FC<DirectoryProps> = ({ navigation }) => {
|
|
|
100
100
|
>
|
|
101
101
|
<MessageSquareTextIcon className="size-10 text-foreground" />
|
|
102
102
|
</Pressable>
|
|
103
|
-
<FollowUnfollowButton profile={profile} />
|
|
103
|
+
<FollowUnfollowButton profile={profile} compact />
|
|
104
104
|
</View>
|
|
105
105
|
) : null
|
|
106
106
|
}
|