|
@@ -7,6 +7,7 @@ import {
|
|
|
FlatList,
|
|
FlatList,
|
|
|
ImageBackground,
|
|
ImageBackground,
|
|
|
RefreshControl,
|
|
RefreshControl,
|
|
|
|
|
+ ScrollView,
|
|
|
StatusBar,
|
|
StatusBar,
|
|
|
StyleSheet,
|
|
StyleSheet,
|
|
|
Text,
|
|
Text,
|
|
@@ -83,21 +84,27 @@ const TypeSelector = React.memo(({
|
|
|
onSortChange: () => void;
|
|
onSortChange: () => void;
|
|
|
}) => (
|
|
}) => (
|
|
|
<View style={styles.typeSection}>
|
|
<View style={styles.typeSection}>
|
|
|
- <View style={styles.typeList}>
|
|
|
|
|
- {typeList.map((item, index) => (
|
|
|
|
|
- <TouchableOpacity
|
|
|
|
|
- key={index}
|
|
|
|
|
- style={styles.typeItem}
|
|
|
|
|
- onPress={() => onTypeChange(index)}
|
|
|
|
|
- activeOpacity={0.7}
|
|
|
|
|
- >
|
|
|
|
|
- <Image
|
|
|
|
|
- source={{ uri: typeIndex === index ? item.imgOn : item.img }}
|
|
|
|
|
- style={styles.typeImage}
|
|
|
|
|
- contentFit="contain"
|
|
|
|
|
- />
|
|
|
|
|
- </TouchableOpacity>
|
|
|
|
|
- ))}
|
|
|
|
|
|
|
+ <View style={styles.typeListContainer}>
|
|
|
|
|
+ <ScrollView
|
|
|
|
|
+ horizontal
|
|
|
|
|
+ showsHorizontalScrollIndicator={false}
|
|
|
|
|
+ contentContainerStyle={styles.typeListContent}
|
|
|
|
|
+ >
|
|
|
|
|
+ {typeList.map((item, index) => (
|
|
|
|
|
+ <TouchableOpacity
|
|
|
|
|
+ key={index}
|
|
|
|
|
+ style={styles.typeItem}
|
|
|
|
|
+ onPress={() => onTypeChange(index)}
|
|
|
|
|
+ activeOpacity={0.7}
|
|
|
|
|
+ >
|
|
|
|
|
+ <Image
|
|
|
|
|
+ source={{ uri: typeIndex === index ? item.imgOn : item.img }}
|
|
|
|
|
+ style={styles.typeImage}
|
|
|
|
|
+ contentFit="fill"
|
|
|
|
|
+ />
|
|
|
|
|
+ </TouchableOpacity>
|
|
|
|
|
+ ))}
|
|
|
|
|
+ </ScrollView>
|
|
|
</View>
|
|
</View>
|
|
|
<TouchableOpacity style={styles.sortBtn} onPress={onSortChange} activeOpacity={0.7}>
|
|
<TouchableOpacity style={styles.sortBtn} onPress={onSortChange} activeOpacity={0.7}>
|
|
|
<Image
|
|
<Image
|
|
@@ -425,29 +432,31 @@ const styles = StyleSheet.create({
|
|
|
zIndex: 10,
|
|
zIndex: 10,
|
|
|
backgroundColor: 'transparent',
|
|
backgroundColor: 'transparent',
|
|
|
},
|
|
},
|
|
|
- typeList: {
|
|
|
|
|
- flexDirection: 'row',
|
|
|
|
|
- justifyContent: 'flex-start',
|
|
|
|
|
|
|
+ typeListContainer: {
|
|
|
flex: 1,
|
|
flex: 1,
|
|
|
|
|
+ marginRight: 10,
|
|
|
|
|
+ },
|
|
|
|
|
+ typeListContent: {
|
|
|
|
|
+ paddingRight: 10,
|
|
|
},
|
|
},
|
|
|
typeItem: {
|
|
typeItem: {
|
|
|
- width: 60,
|
|
|
|
|
- height: 30,
|
|
|
|
|
- marginRight: 5,
|
|
|
|
|
|
|
+ width: 73,
|
|
|
|
|
+ height: 34,
|
|
|
|
|
+ marginRight: 4,
|
|
|
},
|
|
},
|
|
|
typeImage: {
|
|
typeImage: {
|
|
|
width: '100%',
|
|
width: '100%',
|
|
|
height: '100%',
|
|
height: '100%',
|
|
|
},
|
|
},
|
|
|
sortBtn: {
|
|
sortBtn: {
|
|
|
- width: 40,
|
|
|
|
|
- height: 30,
|
|
|
|
|
|
|
+ width: 38,
|
|
|
|
|
+ height: 38,
|
|
|
alignItems: 'center',
|
|
alignItems: 'center',
|
|
|
justifyContent: 'center',
|
|
justifyContent: 'center',
|
|
|
},
|
|
},
|
|
|
sortIcon: {
|
|
sortIcon: {
|
|
|
- width: 30,
|
|
|
|
|
- height: 30,
|
|
|
|
|
|
|
+ width: 38,
|
|
|
|
|
+ height: 38,
|
|
|
},
|
|
},
|
|
|
listContent: {
|
|
listContent: {
|
|
|
paddingHorizontal: 10,
|
|
paddingHorizontal: 10,
|