ordering-ui-react-native 0.17.50 → 0.17.52
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 +1 -1
- package/src/utils/index.tsx +2 -1
- package/themes/kiosk/src/components/BusinessesListing/index.tsx +2 -1
- package/themes/kiosk/src/components/ProductForm/index.tsx +1 -14
- package/themes/original/src/components/AddressDetails/index.tsx +1 -1
- package/themes/original/src/components/AddressForm/index.tsx +7 -3
- package/themes/original/src/components/BusinessProductsListing/index.tsx +2 -2
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +21 -12
- package/themes/original/src/components/BusinessesListing/Layout/Original/styles.tsx +0 -7
- package/themes/original/src/components/OrderProgress/index.tsx +69 -64
- package/themes/original/src/components/OrderProgress/styles.tsx +5 -0
- package/themes/original/src/components/PageBanner/index.tsx +1 -1
- package/themes/original/src/components/ProductForm/index.tsx +4 -3
- package/themes/original/src/components/ProductItemAccordion/index.tsx +2 -2
- package/themes/original/src/components/SingleProductCard/index.tsx +2 -1
- package/themes/original/src/components/SingleProductCard/styles.tsx +1 -0
- package/themes/original/src/components/StripeElementsForm/index.tsx +3 -0
- package/themes/original/src/components/shared/OInput.tsx +10 -1
package/package.json
CHANGED
package/src/utils/index.tsx
CHANGED
|
@@ -34,7 +34,8 @@ export const getTraduction = (key: string, t: any) => {
|
|
|
34
34
|
ERROR_ADD_PRODUCT_VERY_FAR_FOR_DELIVERY: 'Error adding product, very far for delivery',
|
|
35
35
|
ERROR_PRODUCT_NOT_FOUND: 'Error with the product',
|
|
36
36
|
ERROR_ADD_BUSINESS_INVALID: 'An error occurred with the business',
|
|
37
|
-
ERROR_INVALID_OFFER: 'The offer doesn\'t exist'
|
|
37
|
+
ERROR_INVALID_OFFER: 'The offer doesn\'t exist',
|
|
38
|
+
ERROR_ADD_PRODUCT_BEFORE_ADDRESS: 'You must have an address'
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
return keyList[key] ? t(key, keyList[key]) : t(key)
|
|
@@ -20,6 +20,7 @@ const BusinessesListingUI = (props: any) => {
|
|
|
20
20
|
const {
|
|
21
21
|
navigation,
|
|
22
22
|
businessesList,
|
|
23
|
+
paginationProps,
|
|
23
24
|
handleBusinessClick,
|
|
24
25
|
} = props;
|
|
25
26
|
|
|
@@ -78,7 +79,7 @@ const BusinessesListingUI = (props: any) => {
|
|
|
78
79
|
</CardsContainer>
|
|
79
80
|
|
|
80
81
|
|
|
81
|
-
{!businessesList.loading && businessesList.businesses.length === 0 && (
|
|
82
|
+
{!businessesList.loading && businessesList.businesses.length === 0 && paginationProps.totalPages !== null && (
|
|
82
83
|
<NotFoundSource
|
|
83
84
|
content={t(
|
|
84
85
|
'NOT_FOUND_BUSINESSES',
|
|
@@ -550,7 +550,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
550
550
|
</View>
|
|
551
551
|
)}
|
|
552
552
|
<View style={{ width: isSoldOut || maxProductQuantity <= 0 ? '100%' : isDrawer ? '70%' : '80%' }}>
|
|
553
|
-
{productCart && !isSoldOut && maxProductQuantity > 0 && auth &&
|
|
553
|
+
{productCart && !isSoldOut && maxProductQuantity > 0 && auth && (
|
|
554
554
|
<OButton
|
|
555
555
|
onClick={() => handleSaveProduct()}
|
|
556
556
|
imgRightSrc=''
|
|
@@ -563,19 +563,6 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
563
563
|
}}
|
|
564
564
|
/>
|
|
565
565
|
)}
|
|
566
|
-
{auth && !orderState.options?.address_id && (
|
|
567
|
-
orderState.loading ? (
|
|
568
|
-
<OButton
|
|
569
|
-
isDisabled
|
|
570
|
-
text={t('LOADING', 'Loading')}
|
|
571
|
-
imgRightSrc=''
|
|
572
|
-
/>
|
|
573
|
-
) : (
|
|
574
|
-
<OButton
|
|
575
|
-
onClick={navigation?.navigate('AddressList')}
|
|
576
|
-
/>
|
|
577
|
-
)
|
|
578
|
-
)}
|
|
579
566
|
{(!auth || isSoldOut || maxProductQuantity <= 0) && (
|
|
580
567
|
<OButton
|
|
581
568
|
isDisabled={isSoldOut || maxProductQuantity <= 0}
|
|
@@ -83,7 +83,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
83
83
|
backgroundColor: theme.colors.clear
|
|
84
84
|
},
|
|
85
85
|
inputsStyle: {
|
|
86
|
-
borderColor: theme.colors.border,
|
|
87
86
|
borderRadius: 10,
|
|
88
87
|
marginBottom: 20,
|
|
89
88
|
height: 50,
|
|
@@ -92,7 +91,6 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
92
91
|
flex: 1,
|
|
93
92
|
},
|
|
94
93
|
textAreaStyles: {
|
|
95
|
-
borderColor: theme.colors.border,
|
|
96
94
|
borderRadius: 10,
|
|
97
95
|
marginBottom: 20,
|
|
98
96
|
height: 104,
|
|
@@ -140,6 +138,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
140
138
|
const [isKeyboardShow, setIsKeyboardShow] = useState(false);
|
|
141
139
|
const [isSignUpEffect, setIsSignUpEffect] = useState(false);
|
|
142
140
|
const [hasEditing, setAddressEditing] = useState(false);
|
|
141
|
+
const [autoCompleteInputFocused, setAutoCompleteInputFocused] = useState(false)
|
|
143
142
|
|
|
144
143
|
const googleInput: any = useRef(null);
|
|
145
144
|
const internalNumberRef: any = useRef(null);
|
|
@@ -563,6 +562,8 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
563
562
|
autoCorrect: false,
|
|
564
563
|
blurOnSubmit: false,
|
|
565
564
|
returnKeyType: 'next',
|
|
565
|
+
onFocus: () => setAutoCompleteInputFocused(true),
|
|
566
|
+
onBlur: () => setAutoCompleteInputFocused(false)
|
|
566
567
|
}}
|
|
567
568
|
onFail={(error) =>
|
|
568
569
|
setAlertState({
|
|
@@ -586,7 +587,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
586
587
|
textInput: {
|
|
587
588
|
borderWidth: 1,
|
|
588
589
|
borderRadius: 7.6,
|
|
589
|
-
borderColor: theme.colors.border,
|
|
590
|
+
borderColor: autoCompleteInputFocused ? theme.colors.primary : theme.colors.border,
|
|
590
591
|
flexGrow: 1,
|
|
591
592
|
fontSize: 15,
|
|
592
593
|
paddingLeft: 16,
|
|
@@ -676,6 +677,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
676
677
|
addressState?.address?.internal_number ||
|
|
677
678
|
''
|
|
678
679
|
}
|
|
680
|
+
isFocusHighlight
|
|
679
681
|
style={{
|
|
680
682
|
...styles.inputsStyle,
|
|
681
683
|
marginRight: showField('internal_number') && showField('zipcode') ? 24 : 0
|
|
@@ -722,6 +724,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
722
724
|
addressState.address.zipcode ||
|
|
723
725
|
''
|
|
724
726
|
}
|
|
727
|
+
isFocusHighlight
|
|
725
728
|
style={styles.inputsStyle}
|
|
726
729
|
forwardRef={zipCodeRef}
|
|
727
730
|
returnKeyType="next"
|
|
@@ -767,6 +770,7 @@ const AddressFormUI = (props: AddressFormParams) => {
|
|
|
767
770
|
''
|
|
768
771
|
}
|
|
769
772
|
multiline
|
|
773
|
+
isFocusHighlight
|
|
770
774
|
style={styles.textAreaStyles}
|
|
771
775
|
returnKeyType="done"
|
|
772
776
|
forwardRef={addressNotesRef}
|
|
@@ -269,7 +269,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
269
269
|
{!isOpenSearchBar && (
|
|
270
270
|
<>
|
|
271
271
|
<TopActions onPress={() => handleBackNavigation()}>
|
|
272
|
-
<
|
|
272
|
+
<OIcon src={theme.images.general.arrow_left} color={theme.colors.textNormal} />
|
|
273
273
|
</TopActions>
|
|
274
274
|
{!errorQuantityProducts && (
|
|
275
275
|
<View style={{ ...styles.headerItem }}>
|
|
@@ -277,7 +277,7 @@ const BusinessProductsListingUI = (props: BusinessProductsListingParams) => {
|
|
|
277
277
|
onPress={() => setIsOpenSearchBar(true)}
|
|
278
278
|
style={styles.searchIcon}
|
|
279
279
|
>
|
|
280
|
-
<OIcon src={theme.images.general.search} color={theme.colors.textNormal} width={
|
|
280
|
+
<OIcon src={theme.images.general.search} color={theme.colors.textNormal} width={20} />
|
|
281
281
|
</TouchableOpacity>
|
|
282
282
|
</View>
|
|
283
283
|
)}
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
HeaderWrapper,
|
|
33
33
|
ListWrapper,
|
|
34
34
|
FeaturedWrapper,
|
|
35
|
-
OrderProgressWrapper,
|
|
36
35
|
FarAwayMessage,
|
|
37
36
|
AddressInputContainer,
|
|
38
37
|
PreorderInput,
|
|
@@ -138,7 +137,8 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
138
137
|
minHeight: 45,
|
|
139
138
|
paddingVertical: 5,
|
|
140
139
|
paddingHorizontal: 20,
|
|
141
|
-
borderWidth: 1
|
|
140
|
+
borderWidth: 1,
|
|
141
|
+
justifyContent: 'center'
|
|
142
142
|
},
|
|
143
143
|
businessSkeleton: {
|
|
144
144
|
borderRadius: 8,
|
|
@@ -501,12 +501,10 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
501
501
|
</TouchableOpacity>
|
|
502
502
|
</View>
|
|
503
503
|
)}
|
|
504
|
-
<
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
/>
|
|
509
|
-
</OrderProgressWrapper>
|
|
504
|
+
<OrderProgress
|
|
505
|
+
{...props}
|
|
506
|
+
isFocused={isFocused}
|
|
507
|
+
/>
|
|
510
508
|
{
|
|
511
509
|
!businessId && !props.franchiseId && featuredBusiness && featuredBusiness.length > 0 && (
|
|
512
510
|
<FeaturedWrapper>
|
|
@@ -659,14 +657,25 @@ const BusinessesListingUI = (props: BusinessesListingParams) => {
|
|
|
659
657
|
key={city?.id}
|
|
660
658
|
style={{
|
|
661
659
|
padding: 10,
|
|
662
|
-
|
|
663
|
-
borderBottomColor: orderState?.options?.city_id === city?.id ? theme.colors.primary : theme.colors.backgroundGray,
|
|
664
|
-
marginBottom: 10,
|
|
660
|
+
flexDirection: 'row'
|
|
665
661
|
}}
|
|
666
662
|
onPress={() => handleChangeCity(city?.id)}
|
|
667
663
|
disabled={orderState?.loading}
|
|
668
664
|
>
|
|
669
|
-
|
|
665
|
+
{orderState?.options?.city_id === city?.id ? (
|
|
666
|
+
<OIcon
|
|
667
|
+
src={theme.images.general.option_checked}
|
|
668
|
+
width={16}
|
|
669
|
+
style={{ marginEnd: 24 }}
|
|
670
|
+
/>
|
|
671
|
+
) : (
|
|
672
|
+
<OIcon
|
|
673
|
+
src={theme.images.general.option_normal}
|
|
674
|
+
width={16}
|
|
675
|
+
style={{ marginEnd: 24 }}
|
|
676
|
+
/>
|
|
677
|
+
)}
|
|
678
|
+
<OText color={theme.colors.black}>
|
|
670
679
|
{city?.name}
|
|
671
680
|
</OText>
|
|
672
681
|
</TouchableOpacity>
|
|
@@ -74,16 +74,9 @@ export const ListWrapper = styled.View`
|
|
|
74
74
|
|
|
75
75
|
export const FeaturedWrapper = styled.View`
|
|
76
76
|
background-color: ${(props: any) => props.theme.colors.backgroundLight};
|
|
77
|
-
height: 220px;
|
|
78
77
|
paddingVertical: 30px;
|
|
79
78
|
`;
|
|
80
79
|
|
|
81
|
-
export const OrderProgressWrapper = styled.View`
|
|
82
|
-
margin-top: 37px;
|
|
83
|
-
margin-bottom: 20px;
|
|
84
|
-
padding-horizontal: 40px;
|
|
85
|
-
`
|
|
86
|
-
|
|
87
80
|
export const FarAwayMessage = styled.View`
|
|
88
81
|
flex-direction: row;
|
|
89
82
|
align-items: center;
|
|
@@ -17,7 +17,8 @@ import {
|
|
|
17
17
|
ProgressBar,
|
|
18
18
|
TimeWrapper,
|
|
19
19
|
ProgressTextWrapper,
|
|
20
|
-
OrderInfoWrapper
|
|
20
|
+
OrderInfoWrapper,
|
|
21
|
+
OrderProgressWrapper
|
|
21
22
|
} from './styles'
|
|
22
23
|
const OrderProgressUI = (props: any) => {
|
|
23
24
|
const {
|
|
@@ -47,9 +48,9 @@ const OrderProgressUI = (props: any) => {
|
|
|
47
48
|
height: 1
|
|
48
49
|
},
|
|
49
50
|
shadowColor: '#000',
|
|
50
|
-
shadowOpacity: 0.
|
|
51
|
-
shadowRadius:
|
|
52
|
-
elevation:
|
|
51
|
+
shadowOpacity: 0.2,
|
|
52
|
+
shadowRadius: 2,
|
|
53
|
+
elevation: 3
|
|
53
54
|
},
|
|
54
55
|
logoWrapper: {
|
|
55
56
|
overflow: 'hidden',
|
|
@@ -144,70 +145,74 @@ const OrderProgressUI = (props: any) => {
|
|
|
144
145
|
return (
|
|
145
146
|
<>
|
|
146
147
|
{(orderList?.loading && !initialLoaded) && (
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
148
|
+
<OrderProgressWrapper>
|
|
149
|
+
<Placeholder Animation={Fade} height={Platform.OS === 'ios' ? 147.5 : 158}>
|
|
150
|
+
<PlaceholderLine height={60} style={{ borderRadius: 8, marginBottom: 10 }} />
|
|
151
|
+
<PlaceholderLine height={20} style={{ marginBottom: 10 }} />
|
|
152
|
+
<PlaceholderLine height={40} style={{ borderRadius: 8, marginBottom: 10 }} />
|
|
153
|
+
</Placeholder>
|
|
154
|
+
</OrderProgressWrapper>
|
|
152
155
|
)}
|
|
153
156
|
{(!orderList?.loading || initialLoaded) && orderList?.orders?.length > 0 && lastOrder && (
|
|
154
|
-
<
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
157
|
+
<OrderProgressWrapper>
|
|
158
|
+
<View style={styles.main}>
|
|
159
|
+
<OrderInfoWrapper style={{ flex: 1 }}>
|
|
160
|
+
<View style={styles.logoWrapper}>
|
|
161
|
+
<FastImage
|
|
162
|
+
style={{ width: 50, height: 50 }}
|
|
163
|
+
source={{
|
|
164
|
+
uri: optimizeImage(lastOrder?.business?.logo, 'h_50,c_limit'),
|
|
165
|
+
priority: FastImage.priority.normal,
|
|
166
|
+
}}
|
|
167
|
+
resizeMode={FastImage.resizeMode.cover}
|
|
168
|
+
/>
|
|
169
|
+
</View>
|
|
170
|
+
<View style={{
|
|
171
|
+
paddingHorizontal: 10,
|
|
172
|
+
flex: 1
|
|
173
|
+
}}
|
|
174
|
+
>
|
|
175
|
+
<OText
|
|
176
|
+
size={13}
|
|
177
|
+
style={{
|
|
178
|
+
fontWeight: 'bold',
|
|
179
|
+
marginBottom: 3
|
|
180
|
+
}}
|
|
181
|
+
>{t('ORDER_IN_PROGRESS', 'Order in progress')}</OText>
|
|
182
|
+
<OText size={11} numberOfLines={1} ellipsizeMode='tail'>{t('RESTAURANT_PREPARING_YOUR_ORDER', 'The restaurant is preparing your order')}</OText>
|
|
183
|
+
<TouchableOpacity onPress={() => handleGoToOrder('MyOrders')}>
|
|
184
|
+
<View style={styles.navigationButton}>
|
|
185
|
+
<OText size={11} color={theme.colors.primary}>{t('GO_TO_MY_ORDERS', 'Go to my orders')}</OText>
|
|
186
|
+
<IconAntDesign
|
|
187
|
+
name='arrowright'
|
|
188
|
+
color={theme.colors.primary}
|
|
189
|
+
size={13}
|
|
190
|
+
style={{ marginHorizontal: 5 }}
|
|
191
|
+
/>
|
|
192
|
+
</View>
|
|
193
|
+
</TouchableOpacity>
|
|
194
|
+
</View>
|
|
195
|
+
</OrderInfoWrapper>
|
|
196
|
+
<View style={{ flex: 1 }}>
|
|
197
|
+
<ProgressContentWrapper>
|
|
198
|
+
<ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${getOrderStatus(lastOrder.status)?.percentage}%` : '0%' }} />
|
|
199
|
+
</ProgressContentWrapper>
|
|
200
|
+
<ProgressTextWrapper>
|
|
201
|
+
<OText size={12} style={{ width: '50%' }}>{getOrderStatus(lastOrder.status)?.value}</OText>
|
|
202
|
+
<TimeWrapper>
|
|
203
|
+
<OText size={11}>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}</OText>
|
|
204
|
+
<OText size={11}>
|
|
205
|
+
{lastOrder?.delivery_datetime_utc
|
|
206
|
+
? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A' })
|
|
207
|
+
: parseTime(lastOrder?.delivery_datetime, { utc: false })}
|
|
208
|
+
-
|
|
209
|
+
{convertDiffToHours(lastOrder)}
|
|
210
|
+
</OText>
|
|
211
|
+
</TimeWrapper>
|
|
212
|
+
</ProgressTextWrapper>
|
|
190
213
|
</View>
|
|
191
|
-
</OrderInfoWrapper>
|
|
192
|
-
<View style={{ flex: 1 }}>
|
|
193
|
-
<ProgressContentWrapper>
|
|
194
|
-
<ProgressBar style={{ width: getOrderStatus(lastOrder.status)?.percentage ? `${getOrderStatus(lastOrder.status)?.percentage}%` : '0%' }} />
|
|
195
|
-
</ProgressContentWrapper>
|
|
196
|
-
<ProgressTextWrapper>
|
|
197
|
-
<OText size={12} style={{ width: '50%' }}>{getOrderStatus(lastOrder.status)?.value}</OText>
|
|
198
|
-
<TimeWrapper>
|
|
199
|
-
<OText size={11}>{t('ESTIMATED_DELIVERY', 'Estimated delivery')}</OText>
|
|
200
|
-
<OText size={11}>
|
|
201
|
-
{lastOrder?.delivery_datetime_utc
|
|
202
|
-
? parseTime(lastOrder?.delivery_datetime_utc, { outputFormat: 'hh:mm A' })
|
|
203
|
-
: parseTime(lastOrder?.delivery_datetime, { utc: false })}
|
|
204
|
-
-
|
|
205
|
-
{convertDiffToHours(lastOrder)}
|
|
206
|
-
</OText>
|
|
207
|
-
</TimeWrapper>
|
|
208
|
-
</ProgressTextWrapper>
|
|
209
214
|
</View>
|
|
210
|
-
</
|
|
215
|
+
</OrderProgressWrapper>
|
|
211
216
|
)}
|
|
212
217
|
{/* {!orderList?.loading && orderList?.orders?.length === 0 && (
|
|
213
218
|
<NotFoundSource
|
|
@@ -54,7 +54,7 @@ const PageBannerUI = (props: any) => {
|
|
|
54
54
|
{pageBannerState.banner?.items && pageBannerState.banner?.items.length > 0 && (
|
|
55
55
|
<PageBannerWrapper>
|
|
56
56
|
<Swiper
|
|
57
|
-
loop={
|
|
57
|
+
loop={pageBannerState.banner?.items.length > 1}
|
|
58
58
|
showsButtons={true}
|
|
59
59
|
style={styles.mainSwiper}
|
|
60
60
|
showsPagination={false}
|
|
@@ -919,7 +919,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
919
919
|
disabled={productCart.quantity === 1 || !productCart.quantity || isSoldOut || ((productCart?.quantity + productAddedToCartLength) <= product?.minimum_per_order)}>
|
|
920
920
|
<OIcon
|
|
921
921
|
src={theme.images.general.minus}
|
|
922
|
-
width={
|
|
922
|
+
width={20}
|
|
923
923
|
color={
|
|
924
924
|
productCart.quantity === 1 || isSoldOut
|
|
925
925
|
? theme.colors.backgroundGray
|
|
@@ -940,7 +940,8 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
940
940
|
borderRadius: 8,
|
|
941
941
|
borderColor: theme.colors.inputBorderColor,
|
|
942
942
|
height: 44,
|
|
943
|
-
marginHorizontal: 10
|
|
943
|
+
marginHorizontal: 10,
|
|
944
|
+
fontSize: 16
|
|
944
945
|
}}
|
|
945
946
|
/>
|
|
946
947
|
)}
|
|
@@ -963,7 +964,7 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
963
964
|
}>
|
|
964
965
|
<OIcon
|
|
965
966
|
src={theme.images.general.plus}
|
|
966
|
-
width={
|
|
967
|
+
width={20}
|
|
967
968
|
color={
|
|
968
969
|
maxProductQuantity <= 0 ||
|
|
969
970
|
(productCart?.quantity + productAddedToCartLength) >= maxProductQuantity ||
|
|
@@ -241,7 +241,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
241
241
|
<TouchableOpacity onPress={() => handleEditProduct(product)} style={{ marginEnd: 7 }}>
|
|
242
242
|
<OIcon
|
|
243
243
|
src={theme.images.general.pencil}
|
|
244
|
-
width={
|
|
244
|
+
width={20}
|
|
245
245
|
color={theme.colors.textSecondary}
|
|
246
246
|
/>
|
|
247
247
|
</TouchableOpacity>
|
|
@@ -254,7 +254,7 @@ export const ProductItemAccordion = (props: ProductItemAccordionParams) => {
|
|
|
254
254
|
>
|
|
255
255
|
<OIcon
|
|
256
256
|
src={theme.images.general.trash}
|
|
257
|
-
width={
|
|
257
|
+
width={20}
|
|
258
258
|
color={theme.colors.textSecondary}
|
|
259
259
|
/>
|
|
260
260
|
</OAlert>
|
|
@@ -168,7 +168,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
168
168
|
<View style={{ flexDirection: 'row' }}>
|
|
169
169
|
{productAddedToCartLength > 0 && (
|
|
170
170
|
<QuantityContainer style={[styles.quantityContainer, {
|
|
171
|
-
transform: [{ translateX: 25 }, { translateY:
|
|
171
|
+
transform: [{ translateX: 25 }, { translateY: -25 }],
|
|
172
172
|
}]}>
|
|
173
173
|
<OText size={12} color={theme.colors.white}>{productAddedToCartLength.toString()}</OText>
|
|
174
174
|
</QuantityContainer>
|
|
@@ -273,6 +273,7 @@ const SingleProductCardUI = React.memo((props: SingleProductCardParams) => {
|
|
|
273
273
|
width: '100%',
|
|
274
274
|
borderRadius: 7.6,
|
|
275
275
|
marginTop: 10,
|
|
276
|
+
height: 40
|
|
276
277
|
|
|
277
278
|
}}
|
|
278
279
|
bgColor={isSoldOut ? '#B8B8B8' : theme?.colors?.white}
|
|
@@ -3,6 +3,7 @@ import { ImageSourcePropType, ImageStyle, ViewStyle, TextInputProps, TextStyle }
|
|
|
3
3
|
import styled from 'styled-components/native';
|
|
4
4
|
import OIcon from './OIcon';
|
|
5
5
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
6
|
+
import { useTheme } from 'styled-components/native';
|
|
6
7
|
|
|
7
8
|
const Input = styled.TextInput`
|
|
8
9
|
flex-grow: 1;
|
|
@@ -39,6 +40,7 @@ interface Props extends TextInputProps {
|
|
|
39
40
|
inputStyle?: TextStyle;
|
|
40
41
|
wrapperRef?: any;
|
|
41
42
|
onPress?: any;
|
|
43
|
+
isFocusHighlight?: boolean
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
const Wrapper = styled.Pressable`
|
|
@@ -54,12 +56,16 @@ const Wrapper = styled.Pressable`
|
|
|
54
56
|
`;
|
|
55
57
|
|
|
56
58
|
const OInput = (props: Props): React.ReactElement => {
|
|
59
|
+
const theme = useTheme();
|
|
60
|
+
const [inputFocused, setInputFocused] = React.useState(false)
|
|
57
61
|
return (
|
|
58
62
|
<Wrapper
|
|
59
63
|
onPress={() => { props.forwardRef?.current?.focus?.(); props.onPress && props.onPress() }}
|
|
60
64
|
style={{
|
|
61
65
|
backgroundColor: props.bgColor,
|
|
62
|
-
borderColor: props.
|
|
66
|
+
borderColor: !props.isFocusHighlight
|
|
67
|
+
? props.borderColor
|
|
68
|
+
: inputFocused ? theme.colors.primary : theme.colors.border,
|
|
63
69
|
...props.style,
|
|
64
70
|
}}>
|
|
65
71
|
{props.icon ? (
|
|
@@ -95,6 +101,8 @@ const OInput = (props: Props): React.ReactElement => {
|
|
|
95
101
|
props.forwardRef && (props.forwardRef.current = e)
|
|
96
102
|
}}
|
|
97
103
|
style={props?.inputStyle}
|
|
104
|
+
onFocus={() => setInputFocused(true)}
|
|
105
|
+
onBlur={() => setInputFocused(false)}
|
|
98
106
|
/>
|
|
99
107
|
{props.iconRight && (
|
|
100
108
|
<OIcon
|
|
@@ -114,6 +122,7 @@ OInput.defaultProps = {
|
|
|
114
122
|
iconColor: '#959595',
|
|
115
123
|
bgColor: 'white',
|
|
116
124
|
borderColor: 'white',
|
|
125
|
+
isFocusHighlight: false
|
|
117
126
|
};
|
|
118
127
|
|
|
119
128
|
export default OInput;
|