ordering-ui-react-native 0.15.10-release → 0.15.12-release
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/components/OrderDetails/index.tsx +2 -2
- package/src/pages/BusinessProductsList.tsx +1 -0
- package/src/pages/BusinessesListing.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Business.tsx +1 -1
- package/themes/business/src/components/OrderDetails/Delivery.tsx +9 -9
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +123 -89
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +6 -0
- package/themes/business/src/components/OrderDetails/styles.tsx +7 -0
- package/themes/kiosk/src/components/Cart/index.tsx +99 -25
- package/themes/kiosk/src/components/Cart/styles.tsx +6 -0
- package/themes/kiosk/src/components/OrderDetails/index.tsx +134 -39
- package/themes/kiosk/src/components/OrderDetails/styles.tsx +5 -0
- package/themes/kiosk/src/types/index.d.ts +2 -0
- package/themes/original/index.tsx +10 -8
- package/themes/original/src/components/BusinessBasicInformation/index.tsx +1 -1
- package/themes/original/src/components/BusinessController/index.tsx +20 -1
- package/themes/original/src/components/BusinessController/styles.tsx +22 -0
- package/themes/original/src/components/BusinessFeaturedController/index.tsx +20 -1
- package/themes/original/src/components/BusinessFeaturedController/styles.tsx +23 -0
- package/themes/original/src/components/BusinessProductsList/styles.tsx +0 -3
- package/themes/original/src/components/Cart/index.tsx +1 -1
- package/themes/original/src/components/OrderDetails/index.tsx +1 -1
- package/themes/original/src/components/OrderSummary/index.tsx +2 -2
- package/themes/original/src/components/OrderTypeSelector/index.tsx +1 -1
- package/themes/original/src/components/ProductForm/index.tsx +26 -26
- package/themes/original/src/components/Promotions/index.tsx +233 -0
- package/themes/original/src/components/Promotions/styles.tsx +58 -0
- package/themes/original/src/components/SingleProductCard/index.tsx +39 -18
- package/themes/original/src/components/SingleProductCard/styles.tsx +28 -1
- package/themes/original/src/components/UserProfile/index.tsx +8 -1
- package/themes/original/src/components/Wallets/index.tsx +58 -4
- package/themes/original/src/components/Wallets/styles.tsx +21 -0
- package/themes/single-business/src/components/OrderTypeSelector/index.tsx +1 -1
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
Table,
|
|
24
24
|
OrderBill,
|
|
25
25
|
Total,
|
|
26
|
+
OSRow,
|
|
26
27
|
} from './styles'
|
|
27
28
|
import { OrderDetailsParams, Product } from '../../types'
|
|
28
29
|
import { Container } from '../../layouts/Container';
|
|
@@ -178,6 +179,20 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
178
179
|
setIsLoading(false)
|
|
179
180
|
}
|
|
180
181
|
|
|
182
|
+
const getIncludedTaxes = () => {
|
|
183
|
+
if (order?.taxes?.length === 0) {
|
|
184
|
+
return order.tax_type === 1 ? order?.summary?.tax ?? 0 : 0
|
|
185
|
+
} else {
|
|
186
|
+
return order?.taxes.reduce((taxIncluded: number, tax: any) => {
|
|
187
|
+
return taxIncluded + (tax.type === 1 ? tax.summary?.tax : 0)
|
|
188
|
+
}, 0)
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const getIncludedTaxesDiscounts = () => {
|
|
193
|
+
return order?.taxes?.filter((tax: any) => tax?.type === 1)?.reduce((carry: number, tax: any) => carry + (tax?.summary?.tax_after_discount ?? tax?.summary?.tax), 0)
|
|
194
|
+
}
|
|
195
|
+
|
|
181
196
|
useEffect(() => {
|
|
182
197
|
const backAction = () => {
|
|
183
198
|
Alert.alert(`${t('HOLD_ON', 'Hold on')}!`, `${t('ARE_YOU_SURE_YOU_WANT_TO_GO_BACK', 'Are you sure you want to go back')}?`, [
|
|
@@ -209,7 +224,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
209
224
|
const getCustomerName = async () => {
|
|
210
225
|
try {
|
|
211
226
|
const { customerName: name } = await _retrieveStoreData('customer_name')
|
|
212
|
-
|
|
227
|
+
setCustomerName(name)
|
|
213
228
|
} catch (e) {
|
|
214
229
|
if (e) {
|
|
215
230
|
setCustomerName(null)
|
|
@@ -217,8 +232,8 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
217
232
|
}
|
|
218
233
|
}
|
|
219
234
|
getCustomerName()
|
|
220
|
-
const redirectHome = setTimeout(() =>{
|
|
221
|
-
_setStoreData('customer_name', {customerName: ''});
|
|
235
|
+
const redirectHome = setTimeout(() => {
|
|
236
|
+
_setStoreData('customer_name', { customerName: '' });
|
|
222
237
|
navigation.reset({
|
|
223
238
|
routes: [{ name: 'Intro' }],
|
|
224
239
|
});
|
|
@@ -345,7 +360,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
345
360
|
<OButton
|
|
346
361
|
text={`${t('YOU_ARE_DONE', 'You are done! Click to close')}!`}
|
|
347
362
|
onClick={() => {
|
|
348
|
-
_setStoreData('customer_name', {customerName: ''});
|
|
363
|
+
_setStoreData('customer_name', { customerName: '' });
|
|
349
364
|
navigation.reset({
|
|
350
365
|
routes: [{ name: 'Intro' }],
|
|
351
366
|
});
|
|
@@ -419,46 +434,135 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
419
434
|
<Table>
|
|
420
435
|
<OText>{t('SUBTOTAL', 'Subtotal')}</OText>
|
|
421
436
|
<OText>
|
|
422
|
-
{parsePrice(
|
|
423
|
-
? (order?.summary?.subtotal + order?.summary?.tax) ?? 0
|
|
424
|
-
: order?.summary?.subtotal ?? 0
|
|
425
|
-
)}
|
|
437
|
+
{parsePrice(((order?.summary?.subtotal ?? order?.subtotal) + getIncludedTaxes()))}
|
|
426
438
|
</OText>
|
|
427
439
|
</Table>
|
|
428
|
-
{order?.summary?.discount > 0 && (
|
|
440
|
+
{(order?.summary?.discount > 0 ?? order?.discount > 0) && order?.offers?.length === 0 && (
|
|
429
441
|
<Table>
|
|
430
442
|
{order?.offer_type === 1 ? (
|
|
431
443
|
<OText>
|
|
432
444
|
{t('DISCOUNT', 'Discount')}
|
|
433
|
-
<OText>{`(${verifyDecimals(
|
|
445
|
+
<OText>{`(${verifyDecimals(
|
|
446
|
+
order?.offer_rate,
|
|
447
|
+
parsePrice,
|
|
448
|
+
)}%)`}</OText>
|
|
434
449
|
</OText>
|
|
435
450
|
) : (
|
|
436
451
|
<OText>{t('DISCOUNT', 'Discount')}</OText>
|
|
437
452
|
)}
|
|
438
|
-
<OText
|
|
453
|
+
<OText>
|
|
454
|
+
- {parsePrice(order?.summary?.discount || order?.discount)}
|
|
455
|
+
</OText>
|
|
439
456
|
</Table>
|
|
440
457
|
)}
|
|
458
|
+
{
|
|
459
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 1)?.map((offer: any) => (
|
|
460
|
+
<Table key={offer.id}>
|
|
461
|
+
<OSRow>
|
|
462
|
+
<OText>
|
|
463
|
+
{offer.name}
|
|
464
|
+
{offer.rate_type === 1 && (
|
|
465
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
466
|
+
)}
|
|
467
|
+
</OText>
|
|
468
|
+
</OSRow>
|
|
469
|
+
<OText>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
470
|
+
</Table>
|
|
471
|
+
))
|
|
472
|
+
}
|
|
441
473
|
{order?.summary?.subtotal_with_discount > 0 && order?.summary?.discount > 0 && order?.summary?.total >= 0 && (
|
|
442
474
|
<Table>
|
|
443
475
|
<OText>{t('SUBTOTAL_WITH_DISCOUNT', 'Subtotal with discount')}</OText>
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
<OText>
|
|
450
|
-
{t('TAX', 'Tax')}
|
|
451
|
-
{`(${verifyDecimals(order?.summary?.tax_rate, parseNumber)}%)`}
|
|
452
|
-
</OText>
|
|
453
|
-
<OText>{parsePrice(order?.summary?.tax)}</OText>
|
|
476
|
+
{order?.tax_type === 1 ? (
|
|
477
|
+
<OText>{parsePrice((order?.summary?.subtotal_with_discount + getIncludedTaxesDiscounts() ?? 0))}</OText>
|
|
478
|
+
) : (
|
|
479
|
+
<OText>{parsePrice(order?.summary?.subtotal_with_discount ?? 0)}</OText>
|
|
480
|
+
)}
|
|
454
481
|
</Table>
|
|
455
482
|
)}
|
|
483
|
+
{
|
|
484
|
+
order?.taxes?.length === 0 && order?.tax_type === 2 && (
|
|
485
|
+
<Table>
|
|
486
|
+
<OText>
|
|
487
|
+
{t('TAX', 'Tax')} {`(${verifyDecimals(order?.tax, parseNumber)}%)`}
|
|
488
|
+
</OText>
|
|
489
|
+
<OText>{parsePrice(order?.summary?.tax || 0)}</OText>
|
|
490
|
+
</Table>
|
|
491
|
+
)
|
|
492
|
+
}
|
|
493
|
+
{
|
|
494
|
+
order?.fees?.length === 0 && (
|
|
495
|
+
<Table>
|
|
496
|
+
<OText>
|
|
497
|
+
{t('SERVICE_FEE', 'Service fee')}
|
|
498
|
+
{`(${verifyDecimals(order?.service_fee, parseNumber)}%)`}
|
|
499
|
+
</OText>
|
|
500
|
+
<OText>{parsePrice(order?.summary?.service_fee || 0)}</OText>
|
|
501
|
+
</Table>
|
|
502
|
+
)
|
|
503
|
+
}
|
|
504
|
+
{
|
|
505
|
+
order?.taxes?.length > 0 && order?.taxes?.filter((tax: any) => tax?.type === 2 && tax?.rate !== 0).map((tax: any) => (
|
|
506
|
+
<Table key={tax.id}>
|
|
507
|
+
<OSRow>
|
|
508
|
+
<OText>
|
|
509
|
+
{tax.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
510
|
+
{`(${verifyDecimals(tax?.rate, parseNumber)}%)`}{' '}
|
|
511
|
+
</OText>
|
|
512
|
+
</OSRow>
|
|
513
|
+
<OText>{parsePrice(tax?.summary?.tax_after_discount ?? tax?.summary?.tax ?? 0)}</OText>
|
|
514
|
+
</Table>
|
|
515
|
+
))
|
|
516
|
+
}
|
|
517
|
+
{
|
|
518
|
+
order?.fees?.length > 0 && order?.fees?.filter((fee: any) => !(fee.fixed === 0 && fee.percentage === 0))?.map((fee: any) => (
|
|
519
|
+
<Table key={fee.id}>
|
|
520
|
+
<OSRow>
|
|
521
|
+
<OText>
|
|
522
|
+
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
523
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
|
|
524
|
+
</OText>
|
|
525
|
+
</OSRow>
|
|
526
|
+
<OText>{parsePrice(fee?.summary?.fixed + (fee?.summary?.percentage_after_discount ?? fee?.summary?.percentage) ?? 0)}</OText>
|
|
527
|
+
</Table>
|
|
528
|
+
))
|
|
529
|
+
}
|
|
530
|
+
{
|
|
531
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 3)?.map((offer: any) => (
|
|
532
|
+
<Table key={offer.id}>
|
|
533
|
+
<OSRow>
|
|
534
|
+
<OText>
|
|
535
|
+
{offer.name}
|
|
536
|
+
{offer.rate_type === 1 && (
|
|
537
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
538
|
+
)}
|
|
539
|
+
</OText>
|
|
540
|
+
</OSRow>
|
|
541
|
+
<OText>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
542
|
+
</Table>
|
|
543
|
+
))
|
|
544
|
+
}
|
|
456
545
|
{order?.summary?.delivery_price > 0 && (
|
|
457
546
|
<Table>
|
|
458
547
|
<OText>{t('DELIVERY_FEE', 'Delivery Fee')}</OText>
|
|
459
548
|
<OText>{parsePrice(order?.summary?.delivery_price)}</OText>
|
|
460
549
|
</Table>
|
|
461
550
|
)}
|
|
551
|
+
{
|
|
552
|
+
order?.offers?.length > 0 && order?.offers?.filter((offer: any) => offer?.target === 2)?.map((offer: any) => (
|
|
553
|
+
<Table key={offer.id}>
|
|
554
|
+
<OSRow>
|
|
555
|
+
<OText>
|
|
556
|
+
{offer.name}
|
|
557
|
+
{offer.rate_type === 1 && (
|
|
558
|
+
<OText>{`(${verifyDecimals(offer?.rate, parsePrice)}%)`}</OText>
|
|
559
|
+
)}
|
|
560
|
+
</OText>
|
|
561
|
+
</OSRow>
|
|
562
|
+
<OText>- {parsePrice(offer?.summary?.discount)}</OText>
|
|
563
|
+
</Table>
|
|
564
|
+
))
|
|
565
|
+
}
|
|
462
566
|
{order?.summary?.driver_tip > 0 && (
|
|
463
567
|
<Table>
|
|
464
568
|
<OText>
|
|
@@ -470,23 +574,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
470
574
|
`(${verifyDecimals(order?.summary?.driver_tip, parseNumber)}%)`
|
|
471
575
|
)}
|
|
472
576
|
</OText>
|
|
473
|
-
<OText>{parsePrice(order?.summary?.driver_tip ??
|
|
474
|
-
</Table>
|
|
475
|
-
)}
|
|
476
|
-
{order?.summary?.service_fee > 0 && (
|
|
477
|
-
<Table>
|
|
478
|
-
<OText>
|
|
479
|
-
{t('SERVICE_FEE', 'Service Fee')}
|
|
480
|
-
{`(${verifyDecimals(order?.summary?.service_fee, parseNumber)}%)`}
|
|
481
|
-
</OText>
|
|
482
|
-
<OText>{parsePrice(order?.summary?.service_fee)}</OText>
|
|
577
|
+
<OText>{parsePrice(order?.summary?.driver_tip ?? order?.totalDriverTip)}</OText>
|
|
483
578
|
</Table>
|
|
484
579
|
)}
|
|
485
580
|
<Total>
|
|
486
581
|
<Table>
|
|
487
582
|
<OText style={styles.textBold}>{t('TOTAL', 'Total')}</OText>
|
|
488
583
|
<OText style={styles.textBold} color={theme.colors.primary}>
|
|
489
|
-
{parsePrice(order?.summary?.total ??
|
|
584
|
+
{parsePrice(order?.summary?.total ?? order?.total)}
|
|
490
585
|
</OText>
|
|
491
586
|
</Table>
|
|
492
587
|
</Total>
|
|
@@ -508,14 +603,14 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
508
603
|
<OIconButton
|
|
509
604
|
bgColor="transparent"
|
|
510
605
|
borderColor="transparent"
|
|
511
|
-
RenderIcon={() =>
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
606
|
+
RenderIcon={() =>
|
|
607
|
+
<EvilIcons
|
|
608
|
+
name={'close'}
|
|
609
|
+
size={40}
|
|
610
|
+
color={theme.colors.primary}
|
|
611
|
+
/>
|
|
517
612
|
}
|
|
518
|
-
style={{ flex:1, justifyContent: 'flex-end', left: 30 }}
|
|
613
|
+
style={{ flex: 1, justifyContent: 'flex-end', left: 30 }}
|
|
519
614
|
onClick={() => {
|
|
520
615
|
navigation.reset({
|
|
521
616
|
routes: [{ name: 'Intro' }],
|
|
@@ -45,7 +45,7 @@ import { UpsellingProducts } from './src/components/UpsellingProducts';
|
|
|
45
45
|
import { UserVerification } from './src/components/UserVerification';
|
|
46
46
|
import { BusinessListingSearch } from './src/components/BusinessListingSearch';
|
|
47
47
|
import { LastOrders } from './src/components/LastOrders';
|
|
48
|
-
import
|
|
48
|
+
import NavBar from './src/components/NavBar';
|
|
49
49
|
import { BusinessTypeFilter } from './src/components/BusinessTypeFilter';
|
|
50
50
|
import { BusinessController } from './src/components/BusinessController';
|
|
51
51
|
import { BusinessFeaturedController } from './src/components/BusinessFeaturedController';
|
|
@@ -77,21 +77,22 @@ import { StripeCardsList } from './src/components/StripeCardsList';
|
|
|
77
77
|
import { ProductIngredient } from './src/components/ProductIngredient';
|
|
78
78
|
import { ProductOption } from './src/components/ProductOption';
|
|
79
79
|
import { ProductOptionSubOption } from './src/components/ProductOptionSubOption';
|
|
80
|
+
import { Sessions } from './src/components/Sessions';
|
|
80
81
|
import { SingleProductReview } from './src/components/SingleProductReview';
|
|
81
82
|
import { LogoutButton } from './src/components/LogoutButton';
|
|
82
83
|
import { UserFormDetailsUI } from './src/components/UserFormDetails';
|
|
83
84
|
import { WalletTransactionItem } from './src/components/WalletTransactionItem';
|
|
84
|
-
|
|
85
|
+
import { Promotions } from './src/components/Promotions'
|
|
85
86
|
import { USER_TYPE, ORDER_TYPES } from './src/config/constants'
|
|
86
87
|
|
|
87
88
|
import { OSBill, OSTable, OSCoupon, OSTotal, OSRow } from './src/components/OrderSummary/styles';
|
|
88
89
|
|
|
89
90
|
import { FormInput, FormSide, ButtonsWrapper, LoginWith, OTab, OTabs } from './src/components/LoginForm/styles';
|
|
90
|
-
import { OSItem, OSItemContent, OSItemActions} from './src/components/PaymentOptionStripe/styles';
|
|
91
|
+
import { OSItem, OSItemContent, OSItemActions } from './src/components/PaymentOptionStripe/styles';
|
|
91
92
|
|
|
92
93
|
import Alert from './src/providers/AlertProvider'
|
|
93
94
|
|
|
94
|
-
import {
|
|
95
|
+
import {
|
|
95
96
|
LoginParams,
|
|
96
97
|
ProfileParams,
|
|
97
98
|
AddressListParams,
|
|
@@ -134,7 +135,7 @@ import {
|
|
|
134
135
|
OAlert,
|
|
135
136
|
OModal,
|
|
136
137
|
OBottomPopup,
|
|
137
|
-
|
|
138
|
+
HeaderTitle
|
|
138
139
|
} from './src/components/shared';
|
|
139
140
|
|
|
140
141
|
import { Container } from './src/layouts/Container';
|
|
@@ -176,7 +177,7 @@ export {
|
|
|
176
177
|
BusinessMenuList,
|
|
177
178
|
UserProfile,
|
|
178
179
|
MessageListing,
|
|
179
|
-
|
|
180
|
+
Messages,
|
|
180
181
|
Help,
|
|
181
182
|
HelpAccountAndPayment,
|
|
182
183
|
HelpGuide,
|
|
@@ -227,11 +228,12 @@ export {
|
|
|
227
228
|
ProductIngredient,
|
|
228
229
|
ProductOption,
|
|
229
230
|
ProductOptionSubOption,
|
|
231
|
+
Sessions,
|
|
230
232
|
SingleProductReview,
|
|
231
233
|
LogoutButton,
|
|
232
234
|
UserFormDetailsUI,
|
|
233
235
|
WalletTransactionItem,
|
|
234
|
-
|
|
236
|
+
Promotions,
|
|
235
237
|
ORDER_TYPES,
|
|
236
238
|
USER_TYPE,
|
|
237
239
|
|
|
@@ -296,7 +298,7 @@ export {
|
|
|
296
298
|
OAlert,
|
|
297
299
|
OModal,
|
|
298
300
|
OBottomPopup,
|
|
299
|
-
|
|
301
|
+
HeaderTitle,
|
|
300
302
|
|
|
301
303
|
// layout
|
|
302
304
|
Container,
|
|
@@ -4,7 +4,7 @@ import { useUtils, useOrder, useLanguage } from 'ordering-components/native';
|
|
|
4
4
|
import { useTheme } from 'styled-components/native';
|
|
5
5
|
import { OIcon, OText, OModal } from '../shared';
|
|
6
6
|
import { BusinessBasicInformationParams } from '../../types';
|
|
7
|
-
import { convertHoursToMinutes } from '../../utils';
|
|
7
|
+
import { convertHoursToMinutes, shape } from '../../utils';
|
|
8
8
|
import dayjs from 'dayjs';
|
|
9
9
|
import timezone from 'dayjs/plugin/timezone';
|
|
10
10
|
import isBetween from 'dayjs/plugin/isBetween';
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { OIcon, OText } from '../shared';
|
|
10
10
|
import { StyleSheet, View } from 'react-native';
|
|
11
11
|
import { BusinessControllerParams } from '../../types';
|
|
12
|
-
import { convertHoursToMinutes } from '../../utils';
|
|
12
|
+
import { convertHoursToMinutes, shape } from '../../utils';
|
|
13
13
|
import {
|
|
14
14
|
Card,
|
|
15
15
|
BusinessHero,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
BusinessState,
|
|
21
21
|
BusinessLogo,
|
|
22
22
|
Reviews,
|
|
23
|
+
RibbonBox
|
|
23
24
|
} from './styles';
|
|
24
25
|
import { useTheme } from 'styled-components/native';
|
|
25
26
|
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome5';
|
|
@@ -121,6 +122,24 @@ export const BusinessControllerUI = (props: BusinessControllerParams) => {
|
|
|
121
122
|
|
|
122
123
|
return (
|
|
123
124
|
<Card activeOpacity={1} onPress={() => handleBusinessClick(business)} style={style}>
|
|
125
|
+
{business?.ribbon?.enabled && (
|
|
126
|
+
<RibbonBox
|
|
127
|
+
bgColor={business?.ribbon?.color}
|
|
128
|
+
isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
|
|
129
|
+
isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
|
|
130
|
+
>
|
|
131
|
+
<OText
|
|
132
|
+
size={10}
|
|
133
|
+
weight={'400'}
|
|
134
|
+
color={theme.colors.white}
|
|
135
|
+
numberOfLines={2}
|
|
136
|
+
ellipsizeMode='tail'
|
|
137
|
+
lineHeight={13}
|
|
138
|
+
>
|
|
139
|
+
{business?.ribbon?.text}
|
|
140
|
+
</OText>
|
|
141
|
+
</RibbonBox>
|
|
142
|
+
)}
|
|
124
143
|
<BusinessHero>
|
|
125
144
|
<FastImage
|
|
126
145
|
style={{ height: 120 }}
|
|
@@ -53,3 +53,25 @@ export const Reviews = styled.View`
|
|
|
53
53
|
flex-direction: row;
|
|
54
54
|
align-items: center;
|
|
55
55
|
`
|
|
56
|
+
|
|
57
|
+
export const RibbonBox = styled.View`
|
|
58
|
+
position: absolute;
|
|
59
|
+
z-index: 1;
|
|
60
|
+
top: -4px;
|
|
61
|
+
right: -4px;
|
|
62
|
+
background-color: ${(props: any) => props.theme.colors.primary};
|
|
63
|
+
padding: 1px 8px;
|
|
64
|
+
max-width: 180px;
|
|
65
|
+
|
|
66
|
+
${(props: any) => props.bgColor && css`
|
|
67
|
+
background-color: ${props.bgColor};
|
|
68
|
+
`}
|
|
69
|
+
|
|
70
|
+
${(props: any) => props.isRoundRect && css`
|
|
71
|
+
border-radius: 7.6px;
|
|
72
|
+
`}
|
|
73
|
+
|
|
74
|
+
${(props: any) => props.isCapsule && css`
|
|
75
|
+
border-radius: 50px;
|
|
76
|
+
`}
|
|
77
|
+
`
|
|
@@ -9,7 +9,7 @@ import { useTheme } from 'styled-components/native';
|
|
|
9
9
|
import { OIcon, OText } from '../shared';
|
|
10
10
|
import { StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
11
11
|
import { BusinessControllerParams } from '../../types';
|
|
12
|
-
import { convertHoursToMinutes } from '../../utils';
|
|
12
|
+
import { convertHoursToMinutes, shape } from '../../utils';
|
|
13
13
|
import {
|
|
14
14
|
Card,
|
|
15
15
|
BusinessHero,
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
BusinessState,
|
|
21
21
|
BusinessLogo,
|
|
22
22
|
Reviews,
|
|
23
|
+
RibbonBox
|
|
23
24
|
} from './styles';
|
|
24
25
|
|
|
25
26
|
export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
@@ -97,6 +98,24 @@ export const BusinessFeaturedCtrlUI = (props: BusinessControllerParams) => {
|
|
|
97
98
|
|
|
98
99
|
return (
|
|
99
100
|
<Card activeOpacity={1} onPress={() => handleClick(business)}>
|
|
101
|
+
{business?.ribbon?.enabled && (
|
|
102
|
+
<RibbonBox
|
|
103
|
+
bgColor={business?.ribbon?.color}
|
|
104
|
+
isRoundRect={business?.ribbon?.shape === shape?.rectangleRound}
|
|
105
|
+
isCapsule={business?.ribbon?.shape === shape?.capsuleShape}
|
|
106
|
+
>
|
|
107
|
+
<OText
|
|
108
|
+
size={10}
|
|
109
|
+
weight={'400'}
|
|
110
|
+
color={theme.colors.white}
|
|
111
|
+
numberOfLines={2}
|
|
112
|
+
ellipsizeMode='tail'
|
|
113
|
+
lineHeight={13}
|
|
114
|
+
>
|
|
115
|
+
{business?.ribbon?.text}
|
|
116
|
+
</OText>
|
|
117
|
+
</RibbonBox>
|
|
118
|
+
)}
|
|
100
119
|
<BusinessHero>
|
|
101
120
|
<BusinessLogo>
|
|
102
121
|
<OIcon
|
|
@@ -4,6 +4,7 @@ export const Card = styled.TouchableOpacity`
|
|
|
4
4
|
margin-vertical: 4px;
|
|
5
5
|
height: 60px;
|
|
6
6
|
overflow: hidden;
|
|
7
|
+
position: relative;
|
|
7
8
|
`;
|
|
8
9
|
|
|
9
10
|
export const BusinessHero = styled.View`
|
|
@@ -48,3 +49,25 @@ export const BusinessLogo = styled.View`
|
|
|
48
49
|
export const Reviews = styled.View`
|
|
49
50
|
flex-direction: row;
|
|
50
51
|
`
|
|
52
|
+
|
|
53
|
+
export const RibbonBox = styled.View`
|
|
54
|
+
position: absolute;
|
|
55
|
+
z-index: 1;
|
|
56
|
+
top: 0px;
|
|
57
|
+
right: 5px;
|
|
58
|
+
background-color: ${(props: any) => props.theme.colors.primary};
|
|
59
|
+
padding: 1px 8px;
|
|
60
|
+
max-width: 160px;
|
|
61
|
+
|
|
62
|
+
${(props: any) => props.bgColor && css`
|
|
63
|
+
background-color: ${props.bgColor};
|
|
64
|
+
`}
|
|
65
|
+
|
|
66
|
+
${(props: any) => props.isRoundRect && css`
|
|
67
|
+
border-radius: 7.6px;
|
|
68
|
+
`}
|
|
69
|
+
|
|
70
|
+
${(props: any) => props.isCapsule && css`
|
|
71
|
+
border-radius: 50px;
|
|
72
|
+
`}
|
|
73
|
+
`
|
|
@@ -18,15 +18,12 @@ export const RibbonBox = styled.View`
|
|
|
18
18
|
background-color: ${(props: any) => props.theme.colors.primary};
|
|
19
19
|
padding: 2px 8px;
|
|
20
20
|
max-width: 180px;
|
|
21
|
-
|
|
22
21
|
${(props: any) => props.bgColor && css`
|
|
23
22
|
background-color: ${props.bgColor};
|
|
24
23
|
`}
|
|
25
|
-
|
|
26
24
|
${(props: any) => props.isRoundRect && css`
|
|
27
25
|
border-radius: 7.6px;
|
|
28
26
|
`}
|
|
29
|
-
|
|
30
27
|
${(props: any) => props.isCapsule && css`
|
|
31
28
|
border-radius: 50px;
|
|
32
29
|
`}
|
|
@@ -255,7 +255,7 @@ const CartUI = (props: any) => {
|
|
|
255
255
|
<OSRow>
|
|
256
256
|
<OText size={12} lineHeight={18} numberOfLines={1}>
|
|
257
257
|
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
|
|
258
|
-
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}
|
|
258
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
|
|
259
259
|
</OText>
|
|
260
260
|
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })} >
|
|
261
261
|
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
@@ -891,7 +891,7 @@ export const OrderDetailsUI = (props: OrderDetailsParams) => {
|
|
|
891
891
|
<OSRow>
|
|
892
892
|
<OText size={12} lineHeight={18} weight={'400'} color={theme.colors.textNormal} numberOfLines={1}>
|
|
893
893
|
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}
|
|
894
|
-
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}
|
|
894
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
|
|
895
895
|
</OText>
|
|
896
896
|
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })}>
|
|
897
897
|
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
@@ -112,7 +112,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
112
112
|
{cart?.products?.length > 0 && (
|
|
113
113
|
<>
|
|
114
114
|
<OSProductList>
|
|
115
|
-
{cart?.products
|
|
115
|
+
{cart?.products?.map((product: any) => (
|
|
116
116
|
<ProductItemAccordion
|
|
117
117
|
key={product.code}
|
|
118
118
|
product={product}
|
|
@@ -202,7 +202,7 @@ const OrderSummaryUI = (props: any) => {
|
|
|
202
202
|
<OSRow>
|
|
203
203
|
<OText size={12} numberOfLines={1}>
|
|
204
204
|
{fee.name || t('INHERIT_FROM_BUSINESS', 'Inherit from business')}{' '}
|
|
205
|
-
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)} + `}{fee.percentage}
|
|
205
|
+
({fee?.fixed > 0 && `${parsePrice(fee?.fixed)}${fee.percentage > 0 ? ' + ' : ''}`}{fee.percentage > 0 && `${fee.percentage}%`}){' '}
|
|
206
206
|
</OText>
|
|
207
207
|
<TouchableOpacity onPress={() => setOpenTaxModal({ open: true, data: fee, type: 'fee' })} >
|
|
208
208
|
<AntIcon name='infocirlceo' size={16} color={theme.colors.primary} />
|
|
@@ -51,7 +51,7 @@ const OrderTypeSelectorUI = (props: OrderTypeSelectParams) => {
|
|
|
51
51
|
btnStyle={{ paddingLeft: 0 }}
|
|
52
52
|
paddingTop={0}
|
|
53
53
|
style={{ paddingBottom: 0 }}
|
|
54
|
-
title={t('
|
|
54
|
+
title={t('HOW_WILL_YOU_DELIVERY_TYPE', 'How will your order type?')}
|
|
55
55
|
titleAlign={'center'}
|
|
56
56
|
titleStyle={{ fontSize: 14 }}
|
|
57
57
|
/>
|
|
@@ -292,20 +292,20 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
292
292
|
let _videoId = keys[keys.length - 1]
|
|
293
293
|
|
|
294
294
|
if (_videoId.includes('watch')) {
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
const __url = _videoId.split('=')[1]
|
|
296
|
+
_videoId = __url
|
|
297
297
|
} else if (_videoId.includes('?')) {
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
const __url = _videoId.split('?')[0]
|
|
299
|
+
_videoId = __url
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
if (_videoId.search(/&/i) >= 0) {
|
|
303
|
-
|
|
303
|
+
_videoId = _videoId.split('&')[0]
|
|
304
304
|
} else if (_videoId.search(/\?/i) >= 0) {
|
|
305
|
-
|
|
305
|
+
_videoId = _videoId.split('?')[0]
|
|
306
306
|
}
|
|
307
307
|
if ((_videoId.length === 11)) {
|
|
308
|
-
|
|
308
|
+
videoList.push(_videoId)
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
}
|
|
@@ -326,25 +326,6 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
326
326
|
|
|
327
327
|
const ExtraOptions = ({ eID, options }: any) => (
|
|
328
328
|
<>
|
|
329
|
-
{product?.ingredients.length > 0 && (
|
|
330
|
-
<TouchableOpacity
|
|
331
|
-
key={`eopt_all_00`}
|
|
332
|
-
onPress={() => setSelectedOpt(-1)}
|
|
333
|
-
style={[
|
|
334
|
-
styles.extraItem,
|
|
335
|
-
{
|
|
336
|
-
borderBottomColor:
|
|
337
|
-
selOpt == -1 ? theme.colors.textNormal : theme.colors.border,
|
|
338
|
-
},
|
|
339
|
-
]}>
|
|
340
|
-
<OText
|
|
341
|
-
color={selOpt == -1 ? theme.colors.textNormal : theme.colors.textSecondary}
|
|
342
|
-
size={selOpt == -1 ? 14 : 12}
|
|
343
|
-
weight={selOpt == -1 ? '600' : 'normal'}>
|
|
344
|
-
{t('INGREDIENTS', 'Ingredients')}
|
|
345
|
-
</OText>
|
|
346
|
-
</TouchableOpacity>
|
|
347
|
-
)}
|
|
348
329
|
{options.map(({ id, name, respect_to, suboptions }: any) => (
|
|
349
330
|
<React.Fragment key={`cont_key_${id}`}>
|
|
350
331
|
{respect_to == null && suboptions?.length > 0 && (
|
|
@@ -665,6 +646,25 @@ export const ProductOptionsUI = (props: any) => {
|
|
|
665
646
|
{t('ALL', 'All')}
|
|
666
647
|
</OText>
|
|
667
648
|
</TouchableOpacity>
|
|
649
|
+
{product?.ingredients.length > 0 && (
|
|
650
|
+
<TouchableOpacity
|
|
651
|
+
key={`eopt_all_00`}
|
|
652
|
+
onPress={() => setSelectedOpt(-1)}
|
|
653
|
+
style={[
|
|
654
|
+
styles.extraItem,
|
|
655
|
+
{
|
|
656
|
+
borderBottomColor:
|
|
657
|
+
selOpt == -1 ? theme.colors.textNormal : theme.colors.border,
|
|
658
|
+
},
|
|
659
|
+
]}>
|
|
660
|
+
<OText
|
|
661
|
+
color={selOpt == -1 ? theme.colors.textNormal : theme.colors.textSecondary}
|
|
662
|
+
size={selOpt == -1 ? 14 : 12}
|
|
663
|
+
weight={selOpt == -1 ? '600' : 'normal'}>
|
|
664
|
+
{t('INGREDIENTS', 'Ingredients')}
|
|
665
|
+
</OText>
|
|
666
|
+
</TouchableOpacity>
|
|
667
|
+
)}
|
|
668
668
|
{product?.extras.map((extra: any) =>
|
|
669
669
|
<ExtraOptions key={extra.id} options={extra.options} />
|
|
670
670
|
)}
|