Searchs views for users, groups and courses

This commit is contained in:
aeroreyna
2022-03-16 23:02:17 -07:00
parent dc3079328e
commit e5554c2f8e
6 changed files with 253 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
import React, { useState, useEffect } from 'react';
import { Text } from 'react-native';
import { Avatar, IconButton, Card, Title, Paragraph } from 'react-native-paper';
import UserName from './UserName';
const DefaultPhoto = "https://social.emmint.com/uploads/e6f9be6d665dc43417701bf16a90122c.png";
const ProfileSmallHeader = ({ profileObj }) => {
let photoUrl = profileObj.profile.photo ? 'https://social.emmint.com/' + profileObj.profile.photo : DefaultPhoto;
return (
<>
<Card.Title
title={<UserName profileid={profileObj._id} hideIcon={true} />}
subtitle={profileObj.profile.description}
left={(props) => <Avatar.Image {...props} source={{ uri: photoUrl}} />}
right={(props) => <IconButton {...props} icon="more-vert" onPress={() => { }} />}
/>
</>
);
}
export default React.memo(ProfileSmallHeader);

View File

@@ -24,7 +24,7 @@ const getName = async (key) => {
}
}
let UserName = ({ profileid }) => {
let UserName = ({ profileid, hideIcon }) => {
let [profile, setProfile] = useState({});
const navigation = useNavigation();
@@ -47,7 +47,7 @@ let UserName = ({ profileid }) => {
return (
<Text onPress={onPress}>
<Text style={{ paddingTop: 10 }}>
<Icon name={icon} size={18} />
{!hideIcon ? <Icon name={icon} size={18} /> : <></>}
</Text>
<Text> {profile.profile && profile.profile.firstName} {profile.profile && profile.profile.lastName}</Text>