be-components 3.5.9 → 3.6.1
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/lib/commonjs/Components/Pagination.js +37 -0
- package/lib/commonjs/Components/Pagination.js.map +1 -0
- package/lib/commonjs/ProfileManager/Components/VouchCard.js +3 -35
- package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/AccountCard.js +27 -28
- package/lib/commonjs/Wallet/components/AccountCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/AccountLimitManager.js +60 -95
- package/lib/commonjs/Wallet/components/AccountLimitManager.js.map +1 -1
- package/lib/commonjs/Wallet/components/AccountManager.js +209 -158
- package/lib/commonjs/Wallet/components/AccountManager.js.map +1 -1
- package/lib/commonjs/Wallet/components/AccountSnoozeManager.js +53 -66
- package/lib/commonjs/Wallet/components/AccountSnoozeManager.js.map +1 -1
- package/lib/commonjs/Wallet/components/DepositCard.js +93 -99
- package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/ItemOrderCard.js +26 -29
- package/lib/commonjs/Wallet/components/ItemOrderCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/ItemOrderDetailCard.js +43 -46
- package/lib/commonjs/Wallet/components/ItemOrderDetailCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/ManageAccountCard.js +85 -60
- package/lib/commonjs/Wallet/components/ManageAccountCard.js.map +1 -1
- package/lib/commonjs/Wallet/components/OrderManager.js +61 -58
- package/lib/commonjs/Wallet/components/OrderManager.js.map +1 -1
- package/lib/commonjs/Wallet/components/RemoveAccount.js +22 -23
- package/lib/commonjs/Wallet/components/RemoveAccount.js.map +1 -1
- package/lib/commonjs/Wallet/components/WalletActionSelector.js +130 -133
- package/lib/commonjs/Wallet/components/WalletActionSelector.js.map +1 -1
- package/lib/commonjs/Wallet/components/WalletSettings.js +382 -547
- package/lib/commonjs/Wallet/components/WalletSettings.js.map +1 -1
- package/lib/commonjs/Wallet/components/WalletSetup.js +85 -107
- package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -1
- package/lib/commonjs/Wallet/components/WithdrawCard.js +91 -111
- package/lib/commonjs/Wallet/components/WithdrawCard.js.map +1 -1
- package/lib/commonjs/Wallet/index.js +22 -24
- package/lib/commonjs/Wallet/index.js.map +1 -1
- package/lib/commonjs/constants/styles.js +1 -1
- package/lib/commonjs/constants/styles.js.map +1 -1
- package/lib/commonjs/constants/useColors.js +1 -1
- package/lib/commonjs/constants/useColors.js.map +1 -1
- package/lib/module/Components/Pagination.js +30 -0
- package/lib/module/Components/Pagination.js.map +1 -0
- package/lib/module/ProfileManager/Components/VouchCard.js +3 -35
- package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
- package/lib/module/Wallet/components/AccountCard.js +23 -24
- package/lib/module/Wallet/components/AccountCard.js.map +1 -1
- package/lib/module/Wallet/components/AccountLimitManager.js +43 -77
- package/lib/module/Wallet/components/AccountLimitManager.js.map +1 -1
- package/lib/module/Wallet/components/AccountManager.js +206 -155
- package/lib/module/Wallet/components/AccountManager.js.map +1 -1
- package/lib/module/Wallet/components/AccountSnoozeManager.js +35 -48
- package/lib/module/Wallet/components/AccountSnoozeManager.js.map +1 -1
- package/lib/module/Wallet/components/DepositCard.js +62 -67
- package/lib/module/Wallet/components/DepositCard.js.map +1 -1
- package/lib/module/Wallet/components/ItemOrderCard.js +17 -20
- package/lib/module/Wallet/components/ItemOrderCard.js.map +1 -1
- package/lib/module/Wallet/components/ItemOrderDetailCard.js +28 -31
- package/lib/module/Wallet/components/ItemOrderDetailCard.js.map +1 -1
- package/lib/module/Wallet/components/ManageAccountCard.js +80 -55
- package/lib/module/Wallet/components/ManageAccountCard.js.map +1 -1
- package/lib/module/Wallet/components/OrderManager.js +59 -56
- package/lib/module/Wallet/components/OrderManager.js.map +1 -1
- package/lib/module/Wallet/components/RemoveAccount.js +16 -16
- package/lib/module/Wallet/components/RemoveAccount.js.map +1 -1
- package/lib/module/Wallet/components/WalletActionSelector.js +102 -104
- package/lib/module/Wallet/components/WalletActionSelector.js.map +1 -1
- package/lib/module/Wallet/components/WalletSettings.js +381 -545
- package/lib/module/Wallet/components/WalletSettings.js.map +1 -1
- package/lib/module/Wallet/components/WalletSetup.js +42 -64
- package/lib/module/Wallet/components/WalletSetup.js.map +1 -1
- package/lib/module/Wallet/components/WithdrawCard.js +52 -71
- package/lib/module/Wallet/components/WithdrawCard.js.map +1 -1
- package/lib/module/Wallet/index.js +15 -17
- package/lib/module/Wallet/index.js.map +1 -1
- package/lib/module/constants/styles.js +1 -1
- package/lib/module/constants/styles.js.map +1 -1
- package/lib/module/constants/useColors.js +1 -1
- package/lib/module/constants/useColors.js.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Pagination.d.ts +11 -0
- package/lib/typescript/lib/commonjs/Components/Pagination.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/AccountCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/AccountLimitManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/AccountManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/AccountSnoozeManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/DepositCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/ItemOrderCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/ItemOrderDetailCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/ManageAccountCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/OrderManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/RemoveAccount.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/WalletActionSelector.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/WalletSettings.d.ts +1 -2
- package/lib/typescript/lib/commonjs/Wallet/components/WalletSettings.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/WalletSetup.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/components/WithdrawCard.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Wallet/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/constants/styles.d.ts +1 -1
- package/lib/typescript/lib/module/Components/Pagination.d.ts +11 -0
- package/lib/typescript/lib/module/Components/Pagination.d.ts.map +1 -0
- package/lib/typescript/lib/module/ProfileManager/Components/VouchCard.d.ts +3 -1
- package/lib/typescript/lib/module/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/AccountCard.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/AccountCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/AccountLimitManager.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/AccountLimitManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/AccountManager.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/AccountManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/AccountSnoozeManager.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/AccountSnoozeManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/DepositCard.d.ts +2 -2
- package/lib/typescript/lib/module/Wallet/components/DepositCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/ItemOrderCard.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/ItemOrderCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/ItemOrderDetailCard.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/ItemOrderDetailCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/ManageAccountCard.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/ManageAccountCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/OrderManager.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/OrderManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/RemoveAccount.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/RemoveAccount.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/WalletActionSelector.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/components/WalletActionSelector.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/WalletSettings.d.ts +2 -4
- package/lib/typescript/lib/module/Wallet/components/WalletSettings.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/WalletSetup.d.ts +2 -2
- package/lib/typescript/lib/module/Wallet/components/WalletSetup.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/components/WithdrawCard.d.ts +2 -2
- package/lib/typescript/lib/module/Wallet/components/WithdrawCard.d.ts.map +1 -1
- package/lib/typescript/lib/module/Wallet/index.d.ts +1 -2
- package/lib/typescript/lib/module/Wallet/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/Pagination.d.ts +12 -0
- package/lib/typescript/src/Components/Pagination.d.ts.map +1 -0
- package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/AccountCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/AccountLimitManager.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/AccountManager.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/AccountSnoozeManager.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/ItemOrderCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/ItemOrderDetailCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/ManageAccountCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/OrderManager.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/RemoveAccount.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/WalletSettings.d.ts +1 -1
- package/lib/typescript/src/Wallet/components/WalletSettings.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/components/WithdrawCard.d.ts.map +1 -1
- package/lib/typescript/src/Wallet/index.d.ts.map +1 -1
- package/package.json +1 -2
- package/src/Components/Pagination.tsx +33 -0
- package/src/ProfileManager/Components/VouchCard.tsx +3 -27
- package/src/Wallet/components/AccountCard.tsx +22 -21
- package/src/Wallet/components/AccountLimitManager.tsx +36 -54
- package/src/Wallet/components/AccountManager.tsx +95 -61
- package/src/Wallet/components/AccountSnoozeManager.tsx +39 -37
- package/src/Wallet/components/DepositCard.tsx +55 -53
- package/src/Wallet/components/ItemOrderCard.tsx +13 -12
- package/src/Wallet/components/ItemOrderDetailCard.tsx +23 -22
- package/src/Wallet/components/ManageAccountCard.tsx +78 -47
- package/src/Wallet/components/OrderManager.tsx +47 -37
- package/src/Wallet/components/RemoveAccount.tsx +12 -15
- package/src/Wallet/components/WalletActionSelector.tsx +70 -69
- package/src/Wallet/components/WalletSettings.tsx +137 -139
- package/src/Wallet/components/WalletSetup.tsx +41 -51
- package/src/Wallet/components/WithdrawCard.tsx +56 -56
- package/src/Wallet/index.tsx +16 -15
- package/src/constants/styles.ts +1 -1
- package/src/constants/useColors.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Wallet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Wallet/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,KAAK,EAAgB,YAAY,EAAoB,cAAc,EAAgD,kBAAkB,EAAiJ,MAAM,UAAU,CAAC;AAuB9S,KAAK,aAAa,GAAG;IACjB,UAAU,CAAC,EAAC,MAAM,CAAC;IACnB,WAAW,CAAC,EAAC,kBAAkB,CAAC;IAChC,MAAM,CAAC,EAAC,MAAM,CAAC;IACf,OAAO,EAAC,MAAM,IAAI,CAAC;IACnB,OAAO,EAAC,CAAC,KAAK,EAAC,YAAY,KAAK,IAAI,CAAA;IACpC,UAAU,EAAE,CAAC,UAAU,EAAC,cAAc,EAAE,UAAU,CAAC,EAAC,MAAM,KAAK,IAAI,CAAA;CACtE,CAAA;AAED,QAAA,MAAM,QAAQ,sEAAsE,aAAa,sBAyhBhG,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "be-components",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
4
4
|
"description": "Components for BettorEdge Apps",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -195,7 +195,6 @@
|
|
|
195
195
|
"react-native-uuid": "^2.0.3",
|
|
196
196
|
"react-native-web-linear-gradient": "^1.1.2",
|
|
197
197
|
"react-native-web-swiper": "^2.2.4",
|
|
198
|
-
"react-native-webview": "^13.12.5",
|
|
199
198
|
"us-bank-account-validator": "^1.0.0",
|
|
200
199
|
"uuid": "^9.0.1"
|
|
201
200
|
},
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, View } from "./Themed"
|
|
3
|
+
|
|
4
|
+
type PaginationProps = {
|
|
5
|
+
offset:number
|
|
6
|
+
style?:any,
|
|
7
|
+
next_title?:string,
|
|
8
|
+
previous_title?:string,
|
|
9
|
+
onPrevious: () => void,
|
|
10
|
+
onNext: () => void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const Pagination = ({ offset, onPrevious, onNext, next_title, previous_title, style }:PaginationProps) => {
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<View transparent style={{ flexDirection: 'row', alignItems:'center', justifyContent:'space-between', ...style }}>
|
|
17
|
+
{offset > 0 ?
|
|
18
|
+
<Button
|
|
19
|
+
title={previous_title ?? 'PREV'}
|
|
20
|
+
type='text'
|
|
21
|
+
onPress={() => onPrevious()}
|
|
22
|
+
/>
|
|
23
|
+
:<View />}
|
|
24
|
+
<Button
|
|
25
|
+
title={next_title ?? 'NEXT'}
|
|
26
|
+
type='text'
|
|
27
|
+
onPress={() => onNext()}
|
|
28
|
+
/>
|
|
29
|
+
</View>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default Pagination
|
|
@@ -4,7 +4,6 @@ import { useCameraPermissions } from 'expo-camera';
|
|
|
4
4
|
import vouchHtml from './Vouchhtml';
|
|
5
5
|
import { Icons } from '../../Components';
|
|
6
6
|
import Colors from '../../constants/colors';
|
|
7
|
-
import { WebView } from "react-native-webview";
|
|
8
7
|
import { ProfileApi, ProfileHelpers } from '../api';
|
|
9
8
|
import moment from 'moment-mini';
|
|
10
9
|
import type { CodeRequestProps, MyPlayerProps, PlayerReferralProps, PromoProps, PublicPlayerProps } from '../../types';
|
|
@@ -41,7 +40,7 @@ const VouchCard = ({ player, walkthrough, code_details, onVouching, onPlayerUpda
|
|
|
41
40
|
const VOUCHED_CALLBACK_URL = ProfileApi.getVouchKeys().VOUCHED_CALLBACK_URL
|
|
42
41
|
const VOUCHED_SANDBOX = ProfileApi.getVouchKeys().VOUCHED_SANDBOX
|
|
43
42
|
const VOUCHED_HTML = vouchHtml({VOUCH_ID, VOUCHED_CALLBACK_URL, VOUCHED_SANDBOX, player})
|
|
44
|
-
|
|
43
|
+
console.log(VOUCHED_HTML)
|
|
45
44
|
|
|
46
45
|
const { code_request, promo } = code_details;
|
|
47
46
|
useEffect(() => {
|
|
@@ -61,8 +60,7 @@ const VouchCard = ({ player, walkthrough, code_details, onVouching, onPlayerUpda
|
|
|
61
60
|
initializeVouch()
|
|
62
61
|
if(!vouched){ return }
|
|
63
62
|
vouched.mount('#vouched-element')
|
|
64
|
-
|
|
65
|
-
console.log(tokens)
|
|
63
|
+
|
|
66
64
|
},[vouched])
|
|
67
65
|
|
|
68
66
|
const initializeVouch = () => {
|
|
@@ -168,30 +166,8 @@ const VouchCard = ({ player, walkthrough, code_details, onVouching, onPlayerUpda
|
|
|
168
166
|
}));
|
|
169
167
|
}
|
|
170
168
|
|
|
171
|
-
const onMessage = (data:any) => {
|
|
172
|
-
console.log(data)
|
|
173
|
-
}
|
|
174
169
|
|
|
175
|
-
if(
|
|
176
|
-
if(Platform.OS != 'web'){
|
|
177
|
-
console.log('Rendering Webvewi!!!')
|
|
178
|
-
return (
|
|
179
|
-
<View style={{ position:'absolute', top:0, left:0, right:0, bottom:0 }}>
|
|
180
|
-
<WebView
|
|
181
|
-
source={{ html: VOUCHED_HTML }}
|
|
182
|
-
style={{ marginTop: 20, flex:1 }}
|
|
183
|
-
originWhitelist={['*']}
|
|
184
|
-
//mediaCapturePermissionGrantType='grant'
|
|
185
|
-
geolocationEnabled={true}
|
|
186
|
-
mediaPlaybackRequiresUserAction={false}
|
|
187
|
-
allowsInlineMediaPlayback
|
|
188
|
-
javaScriptEnabled={true}
|
|
189
|
-
onMessage={m => onMessage(m.nativeEvent.data)}
|
|
190
|
-
/>
|
|
191
|
-
</View>
|
|
192
|
-
)
|
|
193
|
-
}
|
|
194
|
-
}
|
|
170
|
+
if(Platform.OS != 'web'){ return <></> }
|
|
195
171
|
|
|
196
172
|
if(vouched){
|
|
197
173
|
return (
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View, TouchableOpacity } from "react-native";
|
|
3
2
|
import type { AccountProps } from '../../types';
|
|
4
|
-
import { Icons
|
|
5
|
-
import Colors from '../../constants/colors';
|
|
6
|
-
import { view_styles } from '../../constants/styles';
|
|
3
|
+
import { Icons } from '../../Components';
|
|
7
4
|
import moment from 'moment-mini';
|
|
5
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
8
7
|
|
|
9
8
|
type AccountCardProps = {
|
|
10
9
|
account:AccountProps,
|
|
@@ -13,12 +12,13 @@ type AccountCardProps = {
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
const AccountCard = ({ account, hide_status, onSelectAccount }: AccountCardProps) => {
|
|
15
|
+
const Colors = useColors();
|
|
16
16
|
|
|
17
17
|
const getIcon = () => {
|
|
18
18
|
switch(account.account_type){
|
|
19
19
|
case 'ach':
|
|
20
|
-
if(account.ach_detail?.payment_provider == 'nuvei'){ return <Icons.BankInstantIcon size={28} color={Colors.
|
|
21
|
-
return <Icons.BankIcon size={28} color={Colors.
|
|
20
|
+
if(account.ach_detail?.payment_provider == 'nuvei'){ return <Icons.BankInstantIcon size={28} color={Colors.text.h1}/> }
|
|
21
|
+
return <Icons.BankIcon size={28} color={Colors.text.success} />
|
|
22
22
|
case 'card':
|
|
23
23
|
return renderCardIcon(account.card_detail?.card_brand)
|
|
24
24
|
case 'paypal':
|
|
@@ -39,17 +39,17 @@ const AccountCard = ({ account, hide_status, onSelectAccount }: AccountCardProps
|
|
|
39
39
|
case 'discover':
|
|
40
40
|
return <Icons.DiscoverCardIcon size={28} />
|
|
41
41
|
default:
|
|
42
|
-
return <Icons.CreditCardIcon size={22} color={Colors.
|
|
42
|
+
return <Icons.CreditCardIcon size={22} color={Colors.text.h1}/>
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const getStatusColor = () => {
|
|
47
47
|
switch(account.status){
|
|
48
|
-
case 'active': return Colors.
|
|
49
|
-
case 'inactive': return Colors.
|
|
50
|
-
case 'suspended': return Colors.
|
|
51
|
-
case 'verify': return Colors.
|
|
52
|
-
default: return Colors.
|
|
48
|
+
case 'active': return Colors.text.success
|
|
49
|
+
case 'inactive': return Colors.text.error
|
|
50
|
+
case 'suspended': return Colors.text.warning
|
|
51
|
+
case 'verify': return Colors.text.warning
|
|
52
|
+
default: return Colors.text.h1
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -69,25 +69,26 @@ const AccountCard = ({ account, hide_status, onSelectAccount }: AccountCardProps
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
return (
|
|
72
|
-
<
|
|
73
|
-
style={{
|
|
72
|
+
<Button
|
|
73
|
+
style={{ padding:10 }}
|
|
74
|
+
float
|
|
74
75
|
onPress={() => onSelectAccount(account)}
|
|
75
76
|
>
|
|
76
|
-
<View style={{
|
|
77
|
-
<View style={{ marginRight:10, justifyContent:'center', alignItems:'center' }}>
|
|
77
|
+
<View transparent style={{ flexDirection:'row' }}>
|
|
78
|
+
<View transparent style={{ marginRight:10, justifyContent:'center', alignItems:'center' }}>
|
|
78
79
|
{getIcon()}
|
|
79
80
|
</View>
|
|
80
|
-
<View style={{ flex:1 }}>
|
|
81
|
-
<Text
|
|
82
|
-
<Text style={{ marginTop:4 }}
|
|
81
|
+
<View transparent style={{ flex:1 }}>
|
|
82
|
+
<Text theme='h1'>{account.account_label}</Text>
|
|
83
|
+
<Text style={{ marginTop:4 }} theme='description'>{getDescriptionLabel()}</Text>
|
|
83
84
|
</View>
|
|
84
85
|
{!hide_status ?
|
|
85
|
-
<View>
|
|
86
|
+
<View transparent>
|
|
86
87
|
<Text size={12} color={getStatusColor()} weight='bold'>{account.status.toUpperCase()}</Text>
|
|
87
88
|
</View>
|
|
88
89
|
:<></>}
|
|
89
90
|
</View>
|
|
90
|
-
</
|
|
91
|
+
</Button>
|
|
91
92
|
)
|
|
92
93
|
}
|
|
93
94
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { FlatList
|
|
2
|
+
import { FlatList } from 'react-native';
|
|
3
3
|
import type { AccountLimitProps, AccountProps } from '../../types';
|
|
4
4
|
import { WalletApi, WalletHelpers } from '../api';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { Icons, Toggle } from '../../Components';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
7
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
7
8
|
|
|
8
9
|
const limit_amount_options = [ 50, 100, 250, 500, 1000]
|
|
9
10
|
const frequency_options = ['Daily', 'Weekly', 'Monthly']
|
|
@@ -15,8 +16,8 @@ type AccountLimitManagerProps = {
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const AccountLimitManager = ({ account, onCancel, onSetLimit }: AccountLimitManagerProps ) => {
|
|
19
|
+
const Colors = useColors();
|
|
18
20
|
const [ loading, setLoading ] = useState(false);
|
|
19
|
-
const [ freq_width, setFreqWidth ] = useState(0);
|
|
20
21
|
const [ disclaimer, setDisclaimer ] = useState(false);
|
|
21
22
|
const [ dropdown_visible, setDropdownVisible ] = useState(false);
|
|
22
23
|
const [ active_frequency, setActiveFrequency ] = useState('Daily')
|
|
@@ -102,41 +103,34 @@ const AccountLimitManager = ({ account, onCancel, onSetLimit }: AccountLimitMana
|
|
|
102
103
|
const renderOptions = (data: { item:number, index:number }) => {
|
|
103
104
|
//const selected = data.item == active_amount ? true : false
|
|
104
105
|
return (
|
|
105
|
-
<
|
|
106
|
+
<Button style={{ padding:10, borderBottomWidth:1, borderColor:Colors.borders.light }} onPress={() => {
|
|
106
107
|
setActiveAmount(data.item);
|
|
107
108
|
setDropdownVisible(false);
|
|
108
109
|
}}>
|
|
109
|
-
<Text
|
|
110
|
-
</
|
|
110
|
+
<Text theme='h2'>${data.item}</Text>
|
|
111
|
+
</Button>
|
|
111
112
|
)
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
const renderFrequencies = (data: {item:string, index:number}) => {
|
|
115
|
-
const selected = data.item == active_frequency ? true : false
|
|
116
|
-
return (
|
|
117
|
-
<TouchableOpacity style={{ width:freq_width/3, backgroundColor:selected?Colors.shades.white:'transparent', borderRadius:4, padding:10 }} onPress={() => setActiveFrequency(data.item)}>
|
|
118
|
-
<Text size={14} color={Colors.brand.midnight} weight={selected?'bold':'regular'} textAlign='center'>{data.item}</Text>
|
|
119
|
-
</TouchableOpacity>
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
115
|
const valid = active_amount && active_frequency ? true : false
|
|
123
116
|
return (
|
|
124
117
|
<View style={{ flex:1 }}>
|
|
125
118
|
<View style={{ padding:20 }}>
|
|
126
|
-
<Text size={30}
|
|
127
|
-
<Text style={{ marginTop:15 }} size={16}
|
|
119
|
+
<Text size={30} theme='h1'>{account_limit?.status == 'active'?'Update Deposit Limits':'Deposit Limits'}</Text>
|
|
120
|
+
<Text style={{ marginTop:15 }} size={16} theme='description'>Set your own limit for depositing.</Text>
|
|
128
121
|
</View>
|
|
129
|
-
<
|
|
122
|
+
<View style={{ flex:1 }}>
|
|
130
123
|
<View style={{padding:16}}>
|
|
131
|
-
<Text size={16}
|
|
132
|
-
<
|
|
124
|
+
<Text size={16} theme='h2'>Amount</Text>
|
|
125
|
+
<Button
|
|
126
|
+
float
|
|
133
127
|
onPress={() => setDropdownVisible(!dropdown_visible)}
|
|
134
|
-
style={{marginTop:8, flexDirection:'row', alignItems:'center', justifyContent:'space-between', padding:15
|
|
135
|
-
<Text
|
|
136
|
-
<Icons.ChevronIcon direction='down' color={Colors.
|
|
137
|
-
</
|
|
128
|
+
style={{marginTop:8, flexDirection:'row', alignItems:'center', justifyContent:'space-between', padding:15 }}>
|
|
129
|
+
<Text theme='h2'>{active_amount?`$${active_amount}`:'Select Limit'}</Text>
|
|
130
|
+
<Icons.ChevronIcon direction='down' color={Colors.text.h1} size={8} />
|
|
131
|
+
</Button>
|
|
138
132
|
{dropdown_visible ?
|
|
139
|
-
<View style={{ borderBottomRightRadius:8, borderBottomLeftRadius:8, padding:10, borderWidth:1, borderTopWidth:1, borderColor:Colors.
|
|
133
|
+
<View style={{ borderBottomRightRadius:8, borderBottomLeftRadius:8, padding:10, borderWidth:1, borderTopWidth:1, borderColor:Colors.borders.light }}>
|
|
140
134
|
<FlatList
|
|
141
135
|
data={limit_amount_options}
|
|
142
136
|
renderItem={renderOptions}
|
|
@@ -145,53 +139,43 @@ const AccountLimitManager = ({ account, onCancel, onSetLimit }: AccountLimitMana
|
|
|
145
139
|
:<></>}
|
|
146
140
|
</View>
|
|
147
141
|
<View style={{ padding:16 }}>
|
|
148
|
-
<Text
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
renderItem={renderFrequencies}
|
|
155
|
-
horizontal
|
|
156
|
-
showsHorizontalScrollIndicator={false}
|
|
157
|
-
/>
|
|
158
|
-
</View>
|
|
142
|
+
<Text style={{ marginBottom:10 }} size={16} theme='h2'>Frequency</Text>
|
|
143
|
+
<Toggle
|
|
144
|
+
options={frequency_options.map(o => { return { key: o, label:o } })}
|
|
145
|
+
selected_option={active_frequency}
|
|
146
|
+
onSelectOption={(option) => setActiveFrequency(option)}
|
|
147
|
+
/>
|
|
159
148
|
</View>
|
|
160
149
|
{account_limit?.status == 'active' ?
|
|
161
|
-
<View style={{ margin:10, borderRadius:8, backgroundColor:Colors.
|
|
162
|
-
<Text size={14}
|
|
150
|
+
<View style={{ margin:10, borderRadius:8, backgroundColor:Colors.borders.light, padding:10 }}>
|
|
151
|
+
<Text size={14} theme='h2' textAlign='center'>There is an active limit on this account of ${account_limit.limit_amount} every {account_limit.limit_days} days</Text>
|
|
163
152
|
<Button
|
|
164
153
|
style={{ marginTop:10 }}
|
|
165
154
|
title='REMOVE'
|
|
166
|
-
|
|
167
|
-
padding={15}
|
|
168
|
-
backgroundColor={Colors.utility.error}
|
|
155
|
+
type='error'
|
|
169
156
|
onPress={() => handleRemoveAccountLimit()}
|
|
170
157
|
/>
|
|
171
158
|
</View>
|
|
172
159
|
:<></>}
|
|
173
|
-
</
|
|
160
|
+
</View>
|
|
174
161
|
|
|
175
162
|
{ valid ?
|
|
176
163
|
<View nativeID='limit_disclaimer' style={{ margin:10 }}>
|
|
177
|
-
<
|
|
178
|
-
<View style={{ justifyContent:'center', marginRight:10, alignItems:'center', height:25, width:25, borderRadius:4, backgroundColor: disclaimer ? Colors.
|
|
164
|
+
<Button style={{ flexDirection:'row', padding:5 }} onPress={() => setDisclaimer(!disclaimer)}>
|
|
165
|
+
<View style={{ justifyContent:'center', marginRight:10, alignItems:'center', height:25, width:25, borderRadius:4, backgroundColor: disclaimer ? Colors.text.h1 : 'transparent', borderWidth:1, borderColor:Colors.text.h1 }}>
|
|
179
166
|
{disclaimer ?
|
|
180
|
-
<Icons.CheckIcon color={Colors.
|
|
167
|
+
<Icons.CheckIcon color={Colors.text.h1} size={14} />
|
|
181
168
|
:<></>}
|
|
182
169
|
</View>
|
|
183
|
-
<Text size={14}
|
|
184
|
-
</
|
|
170
|
+
<Text size={14} theme='description'>I confirm I would like to the my deposit limit to {active_amount}, and deposit frequency to {active_frequency}</Text>
|
|
171
|
+
</Button>
|
|
185
172
|
</View>
|
|
186
173
|
:<></>}
|
|
187
174
|
<View nativeID='action_row' style={{ flexDirection:'row', padding:20 }}>
|
|
188
175
|
<Button
|
|
189
176
|
style={{ flex:1, marginRight:5, opacity: 1 }}
|
|
190
177
|
title={'CLOSE'}
|
|
191
|
-
|
|
192
|
-
borderColor={Colors.brand.electric}
|
|
193
|
-
borderWidth={1}
|
|
194
|
-
padding={15}
|
|
178
|
+
type='close'
|
|
195
179
|
onPress={() => onCancel()}
|
|
196
180
|
/>
|
|
197
181
|
<Button
|
|
@@ -199,9 +183,7 @@ const AccountLimitManager = ({ account, onCancel, onSetLimit }: AccountLimitMana
|
|
|
199
183
|
title={'SAVE LIMIT'}
|
|
200
184
|
disabled={!valid||!disclaimer}
|
|
201
185
|
loading={loading}
|
|
202
|
-
|
|
203
|
-
backgroundColor={Colors.brand.electric}
|
|
204
|
-
padding={15}
|
|
186
|
+
type='success'
|
|
205
187
|
onPress={() => handleSetLimit()}
|
|
206
188
|
/>
|
|
207
189
|
</View>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FlatList,
|
|
2
|
+
import { FlatList, Image } from 'react-native';
|
|
3
3
|
import type { AccountProps } from '../../types';
|
|
4
4
|
import AccountCard from './AccountCard';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { Icons } from '../../Components';
|
|
6
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
7
|
+
import { useColors } from '../../constants/useColors';
|
|
7
8
|
|
|
8
9
|
type AccountManagerProps = {
|
|
9
10
|
accounts:AccountProps[],
|
|
@@ -13,15 +14,16 @@ type AccountManagerProps = {
|
|
|
13
14
|
onSelectManualCard: () => void,
|
|
14
15
|
onSelectInstantBankTransfer: () => void
|
|
15
16
|
}
|
|
17
|
+
const screen_sections = ['header','my_accounts','new_account']
|
|
16
18
|
|
|
17
19
|
const AccountManager = ({ accounts, onSelectAccount, onSelectManualACH, onSelectManualCard, onSelectInstantBankTransfer , onClose}:AccountManagerProps) => {
|
|
18
|
-
|
|
20
|
+
const Colors = useColors();
|
|
19
21
|
const my_accounts = accounts.filter(a => !a.ibt_placeholder && !['bettoredge'].includes(a.account_type))
|
|
20
22
|
//const ibt_placeholder = accounts.find(a => a.ibt_placeholder);
|
|
21
23
|
|
|
22
24
|
const renderAccounts = (data:{item:AccountProps, index:number}) => {
|
|
23
25
|
return (
|
|
24
|
-
<View style={{ margin:5 }}>
|
|
26
|
+
<View transparent style={{ margin:5 }}>
|
|
25
27
|
<AccountCard
|
|
26
28
|
account={data.item}
|
|
27
29
|
onSelectAccount={(account) => onSelectAccount(account)}
|
|
@@ -30,70 +32,102 @@ const AccountManager = ({ accounts, onSelectAccount, onSelectManualACH, onSelec
|
|
|
30
32
|
)
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<View style={{ padding:10 }}>
|
|
42
|
-
<Text size={16} color={Colors.brand.midnight} weight='bold'>MY ACCOUNTS</Text>
|
|
43
|
-
<View style={{ marginTop:10 }}>
|
|
44
|
-
<FlatList
|
|
45
|
-
data={my_accounts}
|
|
46
|
-
renderItem={renderAccounts}
|
|
47
|
-
keyExtractor={(item) => item.account_id.toString()}
|
|
48
|
-
/>
|
|
49
|
-
</View>
|
|
50
|
-
</View>
|
|
51
|
-
:<></>}
|
|
52
|
-
<View style={{ padding:10, marginTop:20 }}>
|
|
53
|
-
<Text size={16} color={Colors.brand.midnight} weight='bold'>ADD NEW ACCOUNT</Text>
|
|
54
|
-
<TouchableOpacity style={{ marginTop:10, padding:3, flexDirection:'row', alignItems:'center', borderRadius:30, backgroundColor:Colors.shades.white }}
|
|
55
|
-
onPress={() => onSelectInstantBankTransfer()}>
|
|
56
|
-
<View style={{ height:50, width:110, borderRadius:100, justifyContent:'center', alignItems:'center', borderWidth:1, borderColor:Colors.brand.cobalt }}>
|
|
57
|
-
<Image
|
|
58
|
-
source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1695821528/1630344814441_wjq98b.png' }}
|
|
59
|
-
style={{ width:50, height:30 }}
|
|
60
|
-
resizeMode='cover'
|
|
61
|
-
/>
|
|
62
|
-
</View>
|
|
63
|
-
<View style={{ flex:1, marginLeft:5 }}>
|
|
64
|
-
<Text size={10} color={Colors.utility.success} weight='bold'>RECOMMENDED</Text>
|
|
65
|
-
<Text size={14} color={Colors.brand.cobalt} textAlign='left' weight='bold'>INSTANT BANK TRANSFER</Text>
|
|
35
|
+
const renderSections = (data:{item:string, index:number}) => {
|
|
36
|
+
switch(data.item){
|
|
37
|
+
case 'header':
|
|
38
|
+
return (
|
|
39
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:15 }}>
|
|
40
|
+
<View transparent style={{flex:1}}>
|
|
41
|
+
<Text size={20} theme='h1'>MANAGE MY ACCOUNTS</Text>
|
|
42
|
+
<Text style={{ marginTop:5}} theme='description'>Below are the accounts we have on file for you. Please select one to manage or transact!</Text>
|
|
66
43
|
</View>
|
|
67
|
-
</
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
44
|
+
</View>
|
|
45
|
+
)
|
|
46
|
+
case 'my_accounts':
|
|
47
|
+
return (
|
|
48
|
+
<View style={{ marginTop:10 }}>
|
|
49
|
+
<View type='header' style={{ padding:20, flexDirection:'row', alignItems:'center' }}>
|
|
50
|
+
<View transparent style={{ flex:1 }}>
|
|
51
|
+
<Text theme='h1'>MY ACCOUNTS</Text>
|
|
52
|
+
<Text style={{ marginTop:3 }} theme='description'>Accounts already linked or ways to transact immediately</Text>
|
|
53
|
+
</View>
|
|
75
54
|
</View>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
55
|
+
<View type='body' style={{ padding:20 }}>
|
|
56
|
+
<FlatList
|
|
57
|
+
data={my_accounts}
|
|
58
|
+
renderItem={renderAccounts}
|
|
59
|
+
keyExtractor={(item) => item.account_id.toString()}
|
|
60
|
+
/>
|
|
81
61
|
</View>
|
|
82
|
-
|
|
83
|
-
|
|
62
|
+
</View>
|
|
63
|
+
)
|
|
64
|
+
case 'new_account':
|
|
65
|
+
return (
|
|
66
|
+
<View>
|
|
67
|
+
<View type='header' style={{ padding:20, flexDirection:'row', alignItems:'center' }}>
|
|
68
|
+
<View transparent style={{ flex:1 }}>
|
|
69
|
+
<Text theme='h1' color={Colors.text.success}>ADD NEW ACCOUNT</Text>
|
|
70
|
+
<Text style={{ marginTop:3 }} theme='description'>Link a new account and use to transact</Text>
|
|
71
|
+
</View>
|
|
84
72
|
</View>
|
|
85
|
-
|
|
73
|
+
<View type='body' style={{ padding:20 }}>
|
|
74
|
+
<Button float style={{ marginTop:10, padding:5, flexDirection:'row', alignItems:'center' }}
|
|
75
|
+
onPress={() => onSelectInstantBankTransfer()}>
|
|
76
|
+
<View style={{ height:50, width:80, borderRadius:8, justifyContent:'center', alignItems:'center', borderWidth:1, borderColor:Colors.absolutes.brand.cobalt }}>
|
|
77
|
+
<Image
|
|
78
|
+
source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1695821528/1630344814441_wjq98b.png' }}
|
|
79
|
+
style={{ width:50, height:30 }}
|
|
80
|
+
resizeMode='cover'
|
|
81
|
+
/>
|
|
82
|
+
</View>
|
|
83
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
84
|
+
<Text size={10} color={Colors.text.success} weight='bold'>RECOMMENDED</Text>
|
|
85
|
+
<Text size={14} theme='h1' textAlign='left'>INSTANT BANK TRANSFER</Text>
|
|
86
|
+
</View>
|
|
87
|
+
</Button>
|
|
88
|
+
<Button float style={{ marginTop:10, padding:5, flexDirection:'row', alignItems:'center' }}
|
|
89
|
+
onPress={() => onSelectManualACH()}>
|
|
90
|
+
<View float style={{ height:50, width:50, justifyContent:'center', alignItems:'center' }}>
|
|
91
|
+
<Icons.BankIcon size={22} color={Colors.text.h1} />
|
|
92
|
+
</View>
|
|
93
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
94
|
+
<Text size={14} theme='h2' textAlign='left'>ADD MANUAL ACH ACCOUNT</Text>
|
|
95
|
+
</View>
|
|
96
|
+
</Button>
|
|
97
|
+
<Button float style={{ marginTop:10, padding:5, flexDirection:'row', alignItems:'center' }}
|
|
98
|
+
onPress={() => onSelectManualCard()}>
|
|
99
|
+
<View float style={{ height:50, width:50, justifyContent:'center', alignItems:'center'}}>
|
|
100
|
+
<Icons.CreditCardIcon size={22} color={Colors.text.highlight} />
|
|
101
|
+
</View>
|
|
102
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
103
|
+
<Text size={14} theme='h2' textAlign='left'>ADD NEW CARD ACCOUNT</Text>
|
|
104
|
+
</View>
|
|
105
|
+
</Button>
|
|
106
|
+
</View>
|
|
86
107
|
|
|
87
108
|
</View>
|
|
88
|
-
|
|
89
|
-
|
|
109
|
+
)
|
|
110
|
+
default: return <></>
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<View style={{ flex:1 }}>
|
|
116
|
+
|
|
117
|
+
<View style={{ flex:1 }}>
|
|
118
|
+
<FlatList
|
|
119
|
+
key='account_sections'
|
|
120
|
+
data={screen_sections}
|
|
121
|
+
renderItem={renderSections}
|
|
122
|
+
keyExtractor={(item) => item}
|
|
123
|
+
/>
|
|
124
|
+
|
|
125
|
+
</View>
|
|
126
|
+
<View type='footer' style={{ flexDirection:'row', padding:20 }}>
|
|
90
127
|
<Button
|
|
91
|
-
style={{ flex:1
|
|
128
|
+
style={{ flex:1 }}
|
|
92
129
|
title={'BACK'}
|
|
93
|
-
|
|
94
|
-
borderWidth={1}
|
|
95
|
-
borderColor={Colors.brand.electric}
|
|
96
|
-
padding={15}
|
|
130
|
+
type='close'
|
|
97
131
|
onPress={() => onClose()}
|
|
98
132
|
/>
|
|
99
133
|
</View>
|