ordering-ui-react-native 0.22.22 → 0.22.23

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.22",
3
+ "version": "0.22.23",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -371,6 +371,10 @@ const AddressFormUI = (props: AddressFormParams) => {
371
371
  setToggleMap(!toggleMap);
372
372
  };
373
373
 
374
+ const showFieldWithTheme = (name) => {
375
+ return !theme?.address?.components?.[name]?.hidden
376
+ }
377
+
374
378
  useEffect(() => {
375
379
  if (
376
380
  orderState.loading &&
@@ -672,7 +676,7 @@ const AddressFormUI = (props: AddressFormParams) => {
672
676
  )}
673
677
 
674
678
  <View style={{ flexDirection: 'row', flexBasis: '50%' }}>
675
- {showField && showField('internal_number') && (
679
+ {((isRequiredField && isRequiredField('internal_number')) || showFieldWithTheme('internal_number')) && (
676
680
  <Controller
677
681
  control={control}
678
682
  name="internal_number"
@@ -708,7 +712,7 @@ const AddressFormUI = (props: AddressFormParams) => {
708
712
  isFocusHighlight
709
713
  style={{
710
714
  ...styles.inputsStyle,
711
- marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
715
+ marginRight: showField?.('internal_number') && showField?.('zipcode') ? 24 : 0
712
716
  }}
713
717
  forwardRef={internalNumberRef}
714
718
  returnKeyType="next"
@@ -719,7 +723,7 @@ const AddressFormUI = (props: AddressFormParams) => {
719
723
  />
720
724
  )}
721
725
 
722
- {showField && showField('zipcode') && (
726
+ {((isRequiredField && isRequiredField('zipcode')) || showFieldWithTheme('zipcode')) && (
723
727
  <Controller
724
728
  control={control}
725
729
  name="zipcode"
@@ -764,7 +768,7 @@ const AddressFormUI = (props: AddressFormParams) => {
764
768
  )}
765
769
  </View>
766
770
 
767
- {showField && showField('address_notes') && (
771
+ {((isRequiredField && isRequiredField('address_notes')) || showFieldWithTheme('address_notes')) && (
768
772
  <Controller
769
773
  control={control}
770
774
  name="address_notes"
@@ -62,6 +62,7 @@ export const Home = (props: any) => {
62
62
  bgColor={theme.colors.primaryContrast}
63
63
  borderColor={theme.colors.primaryContrast}
64
64
  style={styles.buttons}
65
+ textStyle={{ color: 'black' }}
65
66
  onClick={() => onNavigationRedirect('Signup')}
66
67
  imgRightSrc={null}
67
68
  />
@@ -39,6 +39,11 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
39
39
  } = props
40
40
 
41
41
  const theme = useTheme();
42
+ const hideProductImage = isFromCheckout
43
+ ? theme?.checkout?.components?.cart?.components?.product?.components?.image?.hidden
44
+ : theme?.confirmation?.components?.cart?.components?.products?.components?.photo?.hidden
45
+
46
+ const hideProductCommentHide = isFromCheckout && theme?.checkout?.components?.cart?.components?.product?.components?.comments?.hidden
42
47
 
43
48
  const pickerStyle = StyleSheet.create({
44
49
  inputAndroid: {
@@ -157,7 +162,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
157
162
  >
158
163
  <View style={{ flexDirection: 'row', alignItems: 'flex-start' }}>
159
164
  <ContentInfo>
160
- {(product?.images || theme?.images?.dummies?.product) && (
165
+ {(product?.images || theme?.images?.dummies?.product) && !hideProductImage && (
161
166
  <ProductImage>
162
167
  {isFromCheckout ? (
163
168
  product?.images ? (
@@ -312,7 +317,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
312
317
  ))}
313
318
  </ProductOptionsList>
314
319
  )}
315
- {!!product.comment && (
320
+ {!!product.comment && !hideProductCommentHide && (
316
321
  <ProductComment>
317
322
  <OText size={10} color={theme.colors.textSecondary}>{t('SPECIAL_COMMENT', 'Special Comment')}</OText>
318
323
  <OText size={10} color={theme.colors.textThird}>{product.comment}</OText>