ordering-ui-react-native 0.22.38 → 0.22.39

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.22.38",
3
+ "version": "0.22.39",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -859,8 +859,9 @@ const AddressFormUI = (props: AddressFormParams) => {
859
859
  ) : (
860
860
  <OButton
861
861
  text={t('CANCEL', 'Cancel')}
862
- bgColor={theme.colors.white}
863
- borderColor={theme.colors.primary}
862
+ bgColor={theme.colors.secundary}
863
+ borderColor={theme.colors.secundary}
864
+ textStyle={{ color: theme.colors.black }}
864
865
  style={{ borderRadius: 7.6, borderWidth: 1, shadowOpacity: 0 }}
865
866
  onClick={() => navigation?.canGoBack() && navigation.goBack()}
866
867
  />
@@ -887,6 +888,8 @@ const AddressFormUI = (props: AddressFormParams) => {
887
888
  <OButton
888
889
  text={t('SAVE', 'Save')}
889
890
  textStyle={{ color: theme.colors.white }}
891
+ bgColor={theme.colors.primary}
892
+ borderColor={theme.colors.primary}
890
893
  imgRightSrc={null}
891
894
  style={{ marginHorizontal: 30, marginBottom: 10 }}
892
895
  onClick={() => setSaveMapLocation(true)}
@@ -620,13 +620,15 @@ const CheckoutUI = (props: any) => {
620
620
  <OButton
621
621
  text={t('SIGN_UP', 'Sign up')}
622
622
  textStyle={{ color: theme.colors.white }}
623
+ bgColor={theme.colors.primary}
624
+ borderColor={theme.colors.primary}
623
625
  style={{ borderRadius: 7.6, marginTop: 20 }}
624
626
  onClick={() => setOpenModal({ ...openModal, signup: true })}
625
627
  />
626
628
  <OButton
627
629
  text={t('LOGIN', 'Login')}
628
- textStyle={{ color: theme.colors.primary }}
629
- bgColor={theme.colors.white}
630
+ textStyle={{ color: theme.colors.white }}
631
+ bgColor={theme.colors.primary}
630
632
  borderColor={theme.colors.primary}
631
633
  style={{ borderRadius: 7.6, marginTop: 20 }}
632
634
  onClick={() => setOpenModal({ ...openModal, login: true })}
@@ -5,7 +5,7 @@ import { TouchableOpacity, View } from 'react-native'
5
5
  import { OButton, OText } from '../shared';
6
6
  import { Placeholder, PlaceholderLine, Fade } from 'rn-placeholder';
7
7
 
8
- export const ActionButton = (props : any) => {
8
+ export const ActionButton = (props: any) => {
9
9
  const {
10
10
  navigation,
11
11
  isHaveWeight,
@@ -23,18 +23,20 @@ export const ActionButton = (props : any) => {
23
23
  handleUpdateGuest,
24
24
  actionStatus
25
25
  } = props
26
- const [,t] = useLanguage()
26
+ const [, t] = useLanguage()
27
27
  const [{ auth }] = useSession()
28
28
  const [orderState] = useOrder()
29
29
  const theme = useTheme()
30
- const [{ configs }] = useConfig()
30
+ const [{ configs }] = useConfig()
31
31
  const unaddressedTypes = configs?.unaddressed_order_types_allowed?.value.split('|').map((value: any) => Number(value)) || []
32
- const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
33
-
32
+ const isAllowUnaddressOrderType = unaddressedTypes.includes(orderState?.options?.type)
34
33
  const saveErrors =
35
- orderState.loading ||
36
- maxProductQuantity === 0 ||
37
- Object.keys(errors)?.length > 0;
34
+ orderState.loading ||
35
+ maxProductQuantity === 0 ||
36
+ Object.keys(errors)?.length > 0;
37
+ const buttonColor = saveErrors || isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order))
38
+
39
+
38
40
 
39
41
  return (
40
42
  <View
@@ -60,9 +62,9 @@ export const ActionButton = (props : any) => {
60
62
  color: saveErrors || isSoldOut || maxProductQuantity <= 0 ? theme.colors.primary : theme.colors.white,
61
63
  fontSize: orderState.loading || editMode ? 10 : 14
62
64
  }}
65
+ bgColor={buttonColor ? theme.colors.lightGray : theme.colors.primary}
66
+ borderColor={!buttonColor ? theme.colors.white : theme.colors.primary}
63
67
  style={{
64
- backgroundColor: saveErrors || isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order)) ? theme.colors.lightGray : theme.colors.primary,
65
- borderColor: saveErrors || isSoldOut || maxProductQuantity <= 0 || (product?.minimum_per_order && ((productCart?.quantity + productAddedToCartLength) < product?.minimum_per_order)) || (product?.maximum_per_order && ((productCart?.quantity + productAddedToCartLength) > product?.maximum_per_order)) ? theme.colors.white : theme.colors.primary,
66
68
  opacity: saveErrors || isSoldOut || maxProductQuantity <= 0 ? 0.3 : 1,
67
69
  borderRadius: 7.6,
68
70
  height: 44,
@@ -20,7 +20,7 @@ import IconAntDesign from 'react-native-vector-icons/AntDesign';
20
20
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
21
21
  import { UpsellingLayout } from './UpsellingLayout';
22
22
 
23
- export const UpsellingContent = (props : any) => {
23
+ export const UpsellingContent = (props: any) => {
24
24
  const {
25
25
  onGoBack,
26
26
  handleUpsellingPage,
@@ -44,12 +44,10 @@ export const UpsellingContent = (props : any) => {
44
44
  const commentDelayTime = isChewLayout ? 500 : null
45
45
 
46
46
  const cartList = (carts && Object.values(carts).filter((_cart: any) => _cart?.products?.length > 0 && _cart.uuid !== cart?.uuid)) || []
47
-
47
+
48
48
  const styles = StyleSheet.create({
49
49
  closeUpsellingButton: {
50
50
  borderRadius: 7.6,
51
- borderColor: theme.colors.primary,
52
- backgroundColor: theme.colors.primary,
53
51
  borderWidth: 1,
54
52
  alignSelf: 'center',
55
53
  height: 44,
@@ -160,8 +158,10 @@ export const UpsellingContent = (props : any) => {
160
158
  <OButton
161
159
  imgRightSrc=''
162
160
  text={t('CHECKOUT', 'Checkout')}
163
- style={{ ...styles.closeUpsellingButton }}
164
161
  textStyle={{ color: theme.colors.white, fontSize: 14 }}
162
+ bgColor={theme.colors.primary}
163
+ borderColor={theme.colors.primary}
164
+ style={{ ...styles.closeUpsellingButton }}
165
165
  onClick={() => handleUpsellingPage(cart)}
166
166
  />
167
167
  </View>