ordering-ui-react-native 0.15.80-release → 0.15.81-release
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,4 +1,4 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { Fade, Placeholder, PlaceholderLine } from 'rn-placeholder';
|
|
3
3
|
import {
|
|
4
4
|
BusinessController as BusinessSingleCard,
|
|
@@ -59,7 +59,6 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
59
59
|
const [, t] = useLanguage();
|
|
60
60
|
const theme = useTheme()
|
|
61
61
|
const [isIntersectionObserver, setIsIntersectionObserver] = useState(!enableIntersection)
|
|
62
|
-
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
63
62
|
|
|
64
63
|
const styles = StyleSheet.create({
|
|
65
64
|
headerStyle: {
|
|
@@ -146,23 +145,10 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
147
|
|
|
149
|
-
const fadeIn = () => {
|
|
150
|
-
Animated.timing(fadeAnim, {
|
|
151
|
-
toValue: 1,
|
|
152
|
-
duration: 500,
|
|
153
|
-
useNativeDriver: true
|
|
154
|
-
}).start();
|
|
155
|
-
};
|
|
156
|
-
|
|
157
148
|
const handleChangeInterSection = (inView: boolean) => {
|
|
158
149
|
setIsIntersectionObserver(inView)
|
|
159
|
-
fadeIn()
|
|
160
150
|
}
|
|
161
151
|
|
|
162
|
-
useEffect(() => {
|
|
163
|
-
if (!enableIntersection) fadeIn()
|
|
164
|
-
}, [enableIntersection])
|
|
165
|
-
|
|
166
152
|
return (
|
|
167
153
|
<InView style={{ minHeight: 200 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeInterSection(inView)}>
|
|
168
154
|
{isIntersectionObserver ? (
|
|
@@ -186,13 +172,6 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
186
172
|
</RibbonBox>
|
|
187
173
|
)}
|
|
188
174
|
<BusinessHero>
|
|
189
|
-
<Animated.View
|
|
190
|
-
style={[
|
|
191
|
-
{
|
|
192
|
-
opacity: fadeAnim
|
|
193
|
-
}
|
|
194
|
-
]}
|
|
195
|
-
>
|
|
196
175
|
<FastImage
|
|
197
176
|
style={{ height: 120 }}
|
|
198
177
|
source={{
|
|
@@ -201,7 +180,6 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
201
180
|
}}
|
|
202
181
|
resizeMode={FastImage.resizeMode.cover}
|
|
203
182
|
/>
|
|
204
|
-
</Animated.View>
|
|
205
183
|
{(businessFeatured ?? business?.featured) && (
|
|
206
184
|
<View style={styles.featured}>
|
|
207
185
|
<FontAwesomeIcon name="crown" size={26} color="gold" />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
useLanguage,
|
|
4
4
|
useConfig,
|
|
@@ -42,8 +42,6 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
42
42
|
const theme = useTheme();
|
|
43
43
|
const hideAddButton = theme?.business_view?.components?.products?.components?.add_to_cart_button?.hidden ?? true
|
|
44
44
|
|
|
45
|
-
const fadeAnim = useRef(new Animated.Value(enableIntersection ? 0 : 1)).current;
|
|
46
|
-
|
|
47
45
|
const styles = StyleSheet.create({
|
|
48
46
|
container: {
|
|
49
47
|
borderWidth: 1,
|
|
@@ -123,14 +121,6 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
123
121
|
maxCartProductConfig,
|
|
124
122
|
maxCartProductInventory,
|
|
125
123
|
);
|
|
126
|
-
|
|
127
|
-
const fadeIn = () => {
|
|
128
|
-
Animated.timing(fadeAnim, {
|
|
129
|
-
toValue: 1,
|
|
130
|
-
duration: 500,
|
|
131
|
-
useNativeDriver: true
|
|
132
|
-
}).start();
|
|
133
|
-
};
|
|
134
124
|
|
|
135
125
|
const handleChangeFavorite = () => {
|
|
136
126
|
if (auth) {
|
|
@@ -143,14 +133,9 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
143
133
|
const handleChangeIntersection = () => {
|
|
144
134
|
if (enableIntersection) {
|
|
145
135
|
setIsIntersectionObserver(true);
|
|
146
|
-
fadeIn();
|
|
147
136
|
}
|
|
148
137
|
}
|
|
149
138
|
|
|
150
|
-
useEffect(() => {
|
|
151
|
-
if (enableIntersection) fadeIn()
|
|
152
|
-
}, [enableIntersection])
|
|
153
|
-
|
|
154
139
|
return (
|
|
155
140
|
<InView style={{ minHeight: hideAddButton ? 125 : 165 }} triggerOnce={true} onChange={(inView: boolean) => handleChangeIntersection()}>
|
|
156
141
|
{isIntersectionObserver ? (
|
|
@@ -238,23 +223,14 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
238
223
|
</RibbonBox>
|
|
239
224
|
)}
|
|
240
225
|
{product?.images && (
|
|
241
|
-
<
|
|
242
|
-
style={
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
<FastImage
|
|
250
|
-
style={styles.productStyle}
|
|
251
|
-
source={{
|
|
252
|
-
uri: optimizeImage(product?.images, 'h_250,c_limit'),
|
|
253
|
-
priority: FastImage.priority.normal,
|
|
254
|
-
}}
|
|
255
|
-
resizeMode={FastImage.resizeMode.cover}
|
|
256
|
-
/>
|
|
257
|
-
</Animated.View>
|
|
226
|
+
<FastImage
|
|
227
|
+
style={styles.productStyle}
|
|
228
|
+
source={{
|
|
229
|
+
uri: optimizeImage(product?.images, 'h_250,c_limit'),
|
|
230
|
+
priority: FastImage.priority.normal,
|
|
231
|
+
}}
|
|
232
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
233
|
+
/>
|
|
258
234
|
)}
|
|
259
235
|
</LogoWrapper>
|
|
260
236
|
|