Skip to content

Instantly share code, notes, and snippets.

@ozcanzaferayan
Last active January 26, 2020 14:32
Show Gist options
  • Save ozcanzaferayan/1b94087060f407bafb630dadc7404799 to your computer and use it in GitHub Desktop.
Save ozcanzaferayan/1b94087060f407bafb630dadc7404799 to your computer and use it in GitHub Desktop.
import React from 'react';
import { View, Image, Text, StyleSheet, TouchableOpacity, } from 'react-native';
import ProfilePicture from 'components/ProfilePicture';
import ActivityDescription from './ActivityDescription';
const Activity = (props) => {
return <View style={styles.container}>
<ProfilePicture item={props.item} size={55} />
<ActivityDescription item={props.item} />
<TouchableOpacity>
<Image source={{ uri: props.item.mentionedImage }} style={styles.mentionedImage} />
</TouchableOpacity>
</View>
};
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
alignItems: 'flex-start',
marginBottom: 20,
justifyContent: 'space-between'
},
mentionedImage: {
width: 48,
height: 48
},
});
export default Activity;
import React from 'react';
import { View, Text, StyleSheet, } from 'react-native';
import colors from 'res/colors';
const ActivityDescription = (props) => {
return (
<View style={styles.container}>
<Text style={styles.text}>
<Text style={styles.name}>{props.item.key}</Text>
{
props.item.activityType === 'like'
? ' yorumunu beğendi: '
: ' bir yorumda senden bahsetti: '
}
{props.item.lastMsg}
<Text style={styles.date}> · {props.item.sendTime}</Text>
</Text>
</View>
);
};
const styles = StyleSheet.create({
container: { flex: 1, marginStart: 20, marginEnd: 20, },
text: { color: colors.textFaded1, fontWeight: 'normal' },
name: { fontWeight: 'bold' },
date: { color: colors.textFaded2, },
});
export default ActivityDescription;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment