-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlantsCategoryItemScreen.tsx
89 lines (80 loc) · 2.67 KB
/
PlantsCategoryItemScreen.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Lib
import React, { useContext } from 'react';
import { StyleSheet, View, ScrollView } from 'react-native';
import AppLoading from 'expo-app-loading';
// Components
import NavigationGoBack from '../components/NavigationGoBack';
import DropDown from '../components/DropDown';
import GrayLine from '../components/GrayLine';
// UI
import { width, height, colors } from '../constants/theme';
import { ThemesContext } from '../context/ThemeContext';
import CategoryItemCharacteristic from '../components/home/CategoryItemCharacteristic';
const PlantsCategoryItemScreen = ({ navigation, route }) => {
const { item } = route.params;
const title = item?.title;
const lowPrice = item.price?.lowPrice;
const hightPrice = item.price?.highPrice;
const dimensions = item.payload?.size;
const planters = item.payload?.planter;
const planterColors = item.payload?.planterColor;
const description = item.payload?.description;
const sliderPhotos = item.payload?.sliderPhotos;
const careGuide = item.payload?.careGuide;
const sadPlantSigns = item.payload?.sadPlantSigns;
const guarantee = item.payload?.guarantee?.description;
const { fontsLoaded } = useContext(ThemesContext);
if (!fontsLoaded) {
return <AppLoading />;
}
return (
<ScrollView showsVerticalScrollIndicator={false}>
<View style={[styles.container]}>
<View style={[styles.header]}>
<View style={[styles.backIconWrapper]}>
<NavigationGoBack navigation={navigation} />
</View>
</View>
<View>
<CategoryItemCharacteristic
item={item}
title={title}
lowPrice={lowPrice}
dimensions={dimensions}
planters={planters}
planterColors={planterColors}
sliderPhotos={sliderPhotos}
/>
<View style={[styles.dropDownContainer]}>
<GrayLine />
<DropDown information={description} title={'Description'} />
<GrayLine />
<DropDown information={careGuide} title={'Care Guide'} />
<GrayLine />
<DropDown information={sadPlantSigns} title={'Sad Plant Signs'} />
<GrayLine />
<DropDown information={guarantee} title={'30-Day Guarantee'} />
<GrayLine />
</View>
</View>
</View>
</ScrollView>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: colors.background,
paddingTop: height * 0.07,
},
header: {
paddingHorizontal: width * 0.08,
},
backIconWrapper: {
marginBottom: 15,
},
dropDownContainer: {
paddingHorizontal: width * 0.08,
},
});
export default PlantsCategoryItemScreen;