This commit is contained in:
2026-01-13 15:10:13 +08:00
parent 38f0885a85
commit 45d5debead
134 changed files with 16980 additions and 1 deletions

View File

@@ -0,0 +1,58 @@
import React from "react";
import { StyleSheet, Dimensions, ScrollView } from "react-native";
import { Block, theme } from "galio-framework";
import { Card } from "../components/";
import deals from "../constants/deals";
const { width } = Dimensions.get("screen");
// import products from '../constants/products';
export default class Deals extends React.Component {
renderProducts = () => {
const { navigation, route } = this.props;
// const tabId = navigation.getParam("tabId");
// const products = tabId ? deals[tabId] : deals.shoes;
const tabId = route.params?.tabId;
const products = tabId ? deals[tabId] : deals.beauty;
return (
<ScrollView
showsVerticalScrollIndicator={false}
contentContainerStyle={styles.products}
>
<Block flex>
<Card item={products[0]} horizontal />
<Block flex row>
<Card
item={products[1]}
style={{ marginRight: theme.SIZES.BASE }}
/>
<Card item={products[2]} />
</Block>
<Card item={products[3]} horizontal />
<Card item={products[4]} full />
</Block>
</ScrollView>
);
};
render() {
return (
<Block flex center style={styles.deals}>
{this.renderProducts()}
</Block>
);
}
}
const styles = StyleSheet.create({
deals: {
width
},
products: {
width: width - theme.SIZES.BASE * 2,
paddingVertical: theme.SIZES.BASE
}
});