ordering-ui-react-native 0.12.54 → 0.12.58
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/Cart/index.tsx +50 -16
- package/src/components/OrderDetails/index.tsx +8 -0
- package/src/components/OrderSummary/index.tsx +38 -3
- package/src/layouts/Container.tsx +1 -1
- package/themes/business/src/components/OrderDetails/OrderContentComponent.tsx +8 -0
- package/themes/business/src/components/OrderDetails/styles.tsx +1 -0
- package/themes/business/src/layouts/Container.tsx +3 -1
- package/themes/doordash/src/components/Cart/index.tsx +36 -2
- package/themes/doordash/src/components/OrderDetails/index.tsx +8 -0
- package/themes/doordash/src/components/OrderSummary/index.tsx +36 -3
- package/themes/doordash/src/layouts/Container.tsx +1 -1
- package/themes/instacart/src/components/Cart/index.tsx +37 -3
- package/themes/instacart/src/components/OrderDetails/index.tsx +8 -0
- package/themes/instacart/src/components/OrderSummary/index.tsx +37 -4
- package/themes/instacart/src/layouts/Container.tsx +1 -1
- package/themes/kiosk/src/layouts/Container.tsx +2 -1
- package/themes/original/src/components/Cart/index.tsx +268 -234
- package/themes/original/src/components/OrderDetails/index.tsx +723 -715
- package/themes/original/src/components/OrderSummary/index.tsx +37 -3
- package/themes/original/src/layouts/Container.tsx +1 -1
- package/themes/single-business/src/components/Cart/index.tsx +92 -16
- package/themes/single-business/src/components/Cart/styles.tsx +39 -0
- package/themes/single-business/src/components/CartContent/index.tsx +56 -52
- package/themes/single-business/src/components/CartContent/styles.tsx +2 -16
- package/themes/single-business/src/components/PhoneInputNumber/index.tsx +103 -112
- package/themes/single-business/src/components/UserDetails/index.tsx +107 -111
- package/themes/single-business/src/components/UserDetails/styles.tsx +3 -8
- package/themes/single-business/src/components/UserFormDetails/index.tsx +279 -326
- package/themes/single-business/src/components/UserFormDetails/styles.tsx +7 -5
- package/themes/single-business/src/layouts/Container.tsx +1 -1
- package/themes/uber-eats/src/components/Cart/index.tsx +37 -3
- package/themes/uber-eats/src/components/OrderDetails/index.tsx +8 -0
- package/themes/uber-eats/src/components/OrderSummary/index.tsx +40 -6
- package/themes/uber-eats/src/layouts/Container.tsx +1 -1
- package/themes/franchises/index.tsx +0 -111
- package/themes/franchises/src/components/ActiveOrders/index.tsx +0 -134
- package/themes/franchises/src/components/ActiveOrders/styles.tsx +0 -44
- package/themes/franchises/src/components/AddressDetails/index.tsx +0 -77
- package/themes/franchises/src/components/AddressDetails/styles.tsx +0 -21
- package/themes/franchises/src/components/AddressForm/index.tsx +0 -837
- package/themes/franchises/src/components/AddressForm/styles.tsx +0 -27
- package/themes/franchises/src/components/AddressList/index.tsx +0 -338
- package/themes/franchises/src/components/AddressList/styles.tsx +0 -20
- package/themes/franchises/src/components/AppleLogin/index.tsx +0 -149
- package/themes/franchises/src/components/AppleLogin/styles.tsx +0 -21
- package/themes/franchises/src/components/BottomWrapper/index.tsx +0 -29
- package/themes/franchises/src/components/BusinessBasicInformation/index.tsx +0 -310
- package/themes/franchises/src/components/BusinessBasicInformation/styles.tsx +0 -66
- package/themes/franchises/src/components/BusinessController/index.tsx +0 -184
- package/themes/franchises/src/components/BusinessController/styles.tsx +0 -64
- package/themes/franchises/src/components/BusinessFeaturedController/index.tsx +0 -189
- package/themes/franchises/src/components/BusinessFeaturedController/styles.tsx +0 -50
- package/themes/franchises/src/components/BusinessInformation/index.tsx +0 -202
- package/themes/franchises/src/components/BusinessInformation/styles.tsx +0 -39
- package/themes/franchises/src/components/BusinessItemAccordion/index.tsx +0 -125
- package/themes/franchises/src/components/BusinessItemAccordion/styles.tsx +0 -54
- package/themes/franchises/src/components/BusinessProductsCategories/index.tsx +0 -87
- package/themes/franchises/src/components/BusinessProductsCategories/styles.tsx +0 -8
- package/themes/franchises/src/components/BusinessProductsList/index.tsx +0 -199
- package/themes/franchises/src/components/BusinessProductsList/styles.tsx +0 -14
- package/themes/franchises/src/components/BusinessProductsListing/index.tsx +0 -292
- package/themes/franchises/src/components/BusinessProductsListing/styles.tsx +0 -30
- package/themes/franchises/src/components/BusinessReviews/index.tsx +0 -249
- package/themes/franchises/src/components/BusinessReviews/styles.tsx +0 -59
- package/themes/franchises/src/components/BusinessTypeFilter/index.tsx +0 -127
- package/themes/franchises/src/components/BusinessTypeFilter/styles.tsx +0 -40
- package/themes/franchises/src/components/BusinessesListing/index.tsx +0 -339
- package/themes/franchises/src/components/BusinessesListing/styles.tsx +0 -92
- package/themes/franchises/src/components/Cart/index.tsx +0 -298
- package/themes/franchises/src/components/Cart/styles.tsx +0 -28
- package/themes/franchises/src/components/CartContent/index.tsx +0 -60
- package/themes/franchises/src/components/CartContent/styles.tsx +0 -19
- package/themes/franchises/src/components/Checkout/index.tsx +0 -664
- package/themes/franchises/src/components/Checkout/styles.tsx +0 -89
- package/themes/franchises/src/components/CouponControl/index.tsx +0 -119
- package/themes/franchises/src/components/CouponControl/styles.tsx +0 -22
- package/themes/franchises/src/components/DriverTips/index.tsx +0 -167
- package/themes/franchises/src/components/DriverTips/styles.tsx +0 -63
- package/themes/franchises/src/components/FacebookLogin/index.tsx +0 -107
- package/themes/franchises/src/components/FacebookLogin/styles.tsx +0 -21
- package/themes/franchises/src/components/FloatingButton/index.tsx +0 -100
- package/themes/franchises/src/components/FloatingButton/styles.tsx +0 -26
- package/themes/franchises/src/components/ForgotPasswordForm/index.tsx +0 -156
- package/themes/franchises/src/components/ForgotPasswordForm/styles.tsx +0 -11
- package/themes/franchises/src/components/GPSButton/index.tsx +0 -84
- package/themes/franchises/src/components/GPSButton/styles.ts +0 -6
- package/themes/franchises/src/components/GoogleLogin/index.tsx +0 -122
- package/themes/franchises/src/components/GoogleLogin/styles.tsx +0 -23
- package/themes/franchises/src/components/GoogleMap/index.tsx +0 -229
- package/themes/franchises/src/components/Help/index.tsx +0 -56
- package/themes/franchises/src/components/Help/styles.tsx +0 -11
- package/themes/franchises/src/components/HelpAccountAndPayment/index.tsx +0 -68
- package/themes/franchises/src/components/HelpAccountAndPayment/styles.tsx +0 -6
- package/themes/franchises/src/components/HelpGuide/index.tsx +0 -67
- package/themes/franchises/src/components/HelpGuide/styles.tsx +0 -6
- package/themes/franchises/src/components/HelpOrder/index.tsx +0 -79
- package/themes/franchises/src/components/HelpOrder/styles.tsx +0 -6
- package/themes/franchises/src/components/Home/index.tsx +0 -102
- package/themes/franchises/src/components/Home/styles.tsx +0 -18
- package/themes/franchises/src/components/LanguageSelector/index.tsx +0 -98
- package/themes/franchises/src/components/LanguageSelector/styles.tsx +0 -7
- package/themes/franchises/src/components/LastOrder/index.tsx +0 -168
- package/themes/franchises/src/components/LastOrder/styles.tsx +0 -16
- package/themes/franchises/src/components/LastOrders/index.tsx +0 -104
- package/themes/franchises/src/components/LastOrders/styles.tsx +0 -17
- package/themes/franchises/src/components/LoginForm/index.tsx +0 -512
- package/themes/franchises/src/components/LoginForm/styles.tsx +0 -77
- package/themes/franchises/src/components/LogoutButton/index.tsx +0 -36
- package/themes/franchises/src/components/Messages/index.tsx +0 -359
- package/themes/franchises/src/components/Messages/styles.tsx +0 -20
- package/themes/franchises/src/components/MomentOption/index.tsx +0 -321
- package/themes/franchises/src/components/MomentOption/styles.tsx +0 -66
- package/themes/franchises/src/components/NavBar/index.tsx +0 -129
- package/themes/franchises/src/components/NotFoundSource/index.tsx +0 -50
- package/themes/franchises/src/components/NotFoundSource/styles.tsx +0 -16
- package/themes/franchises/src/components/Notifications/index.tsx +0 -120
- package/themes/franchises/src/components/Notifications/styles.ts +0 -21
- package/themes/franchises/src/components/OrderDetails/index.tsx +0 -820
- package/themes/franchises/src/components/OrderDetails/styles.tsx +0 -120
- package/themes/franchises/src/components/OrderSummary/index.tsx +0 -232
- package/themes/franchises/src/components/OrderSummary/styles.tsx +0 -41
- package/themes/franchises/src/components/OrderTypeSelector/index.tsx +0 -92
- package/themes/franchises/src/components/OrderTypeSelector/styles.tsx +0 -27
- package/themes/franchises/src/components/OrdersOption/index.tsx +0 -243
- package/themes/franchises/src/components/OrdersOption/styles.tsx +0 -5
- package/themes/franchises/src/components/PaymentOptionCash/index.tsx +0 -102
- package/themes/franchises/src/components/PaymentOptionCash/styles.tsx +0 -18
- package/themes/franchises/src/components/PaymentOptionStripe/index.tsx +0 -234
- package/themes/franchises/src/components/PaymentOptionStripe/styles.tsx +0 -71
- package/themes/franchises/src/components/PaymentOptions/index.tsx +0 -430
- package/themes/franchises/src/components/PaymentOptions/styles.tsx +0 -77
- package/themes/franchises/src/components/PhoneInputNumber/index.tsx +0 -127
- package/themes/franchises/src/components/PhoneInputNumber/styles.tsx +0 -3
- package/themes/franchises/src/components/PreviousOrders/index.tsx +0 -188
- package/themes/franchises/src/components/PreviousOrders/styles.tsx +0 -33
- package/themes/franchises/src/components/ProductForm/index.tsx +0 -695
- package/themes/franchises/src/components/ProductForm/styles.tsx +0 -78
- package/themes/franchises/src/components/ProductIngredient/index.tsx +0 -43
- package/themes/franchises/src/components/ProductIngredient/styles.tsx +0 -7
- package/themes/franchises/src/components/ProductItemAccordion/index.tsx +0 -276
- package/themes/franchises/src/components/ProductItemAccordion/styles.tsx +0 -57
- package/themes/franchises/src/components/ProductOption/index.tsx +0 -50
- package/themes/franchises/src/components/ProductOption/styles.tsx +0 -11
- package/themes/franchises/src/components/ProductOptionSubOption/index.tsx +0 -146
- package/themes/franchises/src/components/ProductOptionSubOption/styles.tsx +0 -32
- package/themes/franchises/src/components/ReviewDriver/index.tsx +0 -221
- package/themes/franchises/src/components/ReviewDriver/styles.tsx +0 -46
- package/themes/franchises/src/components/ReviewOrder/index.tsx +0 -325
- package/themes/franchises/src/components/ReviewOrder/styles.tsx +0 -46
- package/themes/franchises/src/components/ReviewProduct/index.tsx +0 -275
- package/themes/franchises/src/components/ReviewProduct/styles.tsx +0 -53
- package/themes/franchises/src/components/SearchBar/index.tsx +0 -139
- package/themes/franchises/src/components/SignupForm/index.tsx +0 -643
- package/themes/franchises/src/components/SignupForm/styles.tsx +0 -27
- package/themes/franchises/src/components/SingleProductCard/index.tsx +0 -124
- package/themes/franchises/src/components/SingleProductCard/styles.tsx +0 -23
- package/themes/franchises/src/components/StripeCardForm/index.tsx +0 -97
- package/themes/franchises/src/components/StripeCardForm/naked.tsx +0 -128
- package/themes/franchises/src/components/StripeCardForm/styles.tsx +0 -32
- package/themes/franchises/src/components/StripeCardsList/index.tsx +0 -182
- package/themes/franchises/src/components/StripeElementsForm/index.tsx +0 -204
- package/themes/franchises/src/components/StripeElementsForm/naked.tsx +0 -90
- package/themes/franchises/src/components/StripeElementsForm/styles.tsx +0 -13
- package/themes/franchises/src/components/StripeRedirectForm/index.tsx +0 -159
- package/themes/franchises/src/components/StripeRedirectForm/styles.tsx +0 -23
- package/themes/franchises/src/components/TagSelector/index.tsx +0 -94
- package/themes/franchises/src/components/TagSelector/styles.ts +0 -0
- package/themes/franchises/src/components/TaxInformation/index.tsx +0 -51
- package/themes/franchises/src/components/TaxInformation/styles.tsx +0 -9
- package/themes/franchises/src/components/UpsellingProducts/index.tsx +0 -222
- package/themes/franchises/src/components/UpsellingProducts/styles.tsx +0 -50
- package/themes/franchises/src/components/UserDetails/index.tsx +0 -134
- package/themes/franchises/src/components/UserDetails/styles.tsx +0 -26
- package/themes/franchises/src/components/UserFormDetails/index.tsx +0 -351
- package/themes/franchises/src/components/UserFormDetails/styles.tsx +0 -35
- package/themes/franchises/src/components/UserProfile/index.tsx +0 -179
- package/themes/franchises/src/components/UserProfile/styles.ts +0 -42
- package/themes/franchises/src/components/UserProfileForm/index.tsx +0 -253
- package/themes/franchises/src/components/UserProfileForm/styles.tsx +0 -29
- package/themes/franchises/src/components/VerifyPhone/index.tsx +0 -188
- package/themes/franchises/src/components/VerifyPhone/styles.tsx +0 -43
- package/themes/franchises/src/components/shared/OAlert.tsx +0 -55
- package/themes/franchises/src/components/shared/OBottomPopup.tsx +0 -73
- package/themes/franchises/src/components/shared/OBottomStickBar.tsx +0 -62
- package/themes/franchises/src/components/shared/OButton.tsx +0 -132
- package/themes/franchises/src/components/shared/ODropDown.tsx +0 -169
- package/themes/franchises/src/components/shared/OIcon.tsx +0 -53
- package/themes/franchises/src/components/shared/OIconButton.tsx +0 -127
- package/themes/franchises/src/components/shared/OIconText.tsx +0 -54
- package/themes/franchises/src/components/shared/OInput.tsx +0 -113
- package/themes/franchises/src/components/shared/OKeyButton.tsx +0 -35
- package/themes/franchises/src/components/shared/OModal.tsx +0 -172
- package/themes/franchises/src/components/shared/OText.tsx +0 -52
- package/themes/franchises/src/components/shared/OTextarea.tsx +0 -36
- package/themes/franchises/src/components/shared/OToast.tsx +0 -93
- package/themes/franchises/src/components/shared/OToggle.tsx +0 -158
- package/themes/franchises/src/components/shared/index.tsx +0 -29
- package/themes/franchises/src/config/constants.tsx +0 -57
- package/themes/franchises/src/layouts/Container.tsx +0 -23
- package/themes/franchises/src/layouts/SafeAreaContainer.tsx +0 -6
- package/themes/franchises/src/providers/AlertProvider.tsx +0 -43
- package/themes/franchises/src/providers/StoreUtil.tsx +0 -50
- package/themes/franchises/src/types/index.tsx +0 -445
- package/themes/franchises/src/utils/index.tsx +0 -222
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ActivityIndicator,
|
|
3
|
-
ImageSourcePropType,
|
|
4
|
-
ImageStyle,
|
|
5
|
-
TextStyle,
|
|
6
|
-
TouchableOpacity,
|
|
7
|
-
View,
|
|
8
|
-
ViewStyle,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
|
|
11
|
-
import * as React from 'react';
|
|
12
|
-
import styled from 'styled-components/native';
|
|
13
|
-
import { OIcon } from './';
|
|
14
|
-
|
|
15
|
-
const StyledButton = styled.View<Props>`
|
|
16
|
-
background-color: ${(props: any) => props.theme.colors.primary};
|
|
17
|
-
border-radius: 26px;
|
|
18
|
-
border-width: 2px;
|
|
19
|
-
height: 52px;
|
|
20
|
-
border-color: ${(props: any) => props.theme.colors.primary};
|
|
21
|
-
flex-direction: row;
|
|
22
|
-
align-items: center;
|
|
23
|
-
justify-content: center;
|
|
24
|
-
box-shadow: 1px 1px 2px #00000020;
|
|
25
|
-
padding-left: 20px;
|
|
26
|
-
padding-right: 20px;
|
|
27
|
-
position: relative;
|
|
28
|
-
`
|
|
29
|
-
const StyledButtonDisabled = styled(StyledButton)`
|
|
30
|
-
background-color: ${(props: any) => props.theme.colors.disabled};
|
|
31
|
-
border-color: ${(props: any) => props.theme.colors.disabled};
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
const StyledText = styled.Text`
|
|
35
|
-
font-size: 16px;
|
|
36
|
-
color: ${(props: any) => props.theme.colors.btnFont};
|
|
37
|
-
margin-left: 10px;
|
|
38
|
-
margin-right: 10px;
|
|
39
|
-
font-family: 'Poppins-Regular';
|
|
40
|
-
`
|
|
41
|
-
|
|
42
|
-
const StyledTextDisabled = styled(StyledText)`
|
|
43
|
-
color: ${(props: any) => props.theme.colors.primary};
|
|
44
|
-
`
|
|
45
|
-
|
|
46
|
-
const StyledImage = styled.Image`
|
|
47
|
-
width: 20px;
|
|
48
|
-
height: 20px;
|
|
49
|
-
resize-mode: contain;
|
|
50
|
-
`
|
|
51
|
-
const EndImage = styled.Image`
|
|
52
|
-
width: 17px;
|
|
53
|
-
height: 15px;
|
|
54
|
-
resize-mode: contain;
|
|
55
|
-
right: 17.5px;
|
|
56
|
-
position: absolute;
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
interface Props {
|
|
60
|
-
testID?: string;
|
|
61
|
-
isLoading?: boolean;
|
|
62
|
-
isDisabled?: boolean;
|
|
63
|
-
onClick?: () => void;
|
|
64
|
-
style?: ViewStyle;
|
|
65
|
-
parentStyle?: ViewStyle;
|
|
66
|
-
disabledStyle?: ViewStyle;
|
|
67
|
-
textStyle?: TextStyle;
|
|
68
|
-
imgLeftSrc?: ImageSourcePropType | string;
|
|
69
|
-
imgLeftStyle?: ImageStyle;
|
|
70
|
-
imgRightSrc?: any;
|
|
71
|
-
imgRightStyle?: ImageStyle;
|
|
72
|
-
indicatorColor?: string;
|
|
73
|
-
activeOpacity?: number;
|
|
74
|
-
text?: string;
|
|
75
|
-
isCircle?: boolean;
|
|
76
|
-
bgColor?: string;
|
|
77
|
-
borderColor?: string;
|
|
78
|
-
loadingStyle?: ViewStyle;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const OButton = (props: Props): React.ReactElement => {
|
|
82
|
-
|
|
83
|
-
if (props.isDisabled) {
|
|
84
|
-
return (
|
|
85
|
-
<View style={props.parentStyle}>
|
|
86
|
-
<StyledButtonDisabled style={props.style}>
|
|
87
|
-
<StyledTextDisabled style={props.textStyle}>
|
|
88
|
-
{props.text}
|
|
89
|
-
</StyledTextDisabled>
|
|
90
|
-
</StyledButtonDisabled>
|
|
91
|
-
</View>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
if (props.isLoading) {
|
|
96
|
-
return (
|
|
97
|
-
<StyledButton style={props.style}>
|
|
98
|
-
<ActivityIndicator size="small" color={props.indicatorColor} style={props.loadingStyle} />
|
|
99
|
-
</StyledButton>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return (
|
|
104
|
-
<TouchableOpacity
|
|
105
|
-
testID={props.testID}
|
|
106
|
-
activeOpacity={props.activeOpacity}
|
|
107
|
-
onPress={props.onClick}
|
|
108
|
-
style={{ width: props.isCircle ? 52 : props.style?.width, ...props.parentStyle }}
|
|
109
|
-
>
|
|
110
|
-
<StyledButton style={props.bgColor ? { ...props.style, backgroundColor: props.bgColor, borderColor: props.borderColor } : props.style}>
|
|
111
|
-
{props.imgLeftSrc ? (
|
|
112
|
-
<OIcon style={props.imgLeftStyle} src={props.imgLeftSrc} />
|
|
113
|
-
) : null}
|
|
114
|
-
{props.text ? (
|
|
115
|
-
<StyledText style={props.textStyle}>{props.text}</StyledText>
|
|
116
|
-
) : null}
|
|
117
|
-
{props.imgRightSrc ? (
|
|
118
|
-
<EndImage style={props.imgRightStyle} source={props.imgRightSrc} />
|
|
119
|
-
) : null}
|
|
120
|
-
</StyledButton>
|
|
121
|
-
</TouchableOpacity>
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
OButton.defaultProps = {
|
|
126
|
-
isLoading: false,
|
|
127
|
-
isDisabled: false,
|
|
128
|
-
indicatorColor: 'white',
|
|
129
|
-
activeOpacity: 0.5,
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export default OButton;
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import styled, { css } from 'styled-components/native'
|
|
3
|
-
import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'
|
|
4
|
-
import { ScrollView as CustomScrollView, TouchableOpacity as CustomTouchableOpacity } from 'react-native'
|
|
5
|
-
import { useTheme } from 'styled-components/native';
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
secondary?: boolean,
|
|
9
|
-
options?: any;
|
|
10
|
-
defaultValue?: any,
|
|
11
|
-
placeholder?: string,
|
|
12
|
-
onSelect?: any,
|
|
13
|
-
style?: any,
|
|
14
|
-
dropViewMaxHeight?: any,
|
|
15
|
-
isModal?: any,
|
|
16
|
-
bgcolor?: string,
|
|
17
|
-
textcolor?: string,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const Wrapper = styled.View`
|
|
21
|
-
position: relative;
|
|
22
|
-
`
|
|
23
|
-
|
|
24
|
-
const ODropDown = (props: Props) => {
|
|
25
|
-
const {
|
|
26
|
-
secondary,
|
|
27
|
-
options,
|
|
28
|
-
defaultValue,
|
|
29
|
-
placeholder,
|
|
30
|
-
onSelect,
|
|
31
|
-
dropViewMaxHeight,
|
|
32
|
-
isModal
|
|
33
|
-
} = props
|
|
34
|
-
|
|
35
|
-
const theme = useTheme();
|
|
36
|
-
|
|
37
|
-
const Selected = styled.TouchableOpacity`
|
|
38
|
-
flex-direction: row;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: space-between;
|
|
41
|
-
position: relative;
|
|
42
|
-
padding: 15px;
|
|
43
|
-
border-radius: 10px;
|
|
44
|
-
border-width: 1px;
|
|
45
|
-
border-color: ${(props: any) => props.bgcolor || (props.secondary ? theme.colors.lightGray : theme.colors.primary)};
|
|
46
|
-
background-color: ${(props: any) => props.bgcolor || (props.secondary ? theme.colors.white : theme.colors.primary)};
|
|
47
|
-
`
|
|
48
|
-
const SelectedLabel = styled.Text`
|
|
49
|
-
font-size: 16px;
|
|
50
|
-
color: ${(props: any) => props.textcolor || (props.secondary ? theme.colors.black : theme.colors.white)};
|
|
51
|
-
`
|
|
52
|
-
const DropIcon = styled.Image`
|
|
53
|
-
tint-color: ${(props: any) => props.textcolor || (props.secondary ? theme.colors.black : theme.colors.white)};
|
|
54
|
-
resize-mode: contain;
|
|
55
|
-
width: 7px;
|
|
56
|
-
height: 7px;
|
|
57
|
-
margin-left: 5px;
|
|
58
|
-
`
|
|
59
|
-
const DropView = styled.View`
|
|
60
|
-
position: absolute;
|
|
61
|
-
z-index: 9999;
|
|
62
|
-
top: 54px;
|
|
63
|
-
border-width: 1px;
|
|
64
|
-
border-color: ${theme.colors.lightGray};
|
|
65
|
-
background-color: ${theme.colors.white};
|
|
66
|
-
border-radius: 10px;
|
|
67
|
-
width: 100%;
|
|
68
|
-
`
|
|
69
|
-
const DropOption = styled.Text`
|
|
70
|
-
padding: 15px;
|
|
71
|
-
font-size: 16px;
|
|
72
|
-
border-bottom-width: 1px;
|
|
73
|
-
border-bottom-color: ${theme.colors.lightGray};
|
|
74
|
-
${(props: any) => props.selected && css`
|
|
75
|
-
color: ${theme.colors.primary};
|
|
76
|
-
`};
|
|
77
|
-
`
|
|
78
|
-
|
|
79
|
-
const [isOpen, setIsOpen] = useState(false)
|
|
80
|
-
const defaultOption = options?.find((option: any) => option.value === defaultValue)
|
|
81
|
-
const [selectedOption, setSelectedOption] = useState<any>(defaultOption)
|
|
82
|
-
const [value, setValue] = useState(defaultValue)
|
|
83
|
-
|
|
84
|
-
const onToggle = () => {
|
|
85
|
-
setIsOpen(!isOpen)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const onSelectOption = (option: any) => {
|
|
89
|
-
setSelectedOption(option)
|
|
90
|
-
setValue(option.value)
|
|
91
|
-
onSelect(option.value || option.name)
|
|
92
|
-
setIsOpen(false)
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
const _defaultOption = options?.find((option: any) => option.value === defaultValue)
|
|
97
|
-
setSelectedOption(_defaultOption)
|
|
98
|
-
setValue(defaultValue)
|
|
99
|
-
}, [defaultValue, options])
|
|
100
|
-
|
|
101
|
-
return (
|
|
102
|
-
<Wrapper style={props.style}>
|
|
103
|
-
<Selected
|
|
104
|
-
secondary={secondary}
|
|
105
|
-
bgcolor={props.bgcolor}
|
|
106
|
-
onPress={() => onToggle()}
|
|
107
|
-
>
|
|
108
|
-
<SelectedLabel
|
|
109
|
-
secondary={secondary}
|
|
110
|
-
textcolor={props.textcolor}
|
|
111
|
-
>
|
|
112
|
-
{selectedOption?.content || selectedOption?.name || placeholder}
|
|
113
|
-
</SelectedLabel>
|
|
114
|
-
<DropIcon
|
|
115
|
-
textcolor={props.textcolor}
|
|
116
|
-
secondary={secondary}
|
|
117
|
-
source={theme.images.drop_down}
|
|
118
|
-
/>
|
|
119
|
-
</Selected>
|
|
120
|
-
{isOpen && options && (
|
|
121
|
-
<DropView
|
|
122
|
-
secondary={secondary}
|
|
123
|
-
>
|
|
124
|
-
{!isModal ? (
|
|
125
|
-
<ScrollView style={{
|
|
126
|
-
maxHeight: dropViewMaxHeight || null
|
|
127
|
-
}}
|
|
128
|
-
>
|
|
129
|
-
{options.map((option: any, index: number) => (
|
|
130
|
-
<TouchableOpacity
|
|
131
|
-
key={index}
|
|
132
|
-
onPress={() => onSelectOption(option)}
|
|
133
|
-
>
|
|
134
|
-
<DropOption
|
|
135
|
-
numberOfLines={1}
|
|
136
|
-
selected={value === option.value}
|
|
137
|
-
>
|
|
138
|
-
{option.content || option.name}
|
|
139
|
-
</DropOption>
|
|
140
|
-
</TouchableOpacity>
|
|
141
|
-
))}
|
|
142
|
-
</ScrollView>
|
|
143
|
-
) : (
|
|
144
|
-
<CustomScrollView style={{
|
|
145
|
-
maxHeight: dropViewMaxHeight || null
|
|
146
|
-
}}
|
|
147
|
-
>
|
|
148
|
-
{options.map((option: any, index: number) => (
|
|
149
|
-
<CustomTouchableOpacity
|
|
150
|
-
key={index}
|
|
151
|
-
onPress={() => onSelectOption(option)}
|
|
152
|
-
>
|
|
153
|
-
<DropOption
|
|
154
|
-
numberOfLines={1}
|
|
155
|
-
selected={value === option.value}
|
|
156
|
-
>
|
|
157
|
-
{option.content || option.name}
|
|
158
|
-
</DropOption>
|
|
159
|
-
</CustomTouchableOpacity>
|
|
160
|
-
))}
|
|
161
|
-
</CustomScrollView>
|
|
162
|
-
)}
|
|
163
|
-
</DropView>
|
|
164
|
-
)}
|
|
165
|
-
</Wrapper>
|
|
166
|
-
)
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export default ODropDown
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import { ImageStyle } from 'react-native'
|
|
4
|
-
import styled from 'styled-components/native'
|
|
5
|
-
|
|
6
|
-
const Wrapper = styled.View``
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
9
|
-
src?: any,
|
|
10
|
-
url?: string,
|
|
11
|
-
dummy?: any,
|
|
12
|
-
color?: string,
|
|
13
|
-
width?: number,
|
|
14
|
-
height?: number,
|
|
15
|
-
style?: ImageStyle,
|
|
16
|
-
isWrap?: boolean,
|
|
17
|
-
cover?: boolean,
|
|
18
|
-
children?: any,
|
|
19
|
-
borderRadius?: number,
|
|
20
|
-
}
|
|
21
|
-
const SImage = styled.Image`
|
|
22
|
-
tint-color: ${(props: any) => props.theme.colors.primary};
|
|
23
|
-
`
|
|
24
|
-
|
|
25
|
-
const OImage = (props: Props): React.ReactElement => {
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Wrapper style={{ borderRadius: props.style?.borderRadius, overflow: 'hidden', marginHorizontal: props.style?.marginHorizontal }}>
|
|
29
|
-
<SImage
|
|
30
|
-
source={props.src ? props.src : props.url ? { uri: props.url } : props.dummy}
|
|
31
|
-
style={{
|
|
32
|
-
tintColor: props.color,
|
|
33
|
-
flex: props.isWrap ? 1 : 0,
|
|
34
|
-
width: props.width,
|
|
35
|
-
height: props.height,
|
|
36
|
-
marginHorizontal: 0,
|
|
37
|
-
borderRadius: props.borderRadius,
|
|
38
|
-
...props.style,
|
|
39
|
-
}}
|
|
40
|
-
resizeMode={props.cover ? 'cover' : 'contain'}
|
|
41
|
-
>
|
|
42
|
-
{props.children}
|
|
43
|
-
</SImage>
|
|
44
|
-
</Wrapper>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
OImage.defaultProps = {
|
|
49
|
-
width: 26,
|
|
50
|
-
height: 26
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export default OImage;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { ImageStyle, TextStyle, ViewStyle } from 'react-native'
|
|
3
|
-
import styled, { useTheme } from 'styled-components/native'
|
|
4
|
-
|
|
5
|
-
const Wrapper = styled.TouchableOpacity`
|
|
6
|
-
height: 40px;
|
|
7
|
-
border-radius: 20px;
|
|
8
|
-
flex-direction: row;
|
|
9
|
-
border: 1px solid white;
|
|
10
|
-
padding-horizontal: 20px;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
`
|
|
14
|
-
const DisabledWrapper = styled.View`
|
|
15
|
-
height: 40px;
|
|
16
|
-
border-radius: 20px;
|
|
17
|
-
flex-direction: row;
|
|
18
|
-
border: 1px solid white;
|
|
19
|
-
padding-horizontal: 20px;
|
|
20
|
-
align-items: center;
|
|
21
|
-
justify-content: center;
|
|
22
|
-
`
|
|
23
|
-
const Icon = styled.Image`
|
|
24
|
-
width: 22px;
|
|
25
|
-
height: 22px;
|
|
26
|
-
`
|
|
27
|
-
const Title = styled.Text`
|
|
28
|
-
font-size: 16px;
|
|
29
|
-
margin-horizontal: 7px;
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
interface Props {
|
|
33
|
-
icon?: any,
|
|
34
|
-
title?: string,
|
|
35
|
-
onClick?: any,
|
|
36
|
-
height?: number,
|
|
37
|
-
isOutline?: boolean,
|
|
38
|
-
disabled?: boolean,
|
|
39
|
-
color?: string,
|
|
40
|
-
bgColor?: string,
|
|
41
|
-
borderColor?: string,
|
|
42
|
-
textColor?: string,
|
|
43
|
-
iconColor?: string
|
|
44
|
-
style?: ViewStyle,
|
|
45
|
-
iconStyle?: ImageStyle,
|
|
46
|
-
textStyle?: TextStyle,
|
|
47
|
-
disabledColor?: string,
|
|
48
|
-
iconCover?: boolean,
|
|
49
|
-
urlIcon?: any,
|
|
50
|
-
cover?: any,
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const OIconButton = (props: Props) => {
|
|
54
|
-
const theme = useTheme();
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<>
|
|
58
|
-
{!props.disabled ? (
|
|
59
|
-
<Wrapper
|
|
60
|
-
onPress={props.onClick}
|
|
61
|
-
style={{
|
|
62
|
-
borderColor: props.borderColor || props.color,
|
|
63
|
-
backgroundColor: props.isOutline ? 'white' : props.bgColor || props.color,
|
|
64
|
-
height: props.height || 40,
|
|
65
|
-
borderRadius: props.height ? props.height * 0.5 : 20,
|
|
66
|
-
...props.style
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
{props.icon ? (
|
|
70
|
-
<Icon
|
|
71
|
-
source={props.icon}
|
|
72
|
-
style={{
|
|
73
|
-
tintColor: props.iconColor,
|
|
74
|
-
...props.iconStyle
|
|
75
|
-
}}
|
|
76
|
-
/>
|
|
77
|
-
) : null}
|
|
78
|
-
{props.title ? (
|
|
79
|
-
<Title style={{
|
|
80
|
-
color: props.textColor || props.color,
|
|
81
|
-
...props.textStyle
|
|
82
|
-
}}
|
|
83
|
-
>
|
|
84
|
-
{props.title}
|
|
85
|
-
</Title>
|
|
86
|
-
) : null}
|
|
87
|
-
</Wrapper>
|
|
88
|
-
) : (
|
|
89
|
-
<DisabledWrapper
|
|
90
|
-
style={{
|
|
91
|
-
borderColor: theme.colors.backgroundDark,
|
|
92
|
-
backgroundColor: props.disabledColor ? props.disabledColor : theme.colors.backgroundDark,
|
|
93
|
-
height: props.height || 40,
|
|
94
|
-
borderRadius: props.height ? props.height * 0.5 : 20,
|
|
95
|
-
...props.style
|
|
96
|
-
}}
|
|
97
|
-
>
|
|
98
|
-
{props.icon ? (
|
|
99
|
-
<Icon
|
|
100
|
-
source={props.urlIcon ? { uri: props.icon } : props.icon}
|
|
101
|
-
resizeMode={props.cover ? 'cover' : 'contain'}
|
|
102
|
-
style={{
|
|
103
|
-
tintColor: props.iconColor,
|
|
104
|
-
...props.iconStyle
|
|
105
|
-
}}
|
|
106
|
-
/>
|
|
107
|
-
) : null}
|
|
108
|
-
{props.title ? (
|
|
109
|
-
<Title style={{
|
|
110
|
-
color: props.textColor || props.color,
|
|
111
|
-
...props.textStyle
|
|
112
|
-
}}
|
|
113
|
-
>
|
|
114
|
-
{props.title}
|
|
115
|
-
</Title>
|
|
116
|
-
) : null}
|
|
117
|
-
</DisabledWrapper>
|
|
118
|
-
)}
|
|
119
|
-
</>
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
OIconButton.defaultProps = {
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export default OIconButton;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { ImageStyle, TextStyle, ViewStyle } from 'react-native'
|
|
3
|
-
import styled from 'styled-components/native'
|
|
4
|
-
|
|
5
|
-
const Wrapper = styled.View`
|
|
6
|
-
flex-direction: row;
|
|
7
|
-
`
|
|
8
|
-
const Icon = styled.Image`
|
|
9
|
-
resize-mode: contain;
|
|
10
|
-
tint-color: black;
|
|
11
|
-
margin-right: 3px;
|
|
12
|
-
`
|
|
13
|
-
const Label = styled.Text`
|
|
14
|
-
flex-wrap: wrap;
|
|
15
|
-
color: black;
|
|
16
|
-
font-size: 14px;
|
|
17
|
-
font-family: 'Poppins-Regular';
|
|
18
|
-
`
|
|
19
|
-
|
|
20
|
-
interface Props {
|
|
21
|
-
icon?: any,
|
|
22
|
-
text?: string,
|
|
23
|
-
size?: number,
|
|
24
|
-
color?: string,
|
|
25
|
-
style?: ViewStyle,
|
|
26
|
-
imgStyle?: ImageStyle,
|
|
27
|
-
textStyle?: TextStyle
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const OIconText = (props: Props) => {
|
|
31
|
-
return (
|
|
32
|
-
<Wrapper style={props.style}>
|
|
33
|
-
{props.icon ? (
|
|
34
|
-
<Icon
|
|
35
|
-
source={props.icon}
|
|
36
|
-
style={{
|
|
37
|
-
width: props.size ? props.size : 18,
|
|
38
|
-
height: props.size ? props.size : 18,
|
|
39
|
-
tintColor: props.color,
|
|
40
|
-
...props.imgStyle}}></Icon>
|
|
41
|
-
) : null}
|
|
42
|
-
<Label style={{
|
|
43
|
-
fontSize: props.size? props.size : 14,
|
|
44
|
-
color: props.color,
|
|
45
|
-
...props.textStyle}}>{props.text}</Label>
|
|
46
|
-
</Wrapper>
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
OIconText.defaultProps = {
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default OIconText
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ImageSourcePropType, ImageStyle, ViewStyle, TextInputProps, TextStyle } from 'react-native';
|
|
3
|
-
import styled from 'styled-components/native';
|
|
4
|
-
import OIcon from './OIcon';
|
|
5
|
-
import MaterialIcon from 'react-native-vector-icons/MaterialIcons'
|
|
6
|
-
|
|
7
|
-
const Input = styled.TextInput`
|
|
8
|
-
flex-grow: 1;
|
|
9
|
-
flex: 1;
|
|
10
|
-
min-height: 30px;
|
|
11
|
-
font-size: 15px;
|
|
12
|
-
font-family: 'Poppins-Regular';
|
|
13
|
-
padding: 0;
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
interface Props extends TextInputProps {
|
|
17
|
-
bgColor?: string;
|
|
18
|
-
borderColor?: string;
|
|
19
|
-
isRequired?: boolean;
|
|
20
|
-
requiredMsg?: string;
|
|
21
|
-
isDisabled?: boolean;
|
|
22
|
-
isSecured?: boolean;
|
|
23
|
-
style?: ViewStyle;
|
|
24
|
-
placeholder?: string;
|
|
25
|
-
icon?: ImageSourcePropType | string;
|
|
26
|
-
iconRight?: ImageSourcePropType;
|
|
27
|
-
iconColor?: string;
|
|
28
|
-
iconRightColor?: string;
|
|
29
|
-
iconStyle?: ImageStyle;
|
|
30
|
-
iconRightStyle?: ImageStyle;
|
|
31
|
-
iconCustomRight?: any;
|
|
32
|
-
value?: string;
|
|
33
|
-
onChange?: any;
|
|
34
|
-
name?: string;
|
|
35
|
-
type?: string;
|
|
36
|
-
multiline?: boolean;
|
|
37
|
-
vertorIcon?: string;
|
|
38
|
-
vectorIconColor?: string;
|
|
39
|
-
forwardRef?: any;
|
|
40
|
-
inputStyle?: TextStyle;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const Wrapper = styled.View`
|
|
44
|
-
background-color: ${(props: any) => props.theme.colors.backgroundLight};
|
|
45
|
-
border-radius: 25px;
|
|
46
|
-
border-width: 1px;
|
|
47
|
-
padding-horizontal: 16px;
|
|
48
|
-
height: 50px;
|
|
49
|
-
flex-direction: row;
|
|
50
|
-
align-items: center;
|
|
51
|
-
flex: 1;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
const OInput = (props: Props): React.ReactElement => {
|
|
56
|
-
return (
|
|
57
|
-
<Wrapper
|
|
58
|
-
style={{
|
|
59
|
-
backgroundColor: props.bgColor,
|
|
60
|
-
borderColor: props.borderColor,
|
|
61
|
-
...props.style,
|
|
62
|
-
}}>
|
|
63
|
-
{props.icon ? (
|
|
64
|
-
<OIcon
|
|
65
|
-
src={props.icon}
|
|
66
|
-
color={props.iconColor}
|
|
67
|
-
width={20}
|
|
68
|
-
style={{ marginRight: 10, ...props.iconStyle }}
|
|
69
|
-
/>
|
|
70
|
-
) : null}
|
|
71
|
-
{props.vertorIcon && (
|
|
72
|
-
<MaterialIcon name={props?.vertorIcon} size={20} color={props?.vectorIconColor} style={{ marginHorizontal: 10 }} />
|
|
73
|
-
)}
|
|
74
|
-
<Input
|
|
75
|
-
name={props.name}
|
|
76
|
-
secureTextEntry={props.isSecured}
|
|
77
|
-
onChangeText={(txt: any) => props.name ? props.onChange({ target: { name: props.name, value: txt } }) : props.onChange(txt)}
|
|
78
|
-
defaultValue={props.value}
|
|
79
|
-
placeholder={props.placeholder ? props.placeholder : ''}
|
|
80
|
-
keyboardType={props.type || 'default'}
|
|
81
|
-
multiline={props.multiline}
|
|
82
|
-
scrollEnabled={props.multiline}
|
|
83
|
-
editable={!props.isDisabled}
|
|
84
|
-
autoCapitalize={props.autoCapitalize}
|
|
85
|
-
autoCompleteType={props.autoCompleteType}
|
|
86
|
-
autoCorrect={props.autoCorrect}
|
|
87
|
-
returnKeyType={props.returnKeyType}
|
|
88
|
-
onSubmitEditing={props.onSubmitEditing}
|
|
89
|
-
blurOnSubmit={props.blurOnSubmit}
|
|
90
|
-
ref={props.forwardRef}
|
|
91
|
-
style={props?.inputStyle}
|
|
92
|
-
/>
|
|
93
|
-
{props.iconRight && (
|
|
94
|
-
<OIcon
|
|
95
|
-
src={props.iconRight}
|
|
96
|
-
color={props.iconRightColor}
|
|
97
|
-
width={16}
|
|
98
|
-
height={16}
|
|
99
|
-
style={{ ...props.iconRightStyle }}
|
|
100
|
-
/>
|
|
101
|
-
)}
|
|
102
|
-
{props.iconCustomRight}
|
|
103
|
-
</Wrapper>
|
|
104
|
-
);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
OInput.defaultProps = {
|
|
108
|
-
iconColor: '#959595',
|
|
109
|
-
bgColor: 'white',
|
|
110
|
-
borderColor: 'white',
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export default OInput;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import { ViewStyle } from 'react-native'
|
|
3
|
-
import styled from 'styled-components/native'
|
|
4
|
-
import OText from './OText'
|
|
5
|
-
|
|
6
|
-
const Wrapper = styled.TouchableOpacity`
|
|
7
|
-
background-color: white;
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
height: 50px;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
`
|
|
13
|
-
|
|
14
|
-
interface Props {
|
|
15
|
-
title?: string,
|
|
16
|
-
subTitle?: string,
|
|
17
|
-
onClick?: any,
|
|
18
|
-
style?: ViewStyle
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const OKeyButton = (props: Props) => {
|
|
22
|
-
return (
|
|
23
|
-
<Wrapper
|
|
24
|
-
style={props.style}
|
|
25
|
-
onPress={props.onClick}
|
|
26
|
-
>
|
|
27
|
-
<OText size={22}>{props.title}</OText>
|
|
28
|
-
{props.subTitle ? (
|
|
29
|
-
<OText>{props.subTitle}</OText>
|
|
30
|
-
) : null}
|
|
31
|
-
</Wrapper>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default OKeyButton
|