ordering-ui-react-native 0.12.58 → 0.12.59

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.12.58",
3
+ "version": "0.12.59",
4
4
  "description": "Reusable components made in react native",
5
5
  "main": "src/index.tsx",
6
6
  "author": "ordering.inc",
@@ -242,6 +242,7 @@ const CartUI = (props: any) => {
242
242
  marginTop: 10
243
243
  }}
244
244
  multiline
245
+ inputStyle={{color: theme.colors.textPrimary}}
245
246
  />
246
247
  {commentState?.loading && (
247
248
  <View style={{ position: 'absolute', right: 20 }}>
@@ -255,6 +255,7 @@ const OrderSummaryUI = (props: any) => {
255
255
  marginTop: 10
256
256
  }}
257
257
  multiline
258
+ inputStyle={{color: theme.colors.textPrimary}}
258
259
  />
259
260
  {commentState?.loading && (
260
261
  <View style={{ position: 'absolute', right: 20 }}>
@@ -480,8 +480,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
480
480
  </Table>
481
481
  {order?.comment && (
482
482
  <Table>
483
- <OText style={{ flex: 1 }}>{t('COMMENT', 'Comment')}</OText>
484
- <OText style={{ maxWidth: '70%' }}>
483
+ <OText color={theme.colors.textPrimary} size={12} style={{ flex: 1 }}>{t('COMMENT', 'Comment')}</OText>
484
+ <OText color={theme.colors.textPrimary} size={12} style={{ maxWidth: '70%' }}>
485
485
  {order?.comment}
486
486
  </OText>
487
487
  </Table>
@@ -8,7 +8,7 @@ import {
8
8
  useValidationFields,
9
9
  } from 'ordering-components/native';
10
10
  import { useTheme } from 'styled-components/native';
11
- import { ScrollView, View, useWindowDimensions } from 'react-native';
11
+ import { ScrollView, View, useWindowDimensions, ActivityIndicator } from 'react-native';
12
12
  import {
13
13
  CheckoutAction,
14
14
  OSBill,
@@ -26,7 +26,7 @@ import {
26
26
  import { ProductItemAccordion } from '../ProductItemAccordion';
27
27
  import { CouponControl } from '../CouponControl';
28
28
 
29
- import { OButton, OIcon, OModal, OText } from '../shared';
29
+ import { OButton, OInput, OModal, OText, OIcon } from '../shared';
30
30
  import { ProductForm } from '../ProductForm';
31
31
  import { UpsellingProducts } from '../UpsellingProducts';
32
32
  import { convertHoursToMinutes, verifyDecimals } from '../../utils';
@@ -37,6 +37,7 @@ import AntIcon from 'react-native-vector-icons/AntDesign'
37
37
  import MaterialCommunityIcon from 'react-native-vector-icons/MaterialCommunityIcons'
38
38
  import { TaxInformation } from '../TaxInformation';
39
39
  import { TouchableOpacity } from 'react-native';
40
+
40
41
  const CartUI = (props: any) => {
41
42
  const {
42
43
  cart,
@@ -48,6 +49,8 @@ const CartUI = (props: any) => {
48
49
  removeProduct,
49
50
  handleCartOpen,
50
51
  setIsCartsLoading,
52
+ handleChangeComment,
53
+ commentState
51
54
  } = props
52
55
 
53
56
  const theme = useTheme();
@@ -314,6 +317,38 @@ const CartUI = (props: any) => {
314
317
  </OText>
315
318
  </OSTable>
316
319
  </OSTotal>
320
+ {cart?.status !== 2 && (
321
+ <OSTable>
322
+ <View style={{ width: '100%', marginTop: 20 }}>
323
+ <OText size={12}>{t('COMMENTS', 'Comments')}</OText>
324
+ <View style={{ flex: 1, width: '100%' }}>
325
+ <OInput
326
+ value={cart?.comment}
327
+ placeholder={t('SPECIAL_COMMENTS', 'Special Comments')}
328
+ onChange={(value: string) => handleChangeComment(value)}
329
+ style={{
330
+ alignItems: 'flex-start',
331
+ width: '100%',
332
+ height: 100,
333
+ borderColor: theme.colors.textSecondary,
334
+ paddingRight: 50,
335
+ marginTop: 10
336
+ }}
337
+ multiline
338
+ />
339
+ {commentState?.loading && (
340
+ <View style={{ position: 'absolute', right: 20 }}>
341
+ <ActivityIndicator
342
+ size='large'
343
+ style={{ height: 100 }}
344
+ color={theme.colors.primary}
345
+ />
346
+ </View>
347
+ )}
348
+ </View>
349
+ </View>
350
+ </OSTable>
351
+ )}
317
352
  </OSBill>
318
353
  )}
319
354
  </View>