ordering-ui-react-native 0.21.63 → 0.21.64

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.21.63",
3
+ "version": "0.21.64",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -76,7 +76,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
76
76
  const hideBusinessFavoriteBadge = theme?.business_listing_view?.components?.business?.components?.featured_badge?.hidden
77
77
 
78
78
  const textSize = 12
79
- const cardHeight = windowHeight * 0.3
79
+ const cardHeight = windowHeight * 0.34
80
80
 
81
81
  const styles = StyleSheet.create({
82
82
  container: {
@@ -256,7 +256,7 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
256
256
  </BusinessState>
257
257
  </BusinessHero>
258
258
  <BusinessContent>
259
- <BusinessInfo style={{ position: 'absolute', bottom: 85, left: 15 }}>
259
+ <BusinessInfo style={{ position: 'absolute', top: -26, left: 15 }}>
260
260
  {!hideBusinessLogo && (
261
261
  <BusinessLogo style={styles.businessLogo}>
262
262
  <FastImage
@@ -8,13 +8,14 @@ export const BusinessHero = styled.View`
8
8
  `
9
9
 
10
10
  export const BusinessContent = styled.View`
11
- padding-horizontal: 18px;
12
- padding-bottom: 10px;
13
- border-bottom-left-radius: 7.6px;
14
- border-bottom-right-radius: 7.6px;
15
- border-width: 1px;
16
- border-color: ${(props: any) => props.theme.colors.border};
17
- overflow: visible;
11
+ position: relative;
12
+ padding-horizontal: 18px;
13
+ padding-bottom: 10px;
14
+ border-bottom-left-radius: 7.6px;
15
+ border-bottom-right-radius: 7.6px;
16
+ border-width: 1px;
17
+ border-color: ${(props: any) => props.theme.colors.border};
18
+ overflow: visible;
18
19
  `;
19
20
 
20
21
  export const BusinessInfo = styled.View`
@@ -196,6 +196,14 @@ const CartUI = (props: any) => {
196
196
  return acc = acc
197
197
  }, cart?.subtotal)
198
198
 
199
+ const handleClickCheckout = () => {
200
+ if (cart?.business_id) {
201
+ setOpenUpselling(true)
202
+ } else {
203
+ handleUpsellingPage(cart)
204
+ }
205
+ }
206
+
199
207
  useEffect(() => {
200
208
  const limitDays = parseInt(preorderMaximumDays ?? configs?.max_days_preorder?.value, 10)
201
209
  const currentDate = new Date()
@@ -232,7 +240,7 @@ const CartUI = (props: any) => {
232
240
  handleCartOpen={handleCartOpen}
233
241
  onNavigationRedirect={props.onNavigationRedirect}
234
242
  handleChangeStore={() => setOpenChangeStore(true)}
235
- handleClickCheckout={() => setOpenUpselling(true)}
243
+ handleClickCheckout={() => handleClickCheckout()}
236
244
  checkoutButtonDisabled={(openUpselling && !canOpenUpselling) || subtotalWithTaxes < cart?.minimum || !cart?.valid_address}
237
245
  isMultiCheckout={isMultiCheckout}
238
246
  isFromUpselling={isFromUpselling}
@@ -549,7 +557,7 @@ const CartUI = (props: any) => {
549
557
  borderColor={theme.colors.primary}
550
558
  imgRightSrc={null}
551
559
  textStyle={{ color: '#fff', textAlign: 'center', flex: 1 }}
552
- onClick={() => setOpenUpselling(true)}
560
+ onClick={() => handleClickCheckout()}
553
561
  style={{ width: '100%', flexDirection: 'row', justifyContent: 'center', borderRadius: 7.6, shadowOpacity: 0 }}
554
562
  />
555
563
  </CheckoutAction>
@@ -56,7 +56,7 @@ const HighestRatedBusinessesUI = (props: HighestRatedBusinessesParams) => {
56
56
  showsHorizontalScrollIndicator={false}
57
57
  nestedScrollEnabled
58
58
  horizontal
59
- style={{ height: 300, paddingHorizontal: 20 }}
59
+ style={{ height: 325, paddingHorizontal: 20 }}
60
60
  >
61
61
  {[
62
62
  ...Array(10).keys()
@@ -40,19 +40,19 @@ export const Otp = (props: otpParams) => {
40
40
  onSubmit()
41
41
  }
42
42
 
43
- const handleChangeCode = (code : string) => {
43
+ const handleChangeCode = (code: string) => {
44
44
  if (code?.length === pinCount) {
45
- setCheckingCode(true)
45
+ setCheckingCode && setCheckingCode(true)
46
46
  handleLoginOtp(code)
47
47
  inputRef.current?.reset && inputRef.current.reset()
48
48
  setTimeout(() => inputRef.current?.focus && inputRef.current.focus(), 100)
49
49
  }
50
- setOtpError(null)
50
+ setOtpError && setOtpError(null)
51
51
  }
52
52
 
53
53
  const handleCloseOtp = () => {
54
54
  setWillVerifyOtpState(false)
55
- setOtpError(null)
55
+ setOtpError && setOtpError(null)
56
56
  }
57
57
 
58
58
  useEffect(() => {
@@ -108,18 +108,6 @@ export const Otp = (props: otpParams) => {
108
108
  return (
109
109
  <SafeAreaView style={{ flex: 1, backgroundColor: theme.colors.backgroundPage }}>
110
110
  <OTPContainer>
111
- <View
112
- style={loginStyle.closeContainer}>
113
- <TouchableOpacity onPress={() => handleCloseOtp()} style={loginStyle.wrapperIcon}>
114
- <OIcon
115
- src={theme.images.general.close}
116
- width={22}
117
- />
118
- </TouchableOpacity>
119
- <OText size={22}>
120
- {t('ENTER_VERIFICATION_CODE', 'Enter verification code')}
121
- </OText>
122
- </View>
123
111
  <OText size={24}>
124
112
  {formatSeconds(otpLeftTime)}
125
113
  </OText>