Skip to content

Commit

Permalink
Merge pull request #189 from Vero-Ventures/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MatoCode authored May 28, 2024
2 parents bca6d7e + 4c208ae commit 15f472c
Show file tree
Hide file tree
Showing 14 changed files with 2,462 additions and 695 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ As of the latest project update (May 27th, 2024), "Live Timeless" has successful

- **Coaching Chatbot:** Fully integrated with Google's gemini pro model, the AI coaching chatbot is operational, offering personalized plans and actionable steps to help users achieve their health goals.

- **User Account Management:**: All user account management features are complete and functioning as intended, making it GDPR (General data protection regulation) compliant. This includes:
- **User Account Management:** All user account management features are complete and functioning as intended, making it GDPR (General data protection regulation) compliant. This includes:

- Secure registration and login processes.
- Functionalities to delete accounts and download user data.
Expand Down
73 changes: 5 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 26 additions & 11 deletions src/components/CardPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const CardPost = (props) => {

const fetchLikedUsers = async () => {
try {
// Get user_ids who liked the post
// grab user_ids who liked the post
const { data: likeData, error: likeError } = await supabase
.from('Like')
.select('user_id')
Expand All @@ -76,7 +76,7 @@ const CardPost = (props) => {

const userIds = likeData.map(like => like.user_id);

// Get user details from User table
// grab user details from User table
const { data: usersData, error: usersError } = await supabase
.from('User')
.select('user_id, username, profile_image')
Expand All @@ -92,23 +92,22 @@ const CardPost = (props) => {
};

const renderCardContent = () => (
fetchLikeCount(),
fetchLikeStatus(),
<View>
{props.post.habit_photo && (
<Image source={{ uri: props.post.habit_photo }} style={styles.habitImage} resizeMode="cover" />
)}
<View style={styles.cardPostDescriptionContainer}>
{/* <View style={styles.cardPostDescriptionContainer}> */}
<Text style={styles.postText}>{props.postDescription}</Text>
</View>
<TouchableOpacity onPress={fetchLikedUsers}>
<Text style={styles.textSubtitle}>{countLikes} likes</Text>
</TouchableOpacity>
</View>
<View style={styles.cardPostDescriptionContainer}>
<Text style={styles.textUserName}>{props.postUser?.name ?? 'Unknown User'} </Text>
<Text style={styles.postText}>{props.postDescription}</Text>
</View>
</View>

// </View>
);


const renderCardActions = () => (
<View style={styles.containerActions}>
Expand Down Expand Up @@ -319,9 +318,12 @@ const styles = StyleSheet.create({
textUserName: {
fontWeight: 'bold',
color: Colors.text,
marginLeft: 10,
},
textSubtitle: {
color: '#FFFFFF',
marginLeft: 10,
marginTop: 5,
},
cardPostVerticalEllipsis: {
width: 24,
Expand All @@ -330,14 +332,19 @@ const styles = StyleSheet.create({
habitImage: {
width: '100%',
height: 400,
borderRadius: 20,
},
cardPostDescriptionContainer: {
flexDirection: 'row',
flexDirection: 'column',
alignItems: 'flex-start',
padding: 10,
},
postText: {
color: Colors.text,
marginLeft: 5,
marginBottom: 10,
marginTop: 5,
lineHeight: 25,
},
containerActions: {
flexDirection: 'row',
Expand All @@ -354,6 +361,13 @@ const styles = StyleSheet.create({
marginLeft: 5,
color: Colors.text,
},
cardShadow: {
marginBottom: 5,
borderTopWidth: 0.2,
// borderBottomWidth: 1,
borderColor: 'rgba(255, 255, 255, 0.6)',
paddingVertical: 5,
},
icon: {
width: 29,
height: 29,
Expand Down Expand Up @@ -392,7 +406,7 @@ const styles = StyleSheet.create({
},
closeButton: {
marginTop: 20,
padding: 10,
padding: 15,
backgroundColor: Colors.primary,
borderRadius: 5,
},
Expand All @@ -402,4 +416,5 @@ const styles = StyleSheet.create({
},
});


export default CardPost;
4 changes: 2 additions & 2 deletions src/components/CommentCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Colors from '../../assets/styles/Colors';
import { Image } from 'react-native';
import moment from 'moment';

export default function CommentCard({ commentData }) {
export default function CommentCard({ commentData}) {
return (
<View style={styles.container}>
<View style={styles.headerContainer}>
Expand All @@ -18,7 +18,7 @@ export default function CommentCard({ commentData }) {
<View>
<Text style={styles.textUserName}>{commentData.user_id.username}</Text>
<Text style={styles.textSubtitle}>
{moment(commentData.createdAt).local().startOf('second').fromNow()}
{moment(commentData.created_at).fromNow()}
</Text>
</View>
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/FollowScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ const styles = StyleSheet.create({
fontWeight: 'bold',
},
unfollowButton: {
color: Colors.secondary,
color: 'white',
fontWeight: 'bold',
},
alreadyFollowing: {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/FollowersScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const styles = StyleSheet.create({
fontWeight: 'bold',
},
unfollowButton: {
color: Colors.secondary,
color: 'white',
fontWeight: 'bold',
},
alreadyFollowing: {
Expand Down
Loading

0 comments on commit 15f472c

Please sign in to comment.