Improving groups
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Text, StyleSheet, View } from 'react-native';
|
||||
import Icon from 'react-native-vector-icons/MaterialIcons';
|
||||
import { Avatar, Button, Card, Title, Paragraph } from 'react-native-paper';
|
||||
import { List, IconButton, Card, Chip, Badge } from 'react-native-paper';
|
||||
import API from './../API.js';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
@@ -51,6 +51,7 @@ let ProfileCard = ({ profileid, hideIcon, profileObj }) => {
|
||||
let icon = profile._id ? (!profile.isGroup ? "person-outline" : "group") : '';
|
||||
icon = icon === "person-outline" && profile.subscription && profile.subscription > (new Date() - 0) ? "assignment-ind" : icon;
|
||||
icon = icon === "group" && profile.isCourse ? "subscriptions" : icon;
|
||||
icon = icon === "group" && profile.isPrivate ? "screen-lock-portrait" : icon;
|
||||
let photoUrl = profile.profile.photo ? 'https://social.emmint.com/' + profile.profile.photo : DefaultPhoto;
|
||||
|
||||
const onPress = () => {
|
||||
@@ -60,22 +61,20 @@ let ProfileCard = ({ profileid, hideIcon, profileObj }) => {
|
||||
return (
|
||||
<Card style={styles.content}>
|
||||
<Card.Content>
|
||||
<Title onPress={onPress} numberOfLines={1}>
|
||||
<Text style={{ paddingTop: 10 }}>
|
||||
{!hideIcon ? <Icon name={icon} size={18} /> : <></>}
|
||||
</Text>
|
||||
<Text>
|
||||
{profile.profile && profile.profile.firstName} {profile.profile && profile.profile.lastName}
|
||||
</Text>
|
||||
</Title>
|
||||
<Paragraph numberOfLines={4}>{profileObj.profile.description}</Paragraph>
|
||||
<View style={{flexDirection: "row", justifyContent:"space-evenly"}}>
|
||||
<FollowButton profile={profile} />
|
||||
<Text>
|
||||
<Icon name={"hail"} size={18} />
|
||||
{Object.keys(profile.subscribed).length}
|
||||
</Text>
|
||||
</View>
|
||||
<IconButton icon={icon} style={{
|
||||
position: "absolute",
|
||||
right: 5,
|
||||
top: 5,
|
||||
}} />
|
||||
<List.Item
|
||||
title={profile.profile?.firstName + " " + profile.profile?.lastName}
|
||||
description={profileObj.profile.description}
|
||||
//left={props => <List.Icon {...props} icon={icon} />}
|
||||
titleStyle={{fontWeight:"bold", fontSize:20}}
|
||||
descriptionStyle={{}}
|
||||
onPress={onPress}
|
||||
descriptionNumberOfLines={4}
|
||||
/>
|
||||
</Card.Content>
|
||||
</Card>
|
||||
|
||||
@@ -87,7 +86,6 @@ export default React.memo(ProfileCard);
|
||||
const styles = StyleSheet.create({
|
||||
content: {
|
||||
margin: 4,
|
||||
width: "50%",
|
||||
},
|
||||
centerItems: {
|
||||
justifyContent: 'center',
|
||||
|
||||
Reference in New Issue
Block a user