Improving groups

This commit is contained in:
Adolfo Reyna
2023-01-22 22:47:48 -05:00
parent 9b20377f87
commit acab0eef66
3 changed files with 32 additions and 24 deletions

View File

@@ -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',