be-components 3.6.0 → 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/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/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/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/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/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 -1
- package/src/Components/Pagination.tsx +33 -0
- 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,16 +1,19 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { FlatList,
|
|
2
|
+
import { FlatList, ActivityIndicator } from 'react-native';
|
|
3
3
|
import { ItemOrderApi } from '../api';
|
|
4
4
|
import type { ItemOrderProps, ItemProps } from '../../types';
|
|
5
5
|
import ItemOrderCard from './ItemOrderCard';
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
7
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
8
|
+
import Pagination from '../../Components/Pagination';
|
|
8
9
|
|
|
9
10
|
type OrderManagerProps = {
|
|
10
11
|
onClose: () => void
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
const order_sections = [ 'header', 'orders' ]
|
|
13
14
|
const OrderManager = ({ onClose }:OrderManagerProps) => {
|
|
15
|
+
const Colors = useColors();
|
|
16
|
+
|
|
14
17
|
const [ loading, setLoading ] = useState(false);
|
|
15
18
|
const [ data, setData ] = useState<{
|
|
16
19
|
offset: number,
|
|
@@ -47,47 +50,54 @@ const OrderManager = ({ onClose }:OrderManagerProps) => {
|
|
|
47
50
|
)
|
|
48
51
|
}
|
|
49
52
|
|
|
53
|
+
const renderSections = (data: {item:string, index:number}) => {
|
|
54
|
+
switch(data.item){
|
|
55
|
+
case 'header':
|
|
56
|
+
return (
|
|
57
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:15 }}>
|
|
58
|
+
<View transparent style={{flex:1}}>
|
|
59
|
+
<Text size={20} theme='h1'>MY ORDER HISTORY</Text>
|
|
60
|
+
<Text style={{ marginTop:5}} theme='description'>Review your order history below. Select an item to see the transaction details.</Text>
|
|
61
|
+
</View>
|
|
62
|
+
</View>
|
|
63
|
+
)
|
|
64
|
+
case 'orders':
|
|
65
|
+
return (
|
|
66
|
+
<View>
|
|
67
|
+
{loading ?
|
|
68
|
+
<ActivityIndicator size='large' color={Colors.text.h1} />
|
|
69
|
+
:<></>}
|
|
70
|
+
<FlatList
|
|
71
|
+
data={item_orders}
|
|
72
|
+
renderItem={renderItemOrders}
|
|
73
|
+
keyExtractor={(item) => item.item_order_id.toString()}
|
|
74
|
+
/>
|
|
75
|
+
</View>
|
|
76
|
+
)
|
|
77
|
+
default: return <></>
|
|
78
|
+
}
|
|
79
|
+
}
|
|
50
80
|
|
|
51
81
|
return (
|
|
52
82
|
<View style={{ flex:1 }}>
|
|
53
|
-
|
|
54
|
-
<Text size={26} color={Colors.brand.midnight} weight='bold'>ORDER HISTORY</Text>
|
|
55
|
-
<Text style={{ marginTop:10 }} size={16} color={Colors.brand.midnight} weight='regular'>Review your order history below. Select an item to see the transaction details.</Text>
|
|
56
|
-
</View>
|
|
57
|
-
<ScrollView style={{ flex:1, padding:10 }}>
|
|
58
|
-
{loading ?
|
|
59
|
-
<ActivityIndicator size='large' color={Colors.brand.midnight} />
|
|
60
|
-
:<></>}
|
|
83
|
+
<View style={{ flex:1 }}>
|
|
61
84
|
<FlatList
|
|
62
|
-
data={
|
|
63
|
-
|
|
64
|
-
keyExtractor={(item) => item
|
|
65
|
-
|
|
66
|
-
</ScrollView>
|
|
67
|
-
<View style={{ flexDirection:'row', alignItems:'center', padding:20, paddingBottom:0 }}>
|
|
68
|
-
<Button
|
|
69
|
-
style={{ opacity: offset > 0 ? 1 : 0.5 }}
|
|
70
|
-
title='PREV'
|
|
71
|
-
disabled={offset == 0 ? true : false}
|
|
72
|
-
title_color={Colors.brand.electric}
|
|
73
|
-
backgroundColor='transparent'
|
|
74
|
-
onPress={() => getDataFromServer(offset - 1)}
|
|
75
|
-
/>
|
|
76
|
-
<View style={{ flex:1 }} />
|
|
77
|
-
<Button
|
|
78
|
-
title='NEXT'
|
|
79
|
-
title_color={Colors.brand.electric}
|
|
80
|
-
backgroundColor='transparent'
|
|
81
|
-
onPress={() => getDataFromServer(offset + 1)}
|
|
85
|
+
data={order_sections}
|
|
86
|
+
key={`order_history_sections`}
|
|
87
|
+
keyExtractor={(item) => item}
|
|
88
|
+
renderItem={renderSections}
|
|
82
89
|
/>
|
|
83
90
|
</View>
|
|
84
|
-
<
|
|
91
|
+
<Pagination
|
|
92
|
+
onNext={() => getDataFromServer(offset + 1)}
|
|
93
|
+
onPrevious={() => getDataFromServer(offset - 1)}
|
|
94
|
+
offset={offset}
|
|
95
|
+
/>
|
|
96
|
+
<View type='footer' style={{ flexDirection:'row', padding:20 }}>
|
|
85
97
|
<Button
|
|
86
98
|
title='BACK'
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
borderColor={Colors.brand.electric}
|
|
90
|
-
padding={15}
|
|
99
|
+
type='close'
|
|
100
|
+
style={{ flex:1 }}
|
|
91
101
|
onPress={() => onClose()}
|
|
92
102
|
/>
|
|
93
103
|
</View>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { TouchableOpacity, View } from 'react-native';
|
|
3
2
|
import type { AccountProps } from '../../types';
|
|
4
|
-
import {
|
|
5
|
-
import Colors from '../../constants/colors';
|
|
3
|
+
import { Icons } from '../../Components';
|
|
6
4
|
import { WalletApi } from '../api';
|
|
5
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
7
7
|
|
|
8
8
|
type UnlinkAccountCardProps = {
|
|
9
9
|
account:AccountProps,
|
|
@@ -12,6 +12,7 @@ type UnlinkAccountCardProps = {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const RemoveAccountCard = ({ account, onCancel, onRemove }:UnlinkAccountCardProps) => {
|
|
15
|
+
const Colors = useColors();
|
|
15
16
|
const [ loading, setLoading ] = useState(false);
|
|
16
17
|
const [ disclaimer, setDisclaimer ] = useState(false);
|
|
17
18
|
|
|
@@ -30,23 +31,21 @@ const RemoveAccountCard = ({ account, onCancel, onRemove }:UnlinkAccountCardProp
|
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
33
|
<View style={{ flex:1 }}>
|
|
33
|
-
<View nativeID='snooze_disclaimer' style={{ flex:1, margin:10 }}>
|
|
34
|
-
<
|
|
35
|
-
<View style={{ justifyContent:'center', marginRight:10, alignItems:'center', height:25, width:25, borderRadius:4, backgroundColor: disclaimer ? Colors.
|
|
34
|
+
<View nativeID='snooze_disclaimer' style={{ flex:1, margin:10, justifyContent:'flex-end' }}>
|
|
35
|
+
<Button style={{ flexDirection:'row', padding:5 }} onPress={() => setDisclaimer(!disclaimer)}>
|
|
36
|
+
<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 }}>
|
|
36
37
|
{disclaimer ?
|
|
37
|
-
<Icons.CheckIcon size={14} color={Colors.
|
|
38
|
+
<Icons.CheckIcon size={14} color={Colors.text.h1} />
|
|
38
39
|
:<></>}
|
|
39
40
|
</View>
|
|
40
|
-
<Text
|
|
41
|
-
</
|
|
41
|
+
<Text style={{flex:1}} size={14} theme='description'>I confirm my request to remove my account. I understand that this will take up to 24 hours to come into effect. I understand that I will no longer be able to use this account to transact.</Text>
|
|
42
|
+
</Button>
|
|
42
43
|
</View>
|
|
43
44
|
<View nativeID='action_row' style={{ flexDirection:'row', padding:20 }}>
|
|
44
45
|
<Button
|
|
45
46
|
style={{ flex:1, marginRight:5, opacity: 1 }}
|
|
46
47
|
title={'CANCEL'}
|
|
47
|
-
|
|
48
|
-
backgroundColor={Colors.brand.electric}
|
|
49
|
-
padding={15}
|
|
48
|
+
type='close'
|
|
50
49
|
onPress={() => onCancel()}
|
|
51
50
|
/>
|
|
52
51
|
<Button
|
|
@@ -54,9 +53,7 @@ const RemoveAccountCard = ({ account, onCancel, onRemove }:UnlinkAccountCardProp
|
|
|
54
53
|
disabled={!disclaimer}
|
|
55
54
|
loading={loading}
|
|
56
55
|
title={'REMOVE ACCOUNT'}
|
|
57
|
-
|
|
58
|
-
backgroundColor={Colors.utility.error}
|
|
59
|
-
padding={15}
|
|
56
|
+
type='error'
|
|
60
57
|
onPress={() => handleRemove()}
|
|
61
58
|
/>
|
|
62
59
|
</View>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import Colors from '../../constants/colors';
|
|
3
|
+
import { FlatList, TouchableOpacity, Image } from "react-native"
|
|
4
|
+
import { Icons } from '../../Components';
|
|
6
5
|
import type { AccountProps, MyPlayerProps, PlayerBalanceProps } from '../../types';
|
|
7
6
|
import { WalletHelpers } from '../api';
|
|
7
|
+
import { Button, Text, View } from '../../Components/Themed';
|
|
8
|
+
import { useColors } from '../../constants/useColors';
|
|
8
9
|
|
|
9
10
|
type WalletActionSelectorProps ={
|
|
10
11
|
player:MyPlayerProps,
|
|
@@ -16,38 +17,41 @@ type WalletActionSelectorProps ={
|
|
|
16
17
|
onStartWalkthrough:(walkthrough:any, account?:AccountProps) => void
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
{
|
|
21
|
-
section: 'accounts', label:'Account Actions', actions : [
|
|
22
|
-
{
|
|
23
|
-
action :'my_accounts', label: "View My Accounts", icon:<Icons.ListIcon color={Colors.brand.midnight} size={12}/>, description: 'Manage your connected accounts. Transact, snooze, set limits or remove an existing account.'
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
action :'wallet_settings', label: "View My Settings", icon:<Icons.SettingsIcon color={Colors.brand.midnight} size={20}/>, description: 'View your current settings including your deposit and withdraw limits.'
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
section: 'transact', label:'Transact', actions : [
|
|
33
|
-
{
|
|
34
|
-
action :'order_history', label: "View Order History", icon:<Icons.TransactionIcon size={20} color={Colors.brand.midnight} />, description: 'View and manage past orders made on BettorEdge'
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
action :'deposit', label: "Make A Deposit", icon:<Icons.DepositIcon size={20} color={Colors.brand.midnight} />, description: 'Fund your BettorEdge real-money balance by making a deposit from an existing account or new one.'
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
action :'withdraw', label: "Make A Withdrawal", icon:<Icons.WithdrawIcon size={20} color={Colors.brand.midnight} />, description: 'Move funds from your BettorEdge real-money balance to a connected ACH account.'
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
]
|
|
44
|
-
}
|
|
45
|
-
]
|
|
20
|
+
|
|
46
21
|
|
|
47
22
|
const WalletActionSelector = ({ player, walkthrough_steps, player_balance, accounts, onClose, onActionSelect, onStartWalkthrough }: WalletActionSelectorProps) => {
|
|
23
|
+
const Colors = useColors();
|
|
48
24
|
const [ show_steps, setShowSteps ] = useState(false);
|
|
49
25
|
const [ width, setWidth ] = useState(0);
|
|
50
26
|
|
|
27
|
+
const sections = [
|
|
28
|
+
{
|
|
29
|
+
section: 'accounts', label:'Account Actions', actions : [
|
|
30
|
+
{
|
|
31
|
+
action :'my_accounts', label: "View My Accounts", icon:<Icons.ListIcon color={Colors.text.h1} size={12}/>, description: 'Manage your connected accounts. Transact, snooze, set limits or remove an existing account.'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
action :'wallet_settings', label: "View My Settings", icon:<Icons.SettingsIcon color={Colors.text.h1} size={20}/>, description: 'View your current settings including your deposit and withdraw limits.'
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
section: 'transact', label:'Transact', actions : [
|
|
41
|
+
{
|
|
42
|
+
action :'order_history', label: "View Order History", icon:<Icons.TransactionIcon size={20} color={Colors.text.h1} />, description: 'View and manage past orders made on BettorEdge'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
action :'deposit', label: "Make A Deposit", icon:<Icons.DepositIcon size={20} color={Colors.text.h1} />, description: 'Fund your BettorEdge real-money balance by making a deposit from an existing account or new one.'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
action :'withdraw', label: "Make A Withdrawal", icon:<Icons.WithdrawIcon size={20} color={Colors.text.h1} />, description: 'Move funds from your BettorEdge real-money balance to a connected ACH account.'
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
|
|
51
55
|
const handleActionSelect = (action:any) => {
|
|
52
56
|
switch(action.action){
|
|
53
57
|
case 'deposit':
|
|
@@ -64,7 +68,7 @@ const WalletActionSelector = ({ player, walkthrough_steps, player_balance, accou
|
|
|
64
68
|
|
|
65
69
|
const renderActions = (data:{ item:any, index:number }) => {
|
|
66
70
|
return (
|
|
67
|
-
<
|
|
71
|
+
<Button style={{ padding:10, flexDirection:'row', alignItems:'center', borderBottomWidth:1, borderBottomColor:Colors.borders.light }}
|
|
68
72
|
onPress={() => handleActionSelect(data.item)}>
|
|
69
73
|
|
|
70
74
|
<View style={{ flex:1, marginRight:10 }}>
|
|
@@ -72,19 +76,21 @@ const WalletActionSelector = ({ player, walkthrough_steps, player_balance, accou
|
|
|
72
76
|
{data.item.icon?
|
|
73
77
|
data.item.icon
|
|
74
78
|
:<></>}
|
|
75
|
-
<Text style={{ marginLeft:5 }} size={16}
|
|
79
|
+
<Text style={{ marginLeft:5 }} size={16} theme='h1'>{data.item.label}</Text>
|
|
76
80
|
</View>
|
|
77
|
-
<Text style={{ padding:5 }} size={14}
|
|
81
|
+
<Text style={{ padding:5 }} size={14} theme='description'>{data.item.description}</Text>
|
|
78
82
|
</View>
|
|
79
|
-
<Icons.ChevronIcon direction='right' color={Colors.
|
|
80
|
-
</
|
|
83
|
+
<Icons.ChevronIcon direction='right' color={Colors.text.h1} size={12} />
|
|
84
|
+
</Button>
|
|
81
85
|
)
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
const renderSections = (data: { item:any, index:number }) => {
|
|
85
89
|
return (
|
|
86
|
-
<View style={{
|
|
87
|
-
<
|
|
90
|
+
<View style={{ marginTop:10 }}>
|
|
91
|
+
<View type='header' style={{ padding:15 }}>
|
|
92
|
+
<Text theme='h1'>{data.item.label.toUpperCase()}</Text>
|
|
93
|
+
</View>
|
|
88
94
|
<View style={{ padding:5 }}>
|
|
89
95
|
<FlatList
|
|
90
96
|
key='actions'
|
|
@@ -99,7 +105,6 @@ const WalletActionSelector = ({ player, walkthrough_steps, player_balance, accou
|
|
|
99
105
|
}
|
|
100
106
|
|
|
101
107
|
const handleStepSelect = (step:any, index:number) => {
|
|
102
|
-
console.log(step)
|
|
103
108
|
switch(step.step){
|
|
104
109
|
case 'deposit':
|
|
105
110
|
let default_account = accounts.find(a => a.default_account)
|
|
@@ -115,11 +120,11 @@ const WalletActionSelector = ({ player, walkthrough_steps, player_balance, accou
|
|
|
115
120
|
const renderSteps = (data: { item:any, index:number }) => {
|
|
116
121
|
return (
|
|
117
122
|
<TouchableOpacity
|
|
118
|
-
style={{ margin:5, padding:10, flexDirection:'row', alignItems:'center', borderWidth:1, borderColor:Colors.
|
|
123
|
+
style={{ margin:5, padding:10, flexDirection:'row', alignItems:'center', borderWidth:1, borderColor:Colors.borders.light, borderRadius:8 }}
|
|
119
124
|
onPress={() => handleStepSelect(data.item, data.index)}>
|
|
120
|
-
<Icons.CheckCirlceIcon size={14} color={data.item.complete?Colors.
|
|
121
|
-
<Text style={{ flex:1, marginLeft:10 }}
|
|
122
|
-
<Icons.ChevronIcon direction='right' size={8} color={Colors.
|
|
125
|
+
<Icons.CheckCirlceIcon size={14} color={data.item.complete?Colors.text.success:Colors.text.success}/>
|
|
126
|
+
<Text style={{ flex:1, marginLeft:10 }} theme='description'>{data.item.label}</Text>
|
|
127
|
+
<Icons.ChevronIcon direction='right' size={8} color={Colors.text.h1} />
|
|
123
128
|
</TouchableOpacity>
|
|
124
129
|
)
|
|
125
130
|
}
|
|
@@ -131,48 +136,47 @@ const WalletActionSelector = ({ player, walkthrough_steps, player_balance, accou
|
|
|
131
136
|
const { width } = ev.nativeEvent.layout
|
|
132
137
|
setWidth(width)
|
|
133
138
|
}}>
|
|
134
|
-
<View style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
|
|
139
|
+
<View type='header' style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
|
|
135
140
|
<Image
|
|
136
141
|
source={{ uri: player.profile_pic }}
|
|
137
142
|
style={{ height:60, width:60, borderRadius:4 }}
|
|
138
143
|
resizeMode='cover'
|
|
139
144
|
/>
|
|
140
|
-
<View style={{ flex:1, marginLeft:
|
|
141
|
-
<Text size={20}
|
|
142
|
-
<View style={{ flexDirection:'row' }}>
|
|
143
|
-
<View style={{ margin:3,
|
|
144
|
-
<Text size={14}
|
|
145
|
+
<View transparent style={{ flex:1, marginLeft:15 }}>
|
|
146
|
+
<Text size={20} theme='h1'>My Wallet Balances</Text>
|
|
147
|
+
<View transparent style={{ flexDirection:'row', marginTop:5 }}>
|
|
148
|
+
<View float style={{ margin:3, padding:8, borderRadius:8 }}>
|
|
149
|
+
<Text size={14} theme='h1'>${WalletHelpers.formatBalance(player_balance.balance)}</Text>
|
|
145
150
|
</View>
|
|
146
|
-
<View style={{ margin:3,
|
|
147
|
-
<Text size={14}
|
|
151
|
+
<View float style={{ margin:3, padding:8, borderRadius:8 }}>
|
|
152
|
+
<Text size={14} theme='h1'>P{WalletHelpers.formatBalance(player_balance.promo_balance)}</Text>
|
|
148
153
|
</View>
|
|
149
|
-
<View style={{ margin:3,
|
|
150
|
-
|
|
154
|
+
<View float style={{ margin:3, padding:8, borderRadius:8 }}>
|
|
155
|
+
<Text size={14} theme='h1'>E{WalletHelpers.formatBalance(player_balance.free_market_balance)}</Text>
|
|
151
156
|
</View>
|
|
152
157
|
</View>
|
|
153
158
|
</View>
|
|
154
159
|
</View>
|
|
155
|
-
<
|
|
156
|
-
|
|
160
|
+
<View style={{ flex:1 }}>
|
|
157
161
|
{pct_complete < 1 ?
|
|
158
|
-
<View style={{
|
|
162
|
+
<View style={{ padding:10 }}>
|
|
159
163
|
<View>
|
|
160
164
|
<TouchableOpacity style={{ flexDirection:'row', alignItems:'center', padding:10 }} onPress={() => setShowSteps(!show_steps)}>
|
|
161
165
|
<View style={{ flex:1, marginRight:10 }}>
|
|
162
|
-
<Text
|
|
163
|
-
<Text style={{ marginTop:3 }}
|
|
166
|
+
<Text theme='h1'>Setup your wallet</Text>
|
|
167
|
+
<Text style={{ marginTop:3 }} theme='description'>Complete all the steps below to have full access to move funds in and out of BettorEdge</Text>
|
|
164
168
|
</View>
|
|
165
|
-
<Icons.ChevronIcon direction={show_steps ? 'up' : 'down'} color={Colors.
|
|
169
|
+
<Icons.ChevronIcon direction={show_steps ? 'up' : 'down'} color={Colors.text.h1} size={10} />
|
|
166
170
|
</TouchableOpacity>
|
|
167
171
|
<View style={{ flexDirection:'row', justifyContent:'center', alignItems:'center', }}>
|
|
168
172
|
<Text size={14} weight='bold'>{(pct_complete * 100).toFixed()}%</Text>
|
|
169
|
-
<View style={{ marginLeft:20, height:10, width:width - 100,
|
|
170
|
-
<View style={{ position:'absolute', top:0, left:0, bottom:0, width: (width-100)*pct_complete, backgroundColor:Colors.
|
|
173
|
+
<View style={{ marginLeft:20, height:10, width:width - 100, borderRadius:15 }}>
|
|
174
|
+
<View style={{ position:'absolute', top:0, left:0, bottom:0, width: (width-100)*pct_complete, backgroundColor:Colors.text.success, borderRadius:15 }} />
|
|
171
175
|
</View>
|
|
172
176
|
</View>
|
|
173
177
|
</View>
|
|
174
178
|
{show_steps ?
|
|
175
|
-
<View style={{marginTop:5, borderTopWidth:1, borderColor:Colors.
|
|
179
|
+
<View style={{marginTop:5, borderTopWidth:1, borderColor:Colors.borders.light }}>
|
|
176
180
|
<FlatList
|
|
177
181
|
data={walkthrough_steps}
|
|
178
182
|
renderItem={renderSteps}
|
|
@@ -182,7 +186,7 @@ const WalletActionSelector = ({ player, walkthrough_steps, player_balance, accou
|
|
|
182
186
|
:<></>}
|
|
183
187
|
</View>
|
|
184
188
|
:<></>}
|
|
185
|
-
<View style={{
|
|
189
|
+
<View type='body' style={{ marginTop:5 }}>
|
|
186
190
|
<FlatList
|
|
187
191
|
key={'wallet_sections'}
|
|
188
192
|
data={sections}
|
|
@@ -190,18 +194,15 @@ const WalletActionSelector = ({ player, walkthrough_steps, player_balance, accou
|
|
|
190
194
|
keyExtractor={(item) => item.section}
|
|
191
195
|
/>
|
|
192
196
|
</View>
|
|
193
|
-
</
|
|
194
|
-
<View nativeID='action_row' style={{ padding:20 }}>
|
|
197
|
+
</View>
|
|
198
|
+
<View nativeID='action_row' style={{ flexDirection:'row', alignItems:'center', padding:20 }}>
|
|
195
199
|
<Button
|
|
196
200
|
title='CLOSE'
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
borderColor={Colors.brand.electric}
|
|
200
|
-
padding={15}
|
|
201
|
+
style={{ flex:1 }}
|
|
202
|
+
type='close'
|
|
201
203
|
onPress={() => onClose()}
|
|
202
204
|
/>
|
|
203
205
|
</View>
|
|
204
|
-
|
|
205
206
|
</View>
|
|
206
207
|
)
|
|
207
208
|
}
|