Loading packages/shop-mobile-expo/src/components/Common/ProductItem/List.tsx +4 −8 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ import { Avatar, Title, Text, Button } from 'react-native-paper'; import Ionicons from '@expo/vector-icons/Ionicons'; // TYPES import type { ProductItemType } from './index'; import type { PropsItemInterface } from './index'; // STYLES import { Loading @@ -15,12 +15,7 @@ import { CONSTANT_COLOR as CC, } from '../../../assets/ts/styles'; export interface Props { data: ProductItemType['data']; onPressProfile: () => any; } const ProductItemList: React.FC<Props> = (props) => { const ProductItemList: React.FC<PropsItemInterface> = (props) => { // LOCAL STYLES const STYLES = StyleSheet.create({ container: { Loading Loading @@ -137,7 +132,8 @@ const ProductItemList: React.FC<Props> = (props) => { labelStyle={{ ...GS.FF_NunitoSemiBold, color: CC.light, }}> }} onPress={props.onPressDetails}> Details </Button> </View> Loading packages/shop-mobile-expo/src/components/Common/ProductItem/Slide.tsx +4 −9 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ import { Avatar, Title, Text, Button } from 'react-native-paper'; import Ionicons from '@expo/vector-icons/Ionicons'; // TYPES import type { ProductItemType } from '.'; import type { PropsItemInterface } from '.'; // STYLES import { Loading @@ -15,13 +15,7 @@ import { CONSTANT_COLOR as CC, } from '../../../assets/ts/styles'; // LOCAL TYPES export interface Props { data: ProductItemType['data']; onPressProfile: () => any; } const ProductItemSlide: React.FC<Props> = (props) => { const ProductItemSlide: React.FC<PropsItemInterface> = (props) => { // DATA const AVATAR_WAREHOUSE_SIZE = CS.FONT_SIZE_XLG * 2.5; Loading Loading @@ -198,7 +192,8 @@ const ProductItemSlide: React.FC<Props> = (props) => { labelStyle={{ ...GS.FF_NunitoSemiBold, color: CC.light, }}> }} onPress={props.onPressDetails}> Details </Button> </View> Loading packages/shop-mobile-expo/src/components/Common/ProductItem/index.tsx +27 −9 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ import ProductItemVertical from './List'; import ProductItemHorizontal from './Slide'; // LOCAL TYPES export interface ProductItemType { export interface ProductItemInterface { data: { warehouseId: string; warehouseLogo?: string; Loading @@ -26,17 +26,22 @@ export interface ProductItemType { type: ENV['PRODUCTS_VIEW_TYPE']; } const ProductItem: React.FC<ProductItemType> = (props) => { export interface PropsItemInterface { data: ProductItemInterface['data']; onPressProfile: () => any; onPressDetails: () => any; } const ProductItem: React.FC<ProductItemInterface> = (props) => { // NAVIGATION const NAVIGATION = useNavigation(); // DATA // FUNCTIONS const onPressProfile = () => { const ROUTE_WAREHOUSE_ID = { warehouseId: props?.data.warehouseId, }; // FUNCTIONS const onPressProfile = () => { if (!isEmpty(ROUTE_WAREHOUSE_ID.warehouseId)) { NAVIGATION.navigate( 'DRAWER/IN_STORE' as never, Loading @@ -45,17 +50,30 @@ const ProductItem: React.FC<ProductItemType> = (props) => { } }; const onPressDetails = () => { const ROUTE_PRODUCT_ID = { productId: props?.data.productId, }; if (!isEmpty(ROUTE_PRODUCT_ID.productId)) { NAVIGATION.navigate( 'DRAWER/PRODUCT_DETAILS' as never, ROUTE_PRODUCT_ID as never, ); } }; switch (props.type) { case 'list': return ( <ProductItemVertical {...{ data: props.data, onPressProfile }} {...{ data: props.data, onPressProfile, onPressDetails }} /> ); case 'slides': return ( <ProductItemHorizontal {...{ data: props.data, onPressProfile }} {...{ data: props.data, onPressProfile, onPressDetails }} /> ); default: Loading Loading
packages/shop-mobile-expo/src/components/Common/ProductItem/List.tsx +4 −8 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ import { Avatar, Title, Text, Button } from 'react-native-paper'; import Ionicons from '@expo/vector-icons/Ionicons'; // TYPES import type { ProductItemType } from './index'; import type { PropsItemInterface } from './index'; // STYLES import { Loading @@ -15,12 +15,7 @@ import { CONSTANT_COLOR as CC, } from '../../../assets/ts/styles'; export interface Props { data: ProductItemType['data']; onPressProfile: () => any; } const ProductItemList: React.FC<Props> = (props) => { const ProductItemList: React.FC<PropsItemInterface> = (props) => { // LOCAL STYLES const STYLES = StyleSheet.create({ container: { Loading Loading @@ -137,7 +132,8 @@ const ProductItemList: React.FC<Props> = (props) => { labelStyle={{ ...GS.FF_NunitoSemiBold, color: CC.light, }}> }} onPress={props.onPressDetails}> Details </Button> </View> Loading
packages/shop-mobile-expo/src/components/Common/ProductItem/Slide.tsx +4 −9 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ import { Avatar, Title, Text, Button } from 'react-native-paper'; import Ionicons from '@expo/vector-icons/Ionicons'; // TYPES import type { ProductItemType } from '.'; import type { PropsItemInterface } from '.'; // STYLES import { Loading @@ -15,13 +15,7 @@ import { CONSTANT_COLOR as CC, } from '../../../assets/ts/styles'; // LOCAL TYPES export interface Props { data: ProductItemType['data']; onPressProfile: () => any; } const ProductItemSlide: React.FC<Props> = (props) => { const ProductItemSlide: React.FC<PropsItemInterface> = (props) => { // DATA const AVATAR_WAREHOUSE_SIZE = CS.FONT_SIZE_XLG * 2.5; Loading Loading @@ -198,7 +192,8 @@ const ProductItemSlide: React.FC<Props> = (props) => { labelStyle={{ ...GS.FF_NunitoSemiBold, color: CC.light, }}> }} onPress={props.onPressDetails}> Details </Button> </View> Loading
packages/shop-mobile-expo/src/components/Common/ProductItem/index.tsx +27 −9 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ import ProductItemVertical from './List'; import ProductItemHorizontal from './Slide'; // LOCAL TYPES export interface ProductItemType { export interface ProductItemInterface { data: { warehouseId: string; warehouseLogo?: string; Loading @@ -26,17 +26,22 @@ export interface ProductItemType { type: ENV['PRODUCTS_VIEW_TYPE']; } const ProductItem: React.FC<ProductItemType> = (props) => { export interface PropsItemInterface { data: ProductItemInterface['data']; onPressProfile: () => any; onPressDetails: () => any; } const ProductItem: React.FC<ProductItemInterface> = (props) => { // NAVIGATION const NAVIGATION = useNavigation(); // DATA // FUNCTIONS const onPressProfile = () => { const ROUTE_WAREHOUSE_ID = { warehouseId: props?.data.warehouseId, }; // FUNCTIONS const onPressProfile = () => { if (!isEmpty(ROUTE_WAREHOUSE_ID.warehouseId)) { NAVIGATION.navigate( 'DRAWER/IN_STORE' as never, Loading @@ -45,17 +50,30 @@ const ProductItem: React.FC<ProductItemType> = (props) => { } }; const onPressDetails = () => { const ROUTE_PRODUCT_ID = { productId: props?.data.productId, }; if (!isEmpty(ROUTE_PRODUCT_ID.productId)) { NAVIGATION.navigate( 'DRAWER/PRODUCT_DETAILS' as never, ROUTE_PRODUCT_ID as never, ); } }; switch (props.type) { case 'list': return ( <ProductItemVertical {...{ data: props.data, onPressProfile }} {...{ data: props.data, onPressProfile, onPressDetails }} /> ); case 'slides': return ( <ProductItemHorizontal {...{ data: props.data, onPressProfile }} {...{ data: props.data, onPressProfile, onPressDetails }} /> ); default: Loading