Skip to content

Commit

Permalink
[updated preview card]\n[updated preview and content card emojis/reac…
Browse files Browse the repository at this point in the history
…tions]
  • Loading branch information
Marcos Hernandez committed Apr 11, 2024
1 parent 2e27498 commit 36fe4bf
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 29 deletions.
39 changes: 39 additions & 0 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@
"expo-status-bar": "~1.6.0",
"html-entities": "^2.4.0",
"react": "18.2.0",
"react-apple-emojis": "^2.2.1",
"react-native": "0.72.10",
"react-native-dom-parser": "^1.5.3",
"react-native-element-dropdown": "^2.10.0",
"react-native-elements": "^3.4.3",
"react-native-emoji": "^1.8.0",
"react-native-emojicon": "^1.0.0",
"react-native-gesture-handler": "~2.12.0",
"react-native-htmlview": "^0.16.0",
"react-native-ionicons": "^4.6.5",
Expand Down
31 changes: 18 additions & 13 deletions src/components/ContentCard/ContentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {

import styles from './styles';
import globalStyles from '../../styles/globalStyles';
import Emoji from 'react-native-emoji';

type ContentCardProps = {
title: string;
Expand Down Expand Up @@ -63,18 +64,22 @@ function ContentCard({
onPress={() => null}
style={{ flexDirection: 'row' }}
>
<Image
style={styles.reactions}
source={require('./savedStoriesIcon.png')}
/>
<Image
style={styles.reactions}
source={require('./savedStoriesIcon.png')}
/>
<Image
style={styles.reactions}
source={require('./savedStoriesIcon.png')}
/>
<View
style={[styles.reactions, { backgroundColor: '#FFCCCB' }]}
>
<Emoji name="heart" />
</View>
<View
style={[styles.reactions, { backgroundColor: '#FFD580' }]}
>
<Emoji name="clap" />
</View>
<View
style={[styles.reactions, { backgroundColor: '#89CFF0' }]}
>
<Emoji name="muscle" />
</View>
{/* heart, clap, muscle, cry, ??? */}
<View style={styles.reactionNumber}>
<Text style={[globalStyles.subtext, styles.reactionText]}>
14{/*change number to work*/}
Expand All @@ -84,7 +89,7 @@ function ContentCard({
</View>
<TouchableOpacity onPress={() => saveStory()}>
<Image
style={{ width: 30, height: 30 }}
style={styles.saveStoryImage}
source={require('./savedStoriesIcon.png')}
/>
</TouchableOpacity>
Expand Down
22 changes: 15 additions & 7 deletions src/components/ContentCard/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,26 @@ const styles = StyleSheet.create({
color: colors.grey,
},
reactionNumber: {
marginLeft: 15,
marginTop: 10,
marginLeft: 10,
marginTop: 16,
},
reactions: {
width: 20,
height: 20,
borderRadius: 20 / 2,
width: 30,
height: 30,
borderRadius: 30 / 2,
borderWidth: 1,
backgroundColor: '#89CFF0', //different per emoji reaction
backgroundColor: 'transparent', //different per emoji reaction
borderColor: 'white',
marginTop: 10,
marginRight: -10,
marginRight: -5, // -10
overflow: 'hidden',
justifyContent: 'center',
paddingLeft: 3,
},
saveStoryImage: {
width: 30,
height: 30,
marginTop: 10,
},
buttons: {
flexDirection: 'row',
Expand Down
42 changes: 37 additions & 5 deletions src/components/PreviewCard/PreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ import {
Image,
Pressable,
Text,
TouchableOpacity,
View,
} from 'react-native';
import Emoji from 'react-native-emoji';

import styles from './styles';
import globalStyles from '../../styles/globalStyles';
Expand All @@ -32,18 +34,28 @@ function PreviewCard({
tags,
pressFunction,
}: PreviewCardProps) {
const saveStory = () => {
console.log("testing '+' icon does something for story " + title);
};

return (
<Pressable onPress={pressFunction}>
<View style={styles.card}>
<View style={styles.titleContainer}>
<Text numberOfLines={1} style={[globalStyles.h3, styles.title]}>
{title}
</Text>
<TouchableOpacity onPress={() => saveStory()}>
<Image
style={{ width: 30, height: 30 }}
source={require('./savedStoriesIcon.png')}
/>
</TouchableOpacity>
</View>
<View style={styles.body}>
<Image
style={styles.image}
source={{ uri: image == '' ? placeholderImage : image }}
source={{ uri: image === '' ? placeholderImage : image }}
/>
<View style={styles.cardTextContainer}>
<View style={styles.authorContainer}>
Expand All @@ -64,6 +76,28 @@ function PreviewCard({
</View>
</View>
<View style={styles.tagsContainer}>
<View>
<TouchableOpacity
onPress={() => null}
style={{ flexDirection: 'row' }}
>
<View style={[styles.reactions, { backgroundColor: '#FFCCCB' }]}>
<Emoji name="heart" />
</View>
<View style={[styles.reactions, { backgroundColor: '#FFD580' }]}>
<Emoji name="clap" />
</View>
<View style={[styles.reactions, { backgroundColor: '#89CFF0' }]}>
<Emoji name="muscle" />
</View>
{/* heart, clap, muscle, cry, ??? */}
<View style={styles.reactionNumber}>
<Text style={[globalStyles.subtext, styles.reactionText]}>
14{/*change number to work*/}
</Text>
</View>
</TouchableOpacity>
</View>
<View style={styles.tagsRow}>
{(tags?.length ?? 0) > 0 && (
<View style={styles.tag}>
Expand All @@ -72,12 +106,10 @@ function PreviewCard({
</Text>
</View>
)}
</View>
<View style={styles.moreTags}>
<Pressable>
<Pressable style={styles.moreTags}>
<Text style={[globalStyles.subtext, styles.moreTagsText]}>
{' '}
+ {(tags?.length ?? 1) - 1} more tags
+ {(tags?.length ?? 1) - 1}
</Text>
</Pressable>
</View>
Expand Down
Binary file added src/components/PreviewCard/savedStoriesIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 26 additions & 4 deletions src/components/PreviewCard/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ const styles = StyleSheet.create({
titleContainer: {
paddingTop: 16,
paddingLeft: 12,
paddingRight: 12,
borderBottomColor: '#EBEBEB',
borderBottomWidth: StyleSheet.hairlineWidth,
flexDirection: 'row',
justifyContent: 'space-between',
},
tag: {
paddingHorizontal: 8,
Expand All @@ -62,7 +65,6 @@ const styles = StyleSheet.create({
marginBottom: 10,
},
tagsContainer: {
// backgroundColor: colors.darkGrey,
flex: 1,
flexDirection: 'row',
justifyContent: 'space-between',
Expand All @@ -75,20 +77,40 @@ const styles = StyleSheet.create({
},
tagsRow: {
flexDirection: 'row',
justifyContent: 'flex-start',
justifyContent: 'flex-end',
alignContent: 'flex-end',
alignItems: 'center',
flexWrap: 'wrap',
paddingTop: 4,
},
moreTags: {
paddingVertical: 10,
paddingRight: 12,
alignItems: 'center',
justifyContent: 'center',
justifyContent: 'flex-end',
},
moreTagsText: {
color: colors.darkGrey,
},
reactions: {
width: 32,
height: 32,
borderRadius: 32 / 2,
borderWidth: 1,
backgroundColor: '#89CFF0', //different per emoji reaction
borderColor: 'white',
marginTop: 10,
marginRight: -5, // -10
overflow: 'hidden',
justifyContent: 'center',
paddingLeft: 4,
},
reactionText: {
color: colors.grey,
},
reactionNumber: {
marginLeft: 10,
marginTop: 16,
},
storyDescription: {
color: colors.darkGrey,
paddingRight: 12,
Expand Down

0 comments on commit 36fe4bf

Please sign in to comment.