ordering-ui-react-native 0.16.25 → 0.16.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-react-native",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.28",
|
|
4
4
|
"description": "Reusable components made in react native",
|
|
5
5
|
"main": "src/index.tsx",
|
|
6
6
|
"author": "ordering.inc",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"react-native-tracking-transparency": "^0.1.1",
|
|
113
113
|
"react-native-uuid": "^2.0.1",
|
|
114
114
|
"react-native-vector-icons": "^7.1.0",
|
|
115
|
-
"react-native-webview": "^11.
|
|
115
|
+
"react-native-webview": "^11.22.7",
|
|
116
116
|
"react-native-youtube-iframe": "^2.2.2",
|
|
117
117
|
"rn-placeholder": "^3.0.3",
|
|
118
118
|
"styled-components": "^5.1.1",
|
|
@@ -153,7 +153,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
153
153
|
{(
|
|
154
154
|
productInfo?.()?.ingredients?.length > 0 ||
|
|
155
155
|
productInfo?.()?.options?.length > 0 ||
|
|
156
|
-
product.comment
|
|
156
|
+
!!product.comment
|
|
157
157
|
) && !isClickableEvent && (
|
|
158
158
|
<MaterialCommunityIcon name="chevron-down" size={12} />
|
|
159
159
|
)}
|
|
@@ -278,7 +278,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
278
278
|
</ProductOptionsList>
|
|
279
279
|
)}
|
|
280
280
|
|
|
281
|
-
{product.comment && (
|
|
281
|
+
{!!product.comment && (
|
|
282
282
|
<ProductComment>
|
|
283
283
|
<OText
|
|
284
284
|
size={12}
|
|
@@ -9,13 +9,20 @@ import {
|
|
|
9
9
|
import { useTheme } from 'styled-components/native';
|
|
10
10
|
import { SingleProductCardParams } from '../../types';
|
|
11
11
|
import { CardContainer, CardInfo, SoldOut, QuantityContainer, PricesContainer, RibbonBox, LogoWrapper } from './styles';
|
|
12
|
-
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
13
|
-
import { OText
|
|
12
|
+
import { StyleSheet, View, TouchableOpacity, Image } from 'react-native';
|
|
13
|
+
import { OText } from '../shared';
|
|
14
14
|
import FastImage from 'react-native-fast-image'
|
|
15
15
|
import IconAntDesign from 'react-native-vector-icons/AntDesign'
|
|
16
16
|
import { shape } from '../../utils';
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
function SingleProductCardPropsAreEqual(prevProps: any, nextProps: any) {
|
|
19
|
+
return JSON.stringify(prevProps.product) === JSON.stringify(nextProps.product) &&
|
|
20
|
+
prevProps.isSoldOut === nextProps.isSoldOut &&
|
|
21
|
+
prevProps.productAddedToCartLength === nextProps.productAddedToCartLength &&
|
|
22
|
+
prevProps.categoryState === nextProps.categoryState
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const SinguleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
19
26
|
const {
|
|
20
27
|
product,
|
|
21
28
|
isSoldOut,
|
|
@@ -188,9 +195,13 @@ const SinguleProductCardUI = (props: SingleProductCardParams) => {
|
|
|
188
195
|
resizeMode={FastImage.resizeMode.cover}
|
|
189
196
|
/>
|
|
190
197
|
) : (
|
|
191
|
-
<
|
|
192
|
-
src={theme?.images?.dummies?.product}
|
|
198
|
+
<FastImage
|
|
193
199
|
style={styles.productStyle}
|
|
200
|
+
source={{
|
|
201
|
+
uri: Image.resolveAssetSource(theme.images.dummies.product).uri,
|
|
202
|
+
priority: FastImage.priority.normal,
|
|
203
|
+
}}
|
|
204
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
194
205
|
/>
|
|
195
206
|
)}
|
|
196
207
|
</LogoWrapper>
|
|
@@ -204,7 +215,7 @@ const SinguleProductCardUI = (props: SingleProductCardParams) => {
|
|
|
204
215
|
)}
|
|
205
216
|
</CardContainer>
|
|
206
217
|
);
|
|
207
|
-
};
|
|
218
|
+
}, SingleProductCardPropsAreEqual);
|
|
208
219
|
|
|
209
220
|
export const SingleProductCard = (props: SingleProductCardParams) => {
|
|
210
221
|
const singleProductCardProps = {
|