sua menu
This commit is contained in:
@@ -6,7 +6,7 @@ import { Text, View, } from '../Themed';
|
||||
import { TextInput } from 'react-native-gesture-handler';
|
||||
import { Ionicons, FontAwesome } from '@expo/vector-icons';
|
||||
import { createDrawerNavigator, DrawerItemList, DrawerItem, DrawerContentScrollView } from '@react-navigation/drawer';
|
||||
import { NavigationContainer } from '@react-navigation/native';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
import { createStackNavigator } from '@react-navigation/stack';
|
||||
import Animated, { Easing } from 'react-native-reanimated';
|
||||
|
||||
@@ -38,11 +38,12 @@ const Header = ({props} : {props : any}) => {
|
||||
|
||||
|
||||
const MainSeach = () => {
|
||||
const navigation = useNavigation();
|
||||
return (
|
||||
<View style={styles.boxSearch}>
|
||||
<View style={styles.boxSearchBo}>
|
||||
<TextInput style={styles.inputSearch} placeholder="Nhập tên, mã sản phẩm" autoCapitalize="none" />
|
||||
<Ionicons style={styles.buttonSearch} onPress={() => { Alert.alert('aaaaaaaaaa') }} name="search-outline" size={26} />
|
||||
<Ionicons style={styles.buttonSearch} onPress={() => navigation.navigate('SearchProduct')} name="search-outline" size={26} />
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -3,11 +3,9 @@ import { useState } from 'react';
|
||||
import { Alert, Button, Image, StyleSheet, Dimensions, SafeAreaView, ScrollView, TouchableOpacity, Pressable } from 'react-native';
|
||||
import { Text, View, } from '../Themed';
|
||||
import { Ionicons, FontAwesome } from '@expo/vector-icons';
|
||||
import ProductDetail from '../../screens/ProductDetail';
|
||||
import { createDrawerNavigator, DrawerItemList, DrawerItem, DrawerContentScrollView } from '@react-navigation/drawer';
|
||||
import { NavigationContainer } from '@react-navigation/native';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
import { createStackNavigator, StackScreenProps } from '@react-navigation/stack';
|
||||
import { NativeRouter, Route, Link } from "react-router-native";
|
||||
import { TextInput } from 'react-native-gesture-handler';
|
||||
import { Checkbox } from 'react-native-paper';
|
||||
|
||||
@@ -24,20 +22,22 @@ const ShowProductItem = (props: { id: number, productName: string, productSKU: s
|
||||
|
||||
const { id, productName, productSKU, productImage, price, marketPrice, quantity, privateStyle } = props;
|
||||
const discount = Math.ceil(100 - (price / marketPrice * 100));
|
||||
|
||||
const navigation = useNavigation();
|
||||
|
||||
return (
|
||||
<View style={[styles.itemProduct, privateStyle]}>
|
||||
<View style={styles.pBloxImgProduct}>
|
||||
<Text style={styles.pSkuProduct}>{productSKU}</Text>
|
||||
<Text style={styles.pDiscountProduct}>-{discount}%</Text>
|
||||
<View style={styles.pBloxImgProductBao}>
|
||||
<Pressable onPress={() => navigation.navigate('ProductDetail')} style={styles.pBloxImgProductBao}>
|
||||
<Image style={styles.pImgProduct} source={{ uri: productImage.large }} />
|
||||
</View>
|
||||
</Pressable>
|
||||
</View>
|
||||
<Text style={styles.pNameProduct} numberOfLines={2}>
|
||||
{productName}
|
||||
</Text>
|
||||
<TouchableOpacity onPress={() => navigation.navigate('ProductDetail')}>
|
||||
<Text style={styles.pNameProduct} numberOfLines={2}>
|
||||
{productName}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
<Text style={styles.priceProduct}>{formatCurrency(price)} đ</Text>
|
||||
<Text style={styles.oldPriceProduct}>{formatCurrency(marketPrice)} đ</Text>
|
||||
<View style={styles.pBottonProduct}>
|
||||
@@ -45,7 +45,9 @@ const ShowProductItem = (props: { id: number, productName: string, productSKU: s
|
||||
{quantity > 0 ? <Ionicons style={styles.pStatusProductIcon} name="checkmark-outline" size={13} /> : <Ionicons style={styles.pStatusProductIcon} name="close-outline" size={13} />}
|
||||
{quantity > 0 ? 'Còn hàng' : 'Hết hàng'}
|
||||
</Text>
|
||||
<Text style={styles.pCartProduct}><Ionicons style={styles.pCartProductIcon} name="cart-outline" size={13} />Giỏ hàng</Text>
|
||||
<TouchableOpacity onPress={() => navigation.navigate('cart')}>
|
||||
<Text style={styles.pCartProduct}><Ionicons style={styles.pCartProductIcon} name="cart-outline" size={13} />Giỏ hàng</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
@@ -92,7 +94,7 @@ const ItemComboSet = (props: { id: number, productName: string, productSKU: stri
|
||||
</View>
|
||||
</View>
|
||||
<View style={styles.pNameProductAll}>
|
||||
<Checkbox.IOS status={checked ? 'checked' : 'unchecked'} onPress={() => setChecked(!checked)} style={styles.inputComboCheck} />
|
||||
<Checkbox.IOS status={checked ? 'checked' : 'unchecked'} onPress={() => setChecked(!checked)} style={styles.inputComboCheck} />
|
||||
<Text style={[styles.pNameProduct, styles.pNameProductCombo]} numberOfLines={2}>
|
||||
{productName}
|
||||
</Text>
|
||||
|
||||
Reference in New Issue
Block a user