Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimulaX committed Jun 30, 2023
1 parent cabe192 commit 08d0ee3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
13 changes: 7 additions & 6 deletions src/components/ProductItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ export default function ProductItem({ product, isDetailed, isCartItem }: TProduc

return (
<View style={[styles.container, { borderWidth: isDetailed ? 0 : 1 }]}>
<Image
{product?.image && <Image
resizeMode='cover'
style={[styles.imageContainer, { width: isDetailed ? 150 : 70, height: isDetailed ? 150 : 70 }]}
source={{ uri: product?.image }}
/>
source={{ uri: product.image }}
/>}
<View style={{ flexDirection: 'column', flex: 1 }}>
<Text style={styles.title}>{product?.title ?? ''}</Text>
<Text style={styles.price}>{product?.price ? '$' + product.price : ''}</Text>
</View>
{isCartItem && <View style={styles.actionsContainer}>
<TouchableOpacity style={styles.actionBox} onPress={() => dispatch(add(product))}>
<Text style={{ fontSize: 15 }}>+</Text>
<Text style={{ fontSize: 15, color: '#000' }}>+</Text>
</TouchableOpacity>
<View style={styles.actionBox}>
<Text style={styles.counter}>{addedItem?.quantity ?? 0}</Text>
</View>
<TouchableOpacity style={styles.actionBox} onPress={() => dispatch(remove(product))}>
<Text style={{ fontSize: 15 }}>-</Text>
<Text style={{ fontSize: 15, color: '#000' }}>-</Text>
</TouchableOpacity>
</View>}
</View>
Expand Down Expand Up @@ -79,6 +79,7 @@ const styles = StyleSheet.create({
borderRadius: 4,
},
counter: {
fontSize: 15
fontSize: 15,
color: '#000'
},
});
3 changes: 2 additions & 1 deletion src/screens/CartScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const styles = StyleSheet.create({
},
totalText: {
fontSize: 20,
fontWeight: '600'
fontWeight: '600',
color: '#000'
}
});
10 changes: 6 additions & 4 deletions src/screens/ProductDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ export default function ProductDetails() {
</ScrollView>
<View style={styles.actionsContainer}>
<TouchableOpacity style={styles.actionBox} onPress={() => handleRemoveFromCart(product!)}>
<Text style={{ fontSize: 30 }}>-</Text>
<Text style={{ fontSize: 30, color: '#000' }}>-</Text>
</TouchableOpacity>
<View style={styles.actionBox}>
<Text style={styles.counter}>{addedItem?.quantity ?? 0}</Text>
</View>
<TouchableOpacity style={styles.actionBox} onPress={() => handleAddToCart(product!)}>
<Text style={{ fontSize: 30 }}>+</Text>
<Text style={{ fontSize: 30, color: '#000' }}>+</Text>
</TouchableOpacity>
</View>
<TouchableOpacity
Expand All @@ -71,7 +71,8 @@ const styles = StyleSheet.create({
description: {
paddingHorizontal: 20,
fontSize: 16,
fontWeight: '400'
fontWeight: '400',
color: '#000'
},
actionsContainer: {
flexDirection: 'row',
Expand All @@ -89,7 +90,8 @@ const styles = StyleSheet.create({
borderRadius: 4,
},
counter: {
fontSize: 20
fontSize: 20,
color: '#000'
},
addButton: {
justifyContent: 'center',
Expand Down

0 comments on commit 08d0ee3

Please sign in to comment.