ordering-ui-react-native 0.17.4 → 0.17.5

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.4",
3
+ "version": "0.17.5",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -68,7 +68,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
68
68
 
69
69
  const [, t] = useLanguage()
70
70
  const [orderState] = useOrder()
71
- const [{ parsePrice, optimizeImage }] = useUtils()
71
+ const [{ parsePrice, optimizeImage, parseDate }] = useUtils()
72
72
 
73
73
  const [isActive, setActiveState] = useState(false)
74
74
  // const [setHeight, setHeightState] = useState({ height: new Animated.Value(0) })
@@ -152,31 +152,44 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
152
152
  )}
153
153
  </ProductImage>
154
154
  )}
155
- {isCartProduct && !isCartPending && getProductMax && (
156
- <ProductInfo>
157
- <RNPickerSelect
158
- items={productOptions}
159
- onValueChange={handleChangeQuantity}
160
- value={product.quantity.toString()}
161
- style={pickerStyle}
162
- useNativeAndroidPickerStyle={false}
163
- placeholder={{}}
164
- Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
165
- disabled={orderState.loading}
166
- />
167
- </ProductInfo>
168
- )}
169
- {isFromCheckout && (
170
- <ProductQuantity>
171
- <OText size={12} lineHeight={18}>
172
- {product?.quantity}
155
+ {!!product?.calendar_event ? (
156
+ <View style={{ flex: 1, marginLeft: 10, flexDirection: 'column' }}>
157
+ <View>
158
+ <OText size={12} lineHeight={18} weight={'400'} numberOfLines={1}>{product?.name}</OText>
159
+ </View>
160
+ <OText size={10} color={theme.colors.textSecondary} style={{ marginTop: 3 }}>
161
+ {parseDate(product?.calendar_event?.start, { outputFormat: 'hh:mm a' })} - {parseDate(product?.calendar_event?.end, { outputFormat: 'hh:mm a' })}
173
162
  </OText>
174
- </ProductQuantity>
163
+ </View>
164
+ ): (
165
+ <>
166
+ {isCartProduct && !isCartPending && getProductMax && (
167
+ <ProductInfo>
168
+ <RNPickerSelect
169
+ items={productOptions}
170
+ onValueChange={handleChangeQuantity}
171
+ value={product.quantity.toString()}
172
+ style={pickerStyle}
173
+ useNativeAndroidPickerStyle={false}
174
+ placeholder={{}}
175
+ Icon={() => <View style={pickerStyle.icon}><OIcon src={theme.images.general.arrow_down} color={theme.colors.textNormal} width={8} /></View>}
176
+ disabled={orderState.loading}
177
+ />
178
+ </ProductInfo>
179
+ )}
180
+ {isFromCheckout && (
181
+ <ProductQuantity>
182
+ <OText size={12} lineHeight={18}>
183
+ {product?.quantity}
184
+ </OText>
185
+ </ProductQuantity>
186
+ )}
187
+ <View style={{ flex: 1 }}>
188
+ <OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
189
+ </View>
190
+ </>
175
191
  )}
176
- <View style={{ flex: 1 }}>
177
- <OText size={12} lineHeight={18} weight={'400'}>{product.name}</OText>
178
- </View>
179
- <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end' }}>
192
+ <View style={{ display: 'flex', flexDirection: 'column', flex: 1, alignItems: 'flex-end', maxWidth: 100 }}>
180
193
  <View style={{ flexDirection: 'row' }}>
181
194
  <OText size={12} lineHeight={18} weight={'400'}>{parsePrice(product.total || product.price)}</OText>
182
195
  {(productInfo().ingredients.length > 0 || productInfo().options.length > 0 || product.comment) && (