ordering-ui-react-native 0.17.32 → 0.17.34

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.17.32",
3
+ "version": "0.17.34",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -36,6 +36,7 @@ export const MyOrders = (props: any) => {
36
36
  { key: 'products', value: t('PRODUCTS', 'Products') }
37
37
  ]
38
38
  const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
39
+ const showNavbar = theme?.bar_menu?.components?.orders?.hidden
39
40
 
40
41
  const goToBack = () => navigation?.canGoBack() && navigation.goBack()
41
42
 
@@ -72,47 +73,48 @@ export const MyOrders = (props: any) => {
72
73
  onRefresh={() => handleOnRefresh()}
73
74
  />
74
75
  }>
75
- {isChewLayout && (
76
+ {(isChewLayout || showNavbar) && (
76
77
  <View style={{
77
78
  width: '100%',
78
79
  display: 'flex',
79
80
  flexDirection: 'row',
80
81
  alignItems: 'center',
81
- paddingHorizontal: 40
82
+ paddingHorizontal: 40,
83
+ marginTop: Platform.OS === 'android' ? 50 : 30,
82
84
  }}>
85
+ <OButton
86
+ imgLeftStyle={{ width: 18 }}
87
+ imgRightSrc={null}
88
+ style={{
89
+ borderWidth: 0,
90
+ width: 26,
91
+ height: 26,
92
+ backgroundColor: '#FFF',
93
+ borderColor: '#FFF',
94
+ shadowColor: '#FFF',
95
+ paddingLeft: 0,
96
+ paddingRight: 0
97
+ }}
98
+ onClick={goToBack}
99
+ icon={AntDesignIcon}
100
+ iconProps={{
101
+ name: 'arrowleft',
102
+ size: 26
103
+ }}
104
+ />
83
105
  <OText
84
106
  size={24}
85
107
  style={{
86
- marginTop: Platform.OS === 'android' ? 50 : 30,
87
- paddingHorizontal: 20,
88
- textTransform: 'capitalize'
108
+ textTransform: 'capitalize',
109
+ marginLeft: 20,
110
+ top: 2
89
111
  }}
90
112
  >
91
- <OButton
92
- imgLeftStyle={{ width: 18 }}
93
- imgRightSrc={null}
94
- style={{
95
- borderWidth: 0,
96
- width: 26,
97
- height: 26,
98
- backgroundColor: '#FFF',
99
- borderColor: '#FFF',
100
- shadowColor: '#FFF',
101
- paddingLeft: 0,
102
- paddingRight: 0,
103
- }}
104
- onClick={goToBack}
105
- icon={AntDesignIcon}
106
- iconProps={{
107
- name: 'arrowleft',
108
- size: 26
109
- }}
110
- />
111
113
  {t('MY_ORDERS', 'My Orders')}
112
114
  </OText>
113
115
  </View>
114
116
  )}
115
- {!hideOrders && !isChewLayout && (
117
+ {!hideOrders && !isChewLayout && !showNavbar && (
116
118
  <HeaderTitle text={t('MY_ORDERS', 'My Orders')} />
117
119
  )}
118
120
  {!allEmpty && (
@@ -9,7 +9,7 @@ const TitleWrapper = styled.View`
9
9
  padding-horizontal: 10px;
10
10
  `
11
11
  const TitleTopWrapper = styled.View`
12
- flex-grow: 1;
12
+ flex: 1;
13
13
  flex-direction: row;
14
14
  align-items: center;
15
15
  `
@@ -40,7 +40,8 @@ interface Props {
40
40
  style?: ViewStyle,
41
41
  titleWrapStyle?: ViewStyle,
42
42
  paddingTop?: number,
43
- isVertical?: boolean
43
+ isVertical?: boolean,
44
+ noMargin?: any
44
45
  }
45
46
 
46
47
  const NavBar = (props: Props) => {
@@ -96,10 +97,9 @@ const NavBar = (props: Props) => {
96
97
  style={
97
98
  {
98
99
  textAlign: props.titleAlign ? props.titleAlign : 'center',
99
- marginRight: props.showCall ? 0 : 40,
100
+ marginRight: (props.showCall || !!props.noMargin) ? 0 : 40,
100
101
  color: props.titleColor || theme.colors.textNormal,
101
102
  paddingHorizontal: props.titleAlign == 'left' ? 12 : 0,
102
- width: '100%',
103
103
  ...props.titleStyle,
104
104
  }
105
105
  }
@@ -101,6 +101,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
101
101
  title={t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will your order type?')}
102
102
  titleAlign={'center'}
103
103
  titleStyle={{ fontSize: 14 }}
104
+ noMargin
104
105
  />
105
106
  {
106
107
  items.length > 0 && (
@@ -173,7 +173,8 @@ const SingleOrderCardUI = (props: SingleOrderCardParams) => {
173
173
  {(!!order.business?.logo || theme?.images?.dummies?.businessLogo) && (
174
174
  <Logo style={styles.logoWrapper}>
175
175
  <OIcon
176
- url={optimizeImage(order.business?.logo || theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
176
+ url={optimizeImage(order.business?.logo, 'h_300,c_limit')}
177
+ src={optimizeImage(!order.business?.logo && theme?.images?.dummies?.businessLogo, 'h_300,c_limit')}
177
178
  style={styles.logo}
178
179
  />
179
180
  </Logo>
@@ -114,7 +114,6 @@ const ProfileListUI = (props: ProfileParams) => {
114
114
  const [confirm, setConfirm] = useState<any>({ open: false, content: null, handleOnAccept: null, id: null, title: null })
115
115
  const isWalletEnabled = configs?.cash_wallet?.value && configs?.wallet_enabled?.value === '1' && (configs?.wallet_cash_enabled?.value === '1' || configs?.wallet_credit_point_enabled?.value === '1')
116
116
  const IsPromotionsEnabled = configs?.advanced_offers_module?.value === '1' || configs?.advanced_offers_module?.value === true
117
- const isChewLayout = theme?.business_view?.components?.header?.components?.layout?.type === 'chew'
118
117
  const onRedirect = (route: string, params?: any) => {
119
118
  navigation.navigate(route, params)
120
119
  }
@@ -200,12 +199,10 @@ const ProfileListUI = (props: ProfileParams) => {
200
199
  <MessageCircle name='message1' style={styles.messageIconStyle} color={theme.colors.textNormal} />
201
200
  <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MESSAGES', 'Messages')}</OText>
202
201
  </ListItem>
203
- {isChewLayout && (
204
- <ListItem onPress={() => onRedirect('MyOrders', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
205
- <FontAwesome name='list-alt' style={styles.messageIconStyle} color={theme.colors.textNormal} />
206
- <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MY_ORDERS', 'My Orders')}</OText>
207
- </ListItem>
208
- )}
202
+ <ListItem onPress={() => onRedirect('MyOrders', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
203
+ <FontAwesome name='list-alt' style={styles.messageIconStyle} color={theme.colors.textNormal} />
204
+ <OText size={14} lineHeight={24} weight={'400'} color={theme.colors.textNormal}>{t('MY_ORDERS', 'My Orders')}</OText>
205
+ </ListItem>
209
206
  {isWalletEnabled && (
210
207
  <ListItem onPress={() => onRedirect('Wallets', { isFromProfile: true, isGoBack: true })} activeOpacity={0.7}>
211
208
  <Ionicons name='wallet-outline' style={styles.messageIconStyle} color={theme.colors.textNormal} />