@mereb/app-profile 0.0.7 → 0.0.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.
@@ -6,3 +6,4 @@ export type ProfilePost = NonNullable<ProfileData>['posts']['edges'][number]['no
6
6
  export declare function parseProfileTimestamp(value?: string | null): Date | null;
7
7
  export declare function formatRelativeProfileTimestamp(value?: string | null, now?: number): string;
8
8
  export declare function selectProfilePosts(profile?: ProfileData | null): ProfilePost[];
9
+ export declare function normalizeUserSearchQuery(value?: string | null): string;
package/dist/headless.js CHANGED
@@ -43,3 +43,6 @@ export function selectProfilePosts(profile) {
43
43
  }
44
44
  return profile.posts.edges.map((edge) => edge.node);
45
45
  }
46
+ export function normalizeUserSearchQuery(value) {
47
+ return value?.trim().replace(/^@/, '') ?? '';
48
+ }
package/dist/index.d.ts CHANGED
@@ -7,5 +7,5 @@ type ProfileScreenProps = {
7
7
  auth?: AuthControls;
8
8
  handle?: string;
9
9
  };
10
- export declare function ProfileScreen({ auth, handle }: Readonly<ProfileScreenProps>): import("react/jsx-runtime.js").JSX.Element;
10
+ export declare function ProfileScreen({ auth, handle }: Readonly<ProfileScreenProps>): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ export function ProfileScreen({ auth, handle }) {
36
36
  const activeRefetch = viewingOwnProfile ? refetchMe : refetchHandle;
37
37
  const profile = viewingOwnProfile ? meData?.me : handleData?.userByHandle;
38
38
  const followButtonLabel = profile?.followedByMe ? 'Following' : 'Follow';
39
- const activityIndicatorColor = profile?.followedByMe ? '#0f172a' : '#fff';
39
+ const activityIndicatorColor = profile?.followedByMe ? color.text : color.surface;
40
40
  const unauthenticatedError = viewingOwnProfile
41
41
  ? Boolean(extractGraphQLErrors(meError)?.some((graphError) => graphError.message?.toUpperCase().includes('UNAUTHENTICATED')))
42
42
  : false;
@@ -150,7 +150,7 @@ export function ProfileScreen({ auth, handle }) {
150
150
  ? styles.followingButtonText
151
151
  : styles.followButtonText, children: followButtonLabel })) }));
152
152
  const renderProfileHeader = () => (_jsxs(View, { style: styles.card, children: [_jsx(View, { style: styles.avatarCircle, children: profile?.avatarUrl ? (_jsx(Image, { source: { uri: profile.avatarUrl }, style: styles.avatarImage, resizeMode: "cover" })) : (_jsx(PlaceholderAvatar, {})) }), _jsxs(View, { style: styles.headerText, children: [_jsx(Text, { style: styles.displayName, children: profile?.displayName ?? 'Set your display name' }), _jsx(Text, { style: styles.handleText, children: profile ? `@${profile.handle}` : 'No handle yet' }), _jsxs(View, { style: styles.metricsRow, children: [_jsxs(View, { style: styles.metricItem, children: [_jsx(Text, { style: styles.metricValue, children: profile?.followersCount ?? 0 }), _jsx(Text, { style: styles.metricLabel, children: "Followers" })] }), _jsxs(View, { style: styles.metricItem, children: [_jsx(Text, { style: styles.metricValue, children: profile?.followingCount ?? 0 }), _jsx(Text, { style: styles.metricLabel, children: "Following" })] })] })] }), viewingOwnProfile ? (_jsx(TouchableOpacity, { style: styles.logoutChip, onPress: handleLogout, accessibilityRole: "button", children: _jsx(Text, { style: styles.logoutChipText, children: "Log out" }) })) : null, viewingOwnProfile ? null : renderFollowAction()] }));
153
- const renderEditableProfile = () => (_jsxs(View, { style: styles.card, children: [_jsx(Text, { style: styles.sectionTitle, children: "Profile details" }), _jsxs(View, { style: styles.formGroup, children: [_jsx(Text, { style: styles.label, children: "Display name" }), _jsx(TextInput, { value: displayName, onChangeText: setDisplayName, placeholder: "How should teammates see you?", style: styles.textInput, editable: !saving, autoCapitalize: "words" })] }), _jsxs(View, { style: styles.formGroup, children: [_jsx(Text, { style: styles.label, children: "Bio" }), _jsx(TextInput, { value: bio, onChangeText: setBio, placeholder: "Share a short introduction", style: [styles.textInput, styles.bioInput], multiline: true, numberOfLines: 4, textAlignVertical: "top", editable: !saving })] }), formError ? _jsx(Text, { style: styles.errorText, children: formError }) : null, successMessage ? _jsx(Text, { style: styles.successText, children: successMessage }) : null, _jsx(TouchableOpacity, { style: [styles.primaryButton, saving ? styles.buttonDisabled : null], onPress: handleSave, disabled: saving, accessibilityRole: "button", children: saving ? _jsx(ActivityIndicator, { color: "#fff" }) : _jsx(Text, { style: styles.primaryButtonText, children: "Save changes" }) })] }));
153
+ const renderEditableProfile = () => (_jsxs(View, { style: styles.card, children: [_jsx(Text, { style: styles.sectionTitle, children: "Profile details" }), _jsxs(View, { style: styles.formGroup, children: [_jsx(Text, { style: styles.label, children: "Display name" }), _jsx(TextInput, { value: displayName, onChangeText: setDisplayName, placeholder: "How should teammates see you?", style: styles.textInput, editable: !saving, autoCapitalize: "words" })] }), _jsxs(View, { style: styles.formGroup, children: [_jsx(Text, { style: styles.label, children: "Bio" }), _jsx(TextInput, { value: bio, onChangeText: setBio, placeholder: "Share a short introduction", style: [styles.textInput, styles.bioInput], multiline: true, numberOfLines: 4, textAlignVertical: "top", editable: !saving })] }), formError ? _jsx(Text, { style: styles.errorText, children: formError }) : null, successMessage ? _jsx(Text, { style: styles.successText, children: successMessage }) : null, _jsx(TouchableOpacity, { style: [styles.primaryButton, saving ? styles.buttonDisabled : null], onPress: handleSave, disabled: saving, accessibilityRole: "button", children: saving ? _jsx(ActivityIndicator, { color: color.surface }) : _jsx(Text, { style: styles.primaryButtonText, children: "Save changes" }) })] }));
154
154
  const aboutSection = profile?.bio ? (_jsxs(View, { style: styles.card, children: [_jsx(Text, { style: styles.sectionTitle, children: "About" }), _jsx(Text, { style: styles.readOnlyBio, children: profile.bio })] })) : null;
155
155
  const renderRecentPosts = () => (_jsxs(View, { style: styles.card, children: [_jsx(Text, { style: styles.sectionTitle, children: "Recent posts" }), activeLoading && !profile ? _jsx(ActivityIndicator, { style: styles.postsLoading }) : null, !activeLoading && posts.length === 0 ? (_jsx(Text, { style: styles.placeholderBody, children: viewingOwnProfile
156
156
  ? 'You have not shared anything yet. Post from the feed to see it listed here.'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mereb/app-profile",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Profile experience components and hooks for Mereb apps",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -27,9 +27,9 @@
27
27
  "package.json"
28
28
  ],
29
29
  "dependencies": {
30
- "@mereb/shared-graphql": "^0.0.15",
31
- "@mereb/ui-shared": "^0.0.4",
32
- "@mereb/tokens": "^0.0.4"
30
+ "@mereb/shared-graphql": "^0.0.16",
31
+ "@mereb/ui-shared": "^0.0.6",
32
+ "@mereb/tokens": "^0.0.8"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@apollo/client": ">=4.0.0",