Search and ProfileCard

This commit is contained in:
Eric Bailey
2024-03-19 11:50:02 -05:00
parent bcfcb60c98
commit daf0ba9481
3 changed files with 5 additions and 8 deletions
+1 -7
View File
@@ -101,13 +101,7 @@ function computeSuggestions(
} }
for (const item of searched) { for (const item of searched) {
if (!items.find(item2 => item2.handle === item.handle)) { if (!items.find(item2 => item2.handle === item.handle)) {
items.push({ items.push(item)
did: item.did,
handle: item.handle,
displayName: item.displayName,
avatar: item.avatar,
labels: item.labels,
})
} }
} }
return items.filter(profile => { return items.filter(profile => {
+3 -1
View File
@@ -49,6 +49,7 @@ export function ProfileCard({
const pal = usePalette('default') const pal = usePalette('default')
const profile = useProfileShadow(profileUnshadowed) const profile = useProfileShadow(profileUnshadowed)
const moderationOpts = useModerationOpts() const moderationOpts = useModerationOpts()
const isLabeler = profile?.associated?.labeler
if (!moderationOpts) { if (!moderationOpts) {
return null return null
} }
@@ -79,6 +80,7 @@ export function ProfileCard({
size={40} size={40}
avatar={profile.avatar} avatar={profile.avatar}
moderation={moderation.ui('avatar')} moderation={moderation.ui('avatar')}
type={isLabeler ? 'labeler' : 'user'}
/> />
</View> </View>
<View style={styles.layoutContent}> <View style={styles.layoutContent}>
@@ -101,7 +103,7 @@ export function ProfileCard({
/> />
{!!profile.viewer?.followedBy && <View style={s.flexRow} />} {!!profile.viewer?.followedBy && <View style={s.flexRow} />}
</View> </View>
{renderButton ? ( {renderButton && !isLabeler ? (
<View style={styles.layoutButton}>{renderButton(profile)}</View> <View style={styles.layoutButton}>{renderButton(profile)}</View>
) : undefined} ) : undefined}
</View> </View>
+1
View File
@@ -112,6 +112,7 @@ export function SearchProfileCard({
size={40} size={40}
avatar={profile.avatar} avatar={profile.avatar}
moderation={moderation.ui('avatar')} moderation={moderation.ui('avatar')}
type={profile.associated?.labeler ? 'labeler' : 'user'}
/> />
<View style={{flex: 1}}> <View style={{flex: 1}}>
<Text <Text