be-components 0.5.1 → 0.5.3

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.
Files changed (191) hide show
  1. package/lib/commonjs/Authenticator/Components/StrategyForm.js.map +1 -1
  2. package/lib/commonjs/Authenticator/api/index.js.map +1 -1
  3. package/lib/commonjs/Checkout/api/index.js +1 -1
  4. package/lib/commonjs/Checkout/api/index.js.map +1 -1
  5. package/lib/commonjs/{Wallet → Checkout}/components/PayPalOrderCapture.js +1 -1
  6. package/lib/commonjs/Checkout/components/PayPalOrderCapture.js.map +1 -0
  7. package/lib/commonjs/Checkout/index.js +1 -1
  8. package/lib/commonjs/Components/Icons.js +121 -0
  9. package/lib/commonjs/Components/Icons.js.map +1 -1
  10. package/lib/commonjs/ProfileManager/Components/BasicStatus.js.map +1 -1
  11. package/lib/commonjs/ProfileManager/Components/CodeRedeem.js.map +1 -1
  12. package/lib/commonjs/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  13. package/lib/commonjs/ProfileManager/Components/VouchCard.js.map +1 -1
  14. package/lib/commonjs/ProfileManager/api/index.js +0 -1
  15. package/lib/commonjs/ProfileManager/api/index.js.map +1 -1
  16. package/lib/commonjs/Wallet/api/index.js +123 -0
  17. package/lib/commonjs/Wallet/api/index.js.map +1 -1
  18. package/lib/commonjs/Wallet/components/ACHAddCard.js +231 -0
  19. package/lib/commonjs/Wallet/components/ACHAddCard.js.map +1 -0
  20. package/lib/commonjs/Wallet/components/AccountCard.js +6 -0
  21. package/lib/commonjs/Wallet/components/AccountCard.js.map +1 -1
  22. package/lib/commonjs/Wallet/components/AccountManager.js +4 -4
  23. package/lib/commonjs/Wallet/components/AccountManager.js.map +1 -1
  24. package/lib/commonjs/Wallet/components/DepositCard.js +66 -14
  25. package/lib/commonjs/Wallet/components/DepositCard.js.map +1 -1
  26. package/lib/commonjs/Wallet/components/FundAccountCard.js +325 -0
  27. package/lib/commonjs/Wallet/components/FundAccountCard.js.map +1 -0
  28. package/lib/commonjs/Wallet/components/ItemOrderCard.js +96 -0
  29. package/lib/commonjs/Wallet/components/ItemOrderCard.js.map +1 -0
  30. package/lib/commonjs/Wallet/components/ItemOrderDetailCard.js +161 -0
  31. package/lib/commonjs/Wallet/components/ItemOrderDetailCard.js.map +1 -0
  32. package/lib/commonjs/Wallet/components/LinkAccountManager.js +3 -3
  33. package/lib/commonjs/Wallet/components/LinkAccountManager.js.map +1 -1
  34. package/lib/commonjs/Wallet/components/ManualACHAdd.js +2 -2
  35. package/lib/commonjs/Wallet/components/ManualCardAdd.js +5 -5
  36. package/lib/commonjs/Wallet/components/ManualCardAdd.js.map +1 -1
  37. package/lib/commonjs/Wallet/components/MyBalance.js +141 -13
  38. package/lib/commonjs/Wallet/components/MyBalance.js.map +1 -1
  39. package/lib/commonjs/Wallet/components/OrderManager.js +118 -0
  40. package/lib/commonjs/Wallet/components/OrderManager.js.map +1 -0
  41. package/lib/commonjs/Wallet/components/VerifyACHAccount.js +2 -2
  42. package/lib/commonjs/Wallet/components/WalletActionSelector.js +358 -0
  43. package/lib/commonjs/Wallet/components/WalletActionSelector.js.map +1 -0
  44. package/lib/commonjs/Wallet/components/WalletSettings.js +595 -0
  45. package/lib/commonjs/Wallet/components/WalletSettings.js.map +1 -0
  46. package/lib/commonjs/Wallet/components/WalletSetup.js +96 -10
  47. package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -1
  48. package/lib/commonjs/Wallet/index.js +349 -17
  49. package/lib/commonjs/Wallet/index.js.map +1 -1
  50. package/lib/commonjs/constants/colors.js +2 -1
  51. package/lib/commonjs/constants/colors.js.map +1 -1
  52. package/lib/module/Authenticator/Components/StrategyForm.js.map +1 -1
  53. package/lib/module/Authenticator/api/index.js.map +1 -1
  54. package/lib/module/Checkout/api/index.js +1 -1
  55. package/lib/module/Checkout/api/index.js.map +1 -1
  56. package/lib/module/{Wallet → Checkout}/components/PayPalOrderCapture.js +1 -1
  57. package/lib/module/{Wallet → Checkout}/components/PayPalOrderCapture.js.map +1 -1
  58. package/lib/module/Checkout/index.js +1 -1
  59. package/lib/module/Checkout/index.js.map +1 -1
  60. package/lib/module/Components/Icons.js +121 -0
  61. package/lib/module/Components/Icons.js.map +1 -1
  62. package/lib/module/ProfileManager/Components/BasicStatus.js.map +1 -1
  63. package/lib/module/ProfileManager/Components/CodeRedeem.js.map +1 -1
  64. package/lib/module/ProfileManager/Components/ProfileWelcome.js.map +1 -1
  65. package/lib/module/ProfileManager/Components/VouchCard.js.map +1 -1
  66. package/lib/module/ProfileManager/api/index.js +0 -1
  67. package/lib/module/ProfileManager/api/index.js.map +1 -1
  68. package/lib/module/Wallet/api/index.js +123 -0
  69. package/lib/module/Wallet/api/index.js.map +1 -1
  70. package/lib/module/Wallet/components/ACHAddCard.js +224 -0
  71. package/lib/module/Wallet/components/ACHAddCard.js.map +1 -0
  72. package/lib/module/Wallet/components/AccountCard.js +6 -0
  73. package/lib/module/Wallet/components/AccountCard.js.map +1 -1
  74. package/lib/module/Wallet/components/AccountManager.js +4 -4
  75. package/lib/module/Wallet/components/AccountManager.js.map +1 -1
  76. package/lib/module/Wallet/components/DepositCard.js +68 -16
  77. package/lib/module/Wallet/components/DepositCard.js.map +1 -1
  78. package/lib/module/Wallet/components/FundAccountCard.js +318 -0
  79. package/lib/module/Wallet/components/FundAccountCard.js.map +1 -0
  80. package/lib/module/Wallet/components/ItemOrderCard.js +87 -0
  81. package/lib/module/Wallet/components/ItemOrderCard.js.map +1 -0
  82. package/lib/module/Wallet/components/ItemOrderDetailCard.js +153 -0
  83. package/lib/module/Wallet/components/ItemOrderDetailCard.js.map +1 -0
  84. package/lib/module/Wallet/components/LinkAccountManager.js +3 -3
  85. package/lib/module/Wallet/components/LinkAccountManager.js.map +1 -1
  86. package/lib/module/Wallet/components/ManualACHAdd.js +2 -2
  87. package/lib/module/Wallet/components/ManualCardAdd.js +5 -5
  88. package/lib/module/Wallet/components/ManualCardAdd.js.map +1 -1
  89. package/lib/module/Wallet/components/MyBalance.js +141 -13
  90. package/lib/module/Wallet/components/MyBalance.js.map +1 -1
  91. package/lib/module/Wallet/components/OrderManager.js +109 -0
  92. package/lib/module/Wallet/components/OrderManager.js.map +1 -0
  93. package/lib/module/Wallet/components/VerifyACHAccount.js +2 -2
  94. package/lib/module/Wallet/components/WalletActionSelector.js +349 -0
  95. package/lib/module/Wallet/components/WalletActionSelector.js.map +1 -0
  96. package/lib/module/Wallet/components/WalletSettings.js +587 -0
  97. package/lib/module/Wallet/components/WalletSettings.js.map +1 -0
  98. package/lib/module/Wallet/components/WalletSetup.js +97 -11
  99. package/lib/module/Wallet/components/WalletSetup.js.map +1 -1
  100. package/lib/module/Wallet/index.js +351 -19
  101. package/lib/module/Wallet/index.js.map +1 -1
  102. package/lib/module/constants/colors.js +2 -1
  103. package/lib/module/constants/colors.js.map +1 -1
  104. package/lib/typescript/src/Authenticator/Components/StrategyForm.d.ts.map +1 -1
  105. package/lib/typescript/src/Authenticator/api/index.d.ts +1 -2
  106. package/lib/typescript/src/Authenticator/api/index.d.ts.map +1 -1
  107. package/lib/typescript/src/Checkout/components/PayPalOrderCapture.d.ts.map +1 -0
  108. package/lib/typescript/src/Components/Icons.d.ts +4 -0
  109. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  110. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts +2 -2
  111. package/lib/typescript/src/ProfileManager/Components/BasicStatus.d.ts.map +1 -1
  112. package/lib/typescript/src/ProfileManager/Components/CodeRedeem.d.ts.map +1 -1
  113. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts +2 -2
  114. package/lib/typescript/src/ProfileManager/Components/ProfileWelcome.d.ts.map +1 -1
  115. package/lib/typescript/src/ProfileManager/Components/ProfileWizard.d.ts.map +1 -1
  116. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts +2 -2
  117. package/lib/typescript/src/ProfileManager/Components/VouchCard.d.ts.map +1 -1
  118. package/lib/typescript/src/ProfileManager/api/index.d.ts +2 -2
  119. package/lib/typescript/src/ProfileManager/api/index.d.ts.map +1 -1
  120. package/lib/typescript/src/Wallet/api/index.d.ts +35 -1
  121. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -1
  122. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts +15 -0
  123. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts.map +1 -0
  124. package/lib/typescript/src/Wallet/components/AccountCard.d.ts.map +1 -1
  125. package/lib/typescript/src/Wallet/components/DepositCard.d.ts +9 -2
  126. package/lib/typescript/src/Wallet/components/DepositCard.d.ts.map +1 -1
  127. package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts +23 -0
  128. package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts.map +1 -0
  129. package/lib/typescript/src/Wallet/components/ItemOrderCard.d.ts +8 -0
  130. package/lib/typescript/src/Wallet/components/ItemOrderCard.d.ts.map +1 -0
  131. package/lib/typescript/src/Wallet/components/ItemOrderDetailCard.d.ts +8 -0
  132. package/lib/typescript/src/Wallet/components/ItemOrderDetailCard.d.ts.map +1 -0
  133. package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts +1 -1
  134. package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts.map +1 -1
  135. package/lib/typescript/src/Wallet/components/MyBalance.d.ts +1 -1
  136. package/lib/typescript/src/Wallet/components/MyBalance.d.ts.map +1 -1
  137. package/lib/typescript/src/Wallet/components/OrderManager.d.ts +7 -0
  138. package/lib/typescript/src/Wallet/components/OrderManager.d.ts.map +1 -0
  139. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts +15 -0
  140. package/lib/typescript/src/Wallet/components/WalletActionSelector.d.ts.map +1 -0
  141. package/lib/typescript/src/Wallet/components/WalletSettings.d.ts +17 -0
  142. package/lib/typescript/src/Wallet/components/WalletSettings.d.ts.map +1 -0
  143. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts +3 -1
  144. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -1
  145. package/lib/typescript/src/Wallet/index.d.ts.map +1 -1
  146. package/lib/typescript/src/constants/colors.d.ts +1 -0
  147. package/lib/typescript/src/constants/colors.d.ts.map +1 -1
  148. package/package.json +1 -1
  149. package/src/Authenticator/Components/StrategyForm.tsx +1 -2
  150. package/src/Authenticator/api/index.ts +1 -2
  151. package/src/Checkout/api/index.tsx +1 -1
  152. package/src/{Wallet → Checkout}/components/PayPalOrderCapture.tsx +1 -1
  153. package/src/Checkout/index.tsx +1 -1
  154. package/src/Components/Icons.tsx +66 -0
  155. package/src/ProfileManager/Components/BasicStatus.tsx +2 -2
  156. package/src/ProfileManager/Components/CodeRedeem.tsx +2 -2
  157. package/src/ProfileManager/Components/ProfileWelcome.tsx +2 -2
  158. package/src/ProfileManager/Components/ProfileWizard.tsx +2 -2
  159. package/src/ProfileManager/Components/VouchCard.tsx +2 -2
  160. package/src/ProfileManager/api/index.ts +2 -3
  161. package/src/ProfileManager/api/types.d.ts +0 -54
  162. package/src/Wallet/api/index.ts +85 -1
  163. package/src/Wallet/components/ACHAddCard.tsx +109 -0
  164. package/src/Wallet/components/AccountCard.tsx +4 -0
  165. package/src/Wallet/components/AccountManager.tsx +4 -4
  166. package/src/Wallet/components/DepositCard.tsx +34 -7
  167. package/src/Wallet/components/FundAccountCard.tsx +158 -0
  168. package/src/Wallet/components/ItemOrderCard.tsx +46 -0
  169. package/src/Wallet/components/ItemOrderDetailCard.tsx +101 -0
  170. package/src/Wallet/components/LinkAccountManager.tsx +4 -4
  171. package/src/Wallet/components/ManualACHAdd.tsx +2 -2
  172. package/src/Wallet/components/ManualCardAdd.tsx +4 -4
  173. package/src/Wallet/components/MyBalance.tsx +38 -17
  174. package/src/Wallet/components/OrderManager.tsx +99 -0
  175. package/src/Wallet/components/VerifyACHAccount.tsx +2 -2
  176. package/src/Wallet/components/WalletActionSelector.tsx +196 -0
  177. package/src/Wallet/components/WalletSettings.tsx +224 -0
  178. package/src/Wallet/components/WalletSetup.tsx +66 -17
  179. package/src/Wallet/index.tsx +283 -22
  180. package/src/constants/colors.ts +2 -1
  181. package/src/types.d.ts +61 -1
  182. package/lib/commonjs/Wallet/components/ACHAdd.js +0 -63
  183. package/lib/commonjs/Wallet/components/ACHAdd.js.map +0 -1
  184. package/lib/commonjs/Wallet/components/PayPalOrderCapture.js.map +0 -1
  185. package/lib/module/Wallet/components/ACHAdd.js +0 -56
  186. package/lib/module/Wallet/components/ACHAdd.js.map +0 -1
  187. package/lib/typescript/src/Wallet/components/ACHAdd.d.ts +0 -13
  188. package/lib/typescript/src/Wallet/components/ACHAdd.d.ts.map +0 -1
  189. package/lib/typescript/src/Wallet/components/PayPalOrderCapture.d.ts.map +0 -1
  190. package/src/Wallet/components/ACHAdd.tsx +0 -49
  191. /package/lib/typescript/src/{Wallet → Checkout}/components/PayPalOrderCapture.d.ts +0 -0
@@ -1,22 +1,29 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { View, ActivityIndicator } from "react-native";
2
+ import { View, ActivityIndicator, Image } from "react-native";
3
3
  import type { MyPlayerProps } from '../../ProfileManager/api/types';
4
- import type { AccountProps, AccountSnoozeProps, ItemOrderProps, PlayerDepositLimitProps, WalletSettingsProps } from '../../types';
4
+ import type { AccountProps, AccountSnoozeProps, CodeRequestProps, ItemOrderProps, PlayerDepositLimitProps, PlayerReferralProps, PromoProps, PublicPlayerProps, RewardOptionProps, WalletSettingsProps } from '../../types';
5
5
  import { ItemOrderApi, ItemOrderHelpers, WalletApi } from '../api';
6
6
  import Colors from '../../constants/colors';
7
- import { Button, Text, TextInput } from '../../Components';
7
+ import { Button, Icons, Text, TextInput } from '../../Components';
8
8
  import { view_styles } from '../../constants/styles';
9
9
 
10
10
  type DepositCardProps = {
11
11
  player:MyPlayerProps,
12
12
  wallet_settings:WalletSettingsProps,
13
13
  account:AccountProps,
14
+ code_details?: {
15
+ code_request?:CodeRequestProps,
16
+ referrer?:PublicPlayerProps,
17
+ promo?:PromoProps,
18
+ player_referral?:PlayerReferralProps,
19
+ reward_option?:RewardOptionProps
20
+ },
14
21
  deposit_limit:PlayerDepositLimitProps,
15
22
  onTransact:(draft_order:ItemOrderProps, account_id?:string) => void,
16
23
  onCancel:() => void
17
24
  }
18
25
 
19
- const DepositCard = ({ wallet_settings, account, deposit_limit, onTransact, onCancel }:DepositCardProps) => {
26
+ const DepositCard = ({ wallet_settings, code_details, account, deposit_limit, onTransact, onCancel }:DepositCardProps) => {
20
27
  const [ draft_order, setDraftOrder ] = useState<ItemOrderProps>();
21
28
  const [ account_snooze, setAccountSnooze ] = useState<AccountSnoozeProps>();
22
29
 
@@ -49,9 +56,9 @@ const DepositCard = ({ wallet_settings, account, deposit_limit, onTransact, onCa
49
56
 
50
57
  return (
51
58
  <View style={{ flex:1 }}>
52
- <View nativeID='deposit_rules' style={{ padding:10 }}>
53
- <Text size={28} textAlign='center' weight='bold' color={Colors.brand.midnight}>Top up your account</Text>
54
- <Text style={{ marginTop:10 }} size={14} textAlign='center' weight='regular' color={Colors.brand.midnight}>Minumum $25 / Maximum ${ItemOrderHelpers.getDepositAvailable(deposit_limit, account).toFixed(2)}</Text>
59
+ <View style={{ padding:20 }}>
60
+ <Text size={26} color={Colors.brand.midnight} weight='bold'>MAKE A DEPOSIT</Text>
61
+ <Text style={{ marginTop:10 }} size={16} color={Colors.brand.midnight} weight='regular'>In order to participate in real-money activities, you will need to fund your BettorEdge Wallet. Please enter the amount you wish to deposit below.</Text>
55
62
  </View>
56
63
  <View style={{ flex:1 }}>
57
64
  <View nativeID='deposit_amount' style={{ justifyContent:'center', alignItems:'center', padding:20 }}>
@@ -62,6 +69,7 @@ const DepositCard = ({ wallet_settings, account, deposit_limit, onTransact, onCa
62
69
  value={draft_order.amount as string}
63
70
  onChangeText={(text) => setDraftOrder({ ...draft_order, amount:text })}
64
71
  />
72
+ <Text style={{ marginTop:5 }} size={14} color={Colors.brand.midnight} weight='regular'>Minumum $25 / Maximum ${ItemOrderHelpers.getDepositAvailable(deposit_limit, account).toFixed(2)}</Text>
65
73
  </View>
66
74
  <View nativeID='instant_available' style={{ backgroundColor:Colors.shades.shade100, padding:10, borderRadius:8 }}>
67
75
  <Text size={14} color={Colors.brand.midnight} weight='bold' textAlign='center'>Instant Deposit Available</Text>
@@ -80,6 +88,25 @@ const DepositCard = ({ wallet_settings, account, deposit_limit, onTransact, onCa
80
88
  </View>
81
89
  :<></>}
82
90
  </View>
91
+ {code_details && code_details.code_request?.pending_deposit && code_details.promo && code_details.referrer && ['referral_code','referral_sweepstakes'].includes(code_details.promo.type) ?
92
+ <View style={{ margin:15, flexDirection:'row', backgroundColor:Colors.shades.white, borderRadius:8, ...view_styles.float }}>
93
+ <View style={{ justifyContent:'center' }}>
94
+ {code_details.referrer?.profile_pic?
95
+ <Image
96
+ source={{ uri: code_details.referrer.profile_pic }}
97
+ style={{ height: 60, width:60, borderRadius:4 }}
98
+ resizeMode='cover'
99
+ />
100
+ :
101
+ <Icons.GiftIcon size={40} color={Colors.incentive.gold} />
102
+ }
103
+ </View>
104
+ <View style={{flex:1, backgroundColor:Colors.incentive.gold_faded, padding:10 }}>
105
+ <Text style={{ paddingBottom:10, borderBottomWidth:1, borderBottomColor:Colors.shades.shade600 }} size={14} color={Colors.brand.midnight} weight='bold'>Give back to {code_details.referrer?.username}</Text>
106
+ <Text style={{ paddingTop:5 }} size={12} color={Colors.brand.midnight} weight='semibold'>Make a qualifying deposit and {code_details.referrer.username} will receive a reward!</Text>
107
+ </View>
108
+ </View>
109
+ :<></>}
83
110
  <View nativeID='action_row' style={{ flexDirection:'row', padding:20 }}>
84
111
  <Button
85
112
  style={{ flex:1, marginRight:5, opacity: 1 }}
@@ -0,0 +1,158 @@
1
+ import React from 'react';
2
+ import { View, TouchableOpacity, Image } from 'react-native';
3
+ import type { MyPlayerProps } from '../../ProfileManager/api/types';
4
+ import type { AccountProps, CodeRequestProps, PlayerReferralProps, PromoProps, PublicPlayerProps, RewardOptionProps } from '../../types';
5
+ import { Button, Icons, Text } from '../../Components';
6
+ import Colors from '../../constants/colors';
7
+ import { button_styles, view_styles } from '../../constants/styles';
8
+
9
+ type FundAccountCardProps = {
10
+ player:MyPlayerProps,
11
+ accounts:AccountProps[],
12
+ code_details: {
13
+ code_request?:CodeRequestProps,
14
+ referrer?:PublicPlayerProps,
15
+ promo?:PromoProps,
16
+ player_referral?:PlayerReferralProps,
17
+ reward_option?:RewardOptionProps
18
+ }
19
+ walkthrough?:boolean,
20
+ onManualACH: () => void,
21
+ onCard:(account?:AccountProps) => void,
22
+ onSelectAccount: (account:AccountProps) => void,
23
+ onClose: () => void,
24
+ onNext: () => void,
25
+ }
26
+
27
+ const FundAccountCard = ({ accounts, code_details, onClose, onCard, onNext, walkthrough, onManualACH, onSelectAccount }:FundAccountCardProps) => {
28
+
29
+ const { code_request, promo, referrer } = code_details;
30
+
31
+ const manual_account = accounts.find(a => a.ach_detail && a.ach_detail.ach_type == 'manual');
32
+ const ibt_placeholder_account = accounts.find(a => a.ibt_placeholder);
33
+ const ibt_account = accounts.find(a => a.ach_detail && a.ach_detail.ach_type == 'ibf' && !a.ibt_placeholder);
34
+ const card_account = accounts.find(a => a.account_type == 'card');
35
+ const paypal_account = accounts.find(a => a.account_type == 'paypal');
36
+
37
+ return (
38
+ <View style={{ flex:1 }}>
39
+ <View style={{ padding:20 }}>
40
+ <Text size={26} color={Colors.brand.midnight} weight='bold'>FUND YOUR BETTOREDGE WALLET</Text>
41
+ <Text style={{ marginTop:10 }} size={16} color={Colors.brand.midnight} weight='regular'>In order to fund your real-money/USD ($) balance, simply make a deposit using the following options</Text>
42
+ </View>
43
+ <View style={{ flex:1, padding:20 }}>
44
+ <View nativeID='fund_account_now'>
45
+ <Text size={18} color={Colors.brand.midnight} weight='bold'>FUND YOUR ACCOUNT NOW</Text>
46
+ {ibt_placeholder_account ?
47
+ <View style={{ marginTop:15 }}>
48
+ <TouchableOpacity style={{padding:3, flexDirection:'row', alignItems:'center', borderRadius:30, backgroundColor:Colors.shades.white }}
49
+ onPress={() => onSelectAccount(ibt_placeholder_account)}>
50
+ <View style={{ height:50, width:50, borderRadius:100, justifyContent:'center', alignItems:'center', borderWidth:1, borderColor:Colors.brand.midnight }}>
51
+ <Icons.PlaidIcon size={22} color={Colors.brand.midnight} />
52
+ </View>
53
+ <View style={{ flex:1, marginLeft:10 }}>
54
+ <Text size={14} color={Colors.brand.midnight} weight='bold'>INSTANT BANK TRANSFER</Text>
55
+ <Text style={{ marginTop:3 }} size={12} color={Colors.brand.midnight} weight='regular'>When you link an account you get access to both instant deposits and instant withdraws.</Text>
56
+ </View>
57
+ </TouchableOpacity>
58
+ {ibt_account ?
59
+ <View style={{ position:'absolute', top:5, right:5, bottom:0}}>
60
+ <Icons.TransactionSuccessIcon size={45}/>
61
+ </View>
62
+ :<></>}
63
+ </View>
64
+ :<></>}
65
+ <View style={{ marginTop:10 }}>
66
+ <TouchableOpacity style={{ padding:3, flexDirection:'row', alignItems:'center', borderRadius:30, backgroundColor:Colors.brand.cyan }}
67
+ onPress={() => onCard(card_account)}>
68
+ <View style={{ height:50, width:50, borderRadius:100, justifyContent:'center', alignItems:'center', backgroundColor:Colors.shades.white }}>
69
+ <Icons.CreditCardIcon size={22} color={Colors.brand.cyan} />
70
+ </View>
71
+ <View style={{ flex:1, marginLeft:10 }}>
72
+ <Text size={14} color={Colors.shades.white} weight='bold'>DEBIT / CREDIT CARD</Text>
73
+ <Text style={{ marginTop:3 }} size={12} color={Colors.shades.white} weight='semibold'>Add a debit / credit card and deposit instantly.</Text>
74
+ </View>
75
+ </TouchableOpacity>
76
+ {card_account ?
77
+ <View style={{ position:'absolute', top:5, right:5, bottom:0}}>
78
+ <Icons.TransactionSuccessIcon size={45}/>
79
+ </View>
80
+ :<></>}
81
+ </View>
82
+ {paypal_account ?
83
+ <View style={{ marginTop:10 }}>
84
+ <TouchableOpacity style={{ padding:3, flexDirection:'row', alignItems:'center', borderRadius:30, backgroundColor:Colors.company.paypal }}
85
+ onPress={() => onSelectAccount(paypal_account)}>
86
+ <View style={{ height:50, width:50, borderRadius:100, justifyContent:'center', alignItems:'center', backgroundColor:Colors.shades.white }}>
87
+ <Icons.PayPalIcon size={22}/>
88
+ </View>
89
+ <View style={{ flex:1, marginLeft:10 }}>
90
+ <Text size={14} color={Colors.company.paypal_blue} weight='bold'>PAYPAL</Text>
91
+ <Text style={{ marginTop:3 }} size={12} color={Colors.company.paypal_blue} weight='semibold'>Use your paypal account to deposit instantly.</Text>
92
+ </View>
93
+ </TouchableOpacity>
94
+ </View>
95
+ :<></>}
96
+ </View>
97
+ <View style={{ marginTop:20 }}>
98
+ <Text size={18} color={Colors.brand.midnight} weight='bold'>FUND LATER (~1-3 BUSINESS DAYS)</Text>
99
+ <View style={{ marginTop:15 }}>
100
+
101
+ <TouchableOpacity style={{ padding:3, flexDirection:'row', alignItems:'center', borderRadius:30, backgroundColor:Colors.brand.midnight }}
102
+ onPress={() => onManualACH()}>
103
+ <View style={{ height:50, width:50, borderRadius:100, justifyContent:'center', alignItems:'center', backgroundColor:Colors.shades.white }}>
104
+ <Icons.BankIcon size={22} color={Colors.brand.midnight} />
105
+ </View>
106
+ <View style={{ flex:1 }}>
107
+ <Text size={14} color={Colors.shades.white} textAlign='center' weight='bold'>ADD MANUAL ACH ACCOUNT</Text>
108
+ </View>
109
+ </TouchableOpacity>
110
+ {manual_account?
111
+ <View style={{ position:'absolute', top:5, right:5, bottom:0}}>
112
+ <Icons.TransactionSuccessIcon size={45}/>
113
+ </View>
114
+ :<></>}
115
+ </View>
116
+ </View>
117
+ </View>
118
+ {code_request?.pending_deposit && promo && referrer && ['referral_code','referral_sweepstakes'].includes(promo.type) ?
119
+ <View style={{ margin:15, flexDirection:'row', backgroundColor:Colors.shades.white, borderRadius:8, ...view_styles.float }}>
120
+ <View style={{ justifyContent:'center' }}>
121
+ {referrer?.profile_pic?
122
+ <Image
123
+ source={{ uri: referrer.profile_pic }}
124
+ style={{ height: 60, width:60, borderRadius:4 }}
125
+ resizeMode='cover'
126
+ />
127
+ :
128
+ <Icons.GiftIcon size={40} color={Colors.incentive.gold} />
129
+ }
130
+ </View>
131
+ <View style={{flex:1, backgroundColor:Colors.incentive.gold_faded, padding:10 }}>
132
+ <Text style={{ paddingBottom:10, borderBottomWidth:1, borderBottomColor:Colors.shades.shade600 }} size={14} color={Colors.brand.midnight} weight='bold'>Give back to {referrer?.username}</Text>
133
+ <Text style={{ paddingTop:5 }} size={12} color={Colors.brand.midnight} weight='semibold'>Make a qualifying deposit and {referrer.username} will receive a reward!</Text>
134
+ </View>
135
+ </View>
136
+ :<></>}
137
+ {walkthrough ?
138
+ <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
139
+ <Button
140
+ title={!ibt_account && !manual_account ? 'DO THIS LATER' : 'All Set!'}
141
+ title_color={!ibt_account && !manual_account ? Colors.utility.error: Colors.utility.success}
142
+ backgroundColor='transparent'
143
+ onPress={() => onClose()}
144
+ />
145
+ <TouchableOpacity
146
+ style={manual_account || ibt_account ? button_styles.wizard_valid : button_styles.wizard_invalid}
147
+ disabled={!manual_account && !ibt_account ? true : false}
148
+ onPress={() => onNext()}
149
+ >
150
+ <Icons.ChevronIcon size={20} direction='right' color={Colors.brand.midnight}/>
151
+ </TouchableOpacity>
152
+ </View>
153
+ :<></>}
154
+ </View>
155
+ )
156
+ }
157
+
158
+ export default FundAccountCard
@@ -0,0 +1,46 @@
1
+ import React, { useState } from 'react';
2
+ import { View, TouchableOpacity } from 'react-native';
3
+ import { Icons, Text } from '../../Components';
4
+ import Colors from '../../constants/colors';
5
+ import moment from 'moment-mini';
6
+ import { ItemOrderHelpers } from '../api';
7
+ import type { ItemOrderProps } from '../../types';
8
+ import ItemOrderDetails from './ItemOrderDetailCard';
9
+
10
+ type ItemOrderCardProps = {
11
+ item_order:ItemOrderProps
12
+ }
13
+ const ItemOrderCard = ({ item_order }:ItemOrderCardProps) => {
14
+ const [ expanded, setExpanded ] = useState(false);
15
+
16
+ const status_label = ItemOrderHelpers.getStatusLabel(item_order);
17
+
18
+ return (
19
+ <View style={{ backgroundColor:expanded?Colors.shades.shade600:undefined, borderRadius:8 }}>
20
+ <TouchableOpacity style={{ flex:1, flexDirection:'row', alignItems:'center', padding:10, borderBottomWidth:1, borderBottomColor:Colors.shades.shade100 }} onPress={() => setExpanded(!expanded)}>
21
+ <View nativeID='item_order_info' style={{ flex:3, borderRightWidth:1, borderColor:Colors.shades.shade600 }}>
22
+ <Text size={14} color={Colors.brand.midnight} weight='semibold'>{item_order.description}</Text>
23
+ <Text style={{ marginTop:4 }} size={12} color={Colors.brand.midnight} weight='regular'>Created at {moment(item_order.create_datetime).format('YYYY-MM-DD hh:mm a')}</Text>
24
+ </View>
25
+ <View nativeID='item_order_amount' style={{ flex:1, padding:5 }}>
26
+ <Text size={14} color={Colors.brand.midnight} weight='bold' textAlign='center'>${item_order.total_amount.toFixed(2)}</Text>
27
+ <View style={{ marginTop:3, padding:3, paddingRight:10, paddingLeft:10, backgroundColor:status_label.color, borderRadius:8}}>
28
+ <Text color={Colors.shades.white} weight='regular' textAlign='center'>{status_label.text}</Text>
29
+ </View>
30
+ </View>
31
+ <View style={{ padding:10 }}>
32
+ <Icons.ChevronIcon direction={expanded?'up':'down'} size={10} color={Colors.brand.midnight}/>
33
+ </View>
34
+ </TouchableOpacity>
35
+ {expanded ?
36
+ <View style={{ padding:20 }}>
37
+ <ItemOrderDetails
38
+ item_order={item_order}
39
+ />
40
+ </View>
41
+ :<></>}
42
+ </View>
43
+ )
44
+ }
45
+
46
+ export default ItemOrderCard
@@ -0,0 +1,101 @@
1
+ import React from 'react';
2
+ import { useEffect, useState } from "react"
3
+ import { FlatList, View, ActivityIndicator} from "react-native"
4
+ import { Text } from '../../Components';
5
+ import { ItemOrderApi, WalletApi } from '../api';
6
+ import type { AccountProps, ItemOrderProps, TransactionDetailProps, TransactionProps } from '../../types';
7
+ import Colors from '../../constants/colors';
8
+ import moment from 'moment-mini';
9
+
10
+ type ItemOrderDetailsProps = {
11
+ item_order: ItemOrderProps,
12
+ }
13
+
14
+ const ItemOrderDetails = ({ item_order }:ItemOrderDetailsProps) => {
15
+ const [ loading, setLoading ] = useState(false);
16
+ const [ data, setData ] = useState<{
17
+ account?:AccountProps,
18
+ transaction?:TransactionProps,
19
+ transaction_details:TransactionDetailProps[]
20
+ }>({
21
+ transaction_details: []
22
+ });
23
+
24
+ const { account, transaction, transaction_details } = data;
25
+
26
+
27
+ useEffect(() => {
28
+ getDataFromServer(item_order)
29
+ },[item_order])
30
+
31
+ const getDataFromServer = async(item_order:ItemOrderProps) => {
32
+ if(!item_order.transaction_id){ return }
33
+ setLoading(true);
34
+ const resp = await ItemOrderApi.getTransactionById(item_order.transaction_id)
35
+ const acct = await WalletApi.getAccountById(resp.transaction.account_id)
36
+ setData({
37
+ transaction: resp.transaction,
38
+ transaction_details: resp.transaction_details,
39
+ account:acct
40
+ })
41
+ setLoading(false)
42
+ }
43
+
44
+ const renderTransactionDetails = (data : { item:TransactionDetailProps, index:number }) => {
45
+ return (
46
+ <View style={{ flexDirection:'row', alignItems:'center', padding:5 }}>
47
+ <Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='regular'>{data.item.description}</Text>
48
+ <Text size={14} color={Colors.brand.midnight} weight="bold">${data.item.amount.toFixed(2)}</Text>
49
+ </View>
50
+ )
51
+ }
52
+
53
+ if(!item_order){ return <></> }
54
+
55
+ let sub_total = parseFloat(item_order.amount as string)
56
+ let detail_total = transaction_details.filter(td => !td.fee_type).reduce((a,b) => a + b.amount, 0)
57
+ let unsettled = sub_total - detail_total
58
+
59
+
60
+
61
+ return (
62
+ <View nativeID="item_order_details">
63
+ {account ?
64
+ <View style={{ flexDirection:'row', alignItems:'center', padding:5 }}>
65
+ <Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='regular'>Account</Text>
66
+ <Text size={14} color={Colors.brand.midnight} weight="bold">{account.account_label}</Text>
67
+ </View>
68
+ :<></>}
69
+ {loading ?
70
+ <ActivityIndicator size='small' color={Colors.brand.midnight} />
71
+ :<></>}
72
+ <FlatList
73
+ data={transaction_details}
74
+ renderItem={renderTransactionDetails}
75
+ />
76
+ {transaction?.status == 'posted' && transaction?.estimated_settle_datetime && moment().isBefore(moment(transaction.estimated_settle_datetime)) ?
77
+ <View>
78
+ <View style={{ flexDirection:'row', alignItems:'center', padding:5 }}>
79
+ <Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='regular'>Estimated Settle Time</Text>
80
+ <Text size={14} color={Colors.brand.midnight} weight="bold">{moment(transaction.estimated_settle_datetime).format('MM/DD @ h a')}</Text>
81
+ </View>
82
+ {unsettled > 0 ?
83
+ <View style={{ padding:10, backgroundColor:Colors.shades.shade100, borderRadius:8, marginTop:10 }}>
84
+ <View style={{ flexDirection:'row', alignItems:'center' }}>
85
+ <Text style={{ flex:1 }} size={14} color={Colors.brand.midnight} weight='regular'>Awaiting Settlement</Text>
86
+ <Text size={14} color={Colors.utility.warning} weight="bold">${unsettled.toFixed(2)}</Text>
87
+ </View>
88
+ <Text style={{ marginTop:10 }} size={12} color={Colors.brand.midnight} weight='regular'>This amount exceeded your <Text size={12} weight='bold'>Instant Deposit Limit</Text> and will be added to your wallet after the transaction settles based on the date noted above.</Text>
89
+ </View>
90
+ :<></>}
91
+ </View>
92
+ :<></>}
93
+ {false && item_order.type == 'wallet' && transaction?.status == 'posted' ?
94
+ <View style={{ borderRadius:8, backgroundColor:Colors.utility.warning, padding:10, marginTop:10 }}>
95
+ <Text size={14} color={Colors.shades.white} weight='semibold' textAlign="center">Deposits in posted status are not eligible for withdraw until they settle.</Text>
96
+ </View>
97
+ :<></>}
98
+ </View>
99
+ )
100
+ }
101
+ export default ItemOrderDetails
@@ -8,7 +8,7 @@ import type { AccountProps } from '../../types';
8
8
  type LinkAccountManagerProps = {
9
9
  ibt_placeholer_account:AccountProps,
10
10
  onCancel: () => void
11
- onComplete: (account_id:string) => void
11
+ onComplete: (account:AccountProps) => void
12
12
  }
13
13
 
14
14
  const LinkAccountManager = ({ ibt_placeholer_account, onCancel, onComplete }: LinkAccountManagerProps) => {
@@ -48,7 +48,7 @@ const LinkAccountManager = ({ ibt_placeholer_account, onCancel, onComplete }: Li
48
48
  }, 4000);
49
49
  } else {
50
50
  setTryCounter(0);
51
- onComplete(a.account_id)
51
+ onComplete(a)
52
52
  }
53
53
  }
54
54
 
@@ -64,8 +64,8 @@ const LinkAccountManager = ({ ibt_placeholer_account, onCancel, onComplete }: Li
64
64
  return (
65
65
  <View style={{ flex:1 }}>
66
66
  <View style={{ padding:20 }}>
67
- <Text size={30} color={Colors.brand.midnight} weight='bold'>LINK NEW ACCOUNT</Text>
68
- <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>Link an account via instant bank transfer and get access to instant deposits and withdraws.</Text>
67
+ <Text size={26} color={Colors.brand.midnight} weight='bold'>LINK NEW ACCOUNT</Text>
68
+ <Text style={{ marginTop:10 }} size={16} color={Colors.brand.midnight} weight='regular'>Link an account via instant bank transfer and get access to instant deposits and withdraws.</Text>
69
69
  </View>
70
70
  <View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
71
71
  <Icons.IBTFLowIcon size={350} />
@@ -44,8 +44,8 @@ const ManualACHAdd = ({ player, onAddAccount, onCancel }:ManualACHAddProps) => {
44
44
  return (
45
45
  <View style={{ flex:1 }}>
46
46
  <View style={{ padding:20 }}>
47
- <Text size={30} color={Colors.brand.midnight} weight='bold'>MANUAL ACH ACCOUNT</Text>
48
- <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>Complete the form below to add a new ACH account. Once submitted, we will send 2 small deposits to the account to confirm ownership. This process can take up to 3 business days.</Text>
47
+ <Text size={26} color={Colors.brand.midnight} weight='bold'>MANUAL ACH ACCOUNT</Text>
48
+ <Text style={{ marginTop:10 }} size={16} color={Colors.brand.midnight} weight='regular'>Complete the form below to add a new ACH account. Once submitted, we will send 2 small deposits to the account to confirm ownership. This process can take up to 3 business days.</Text>
49
49
  </View>
50
50
  <View style={{ flex:1, padding:20 }}>
51
51
  <View style={{ marginTop:10 }}>
@@ -66,8 +66,8 @@ const ManualCardAdd = ({ player, onAddAccount, onCancel }:ManualCardAddProps) =>
66
66
  return (
67
67
  <View style={{ flex:1 }}>
68
68
  <View style={{ padding:20 }}>
69
- <Text size={30} color={Colors.brand.midnight} weight='bold'>NEW CARD ACCOUNT</Text>
70
- <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>Complete the form below to add a new card account. Once submitted and approve, you can transact immediately.</Text>
69
+ <Text size={26} color={Colors.brand.midnight} weight='bold'>NEW CARD ACCOUNT</Text>
70
+ <Text style={{ marginTop:10 }} size={16} color={Colors.brand.midnight} weight='regular'>Complete the form below to add a new card account. Once successfully added, you can transact immediately.</Text>
71
71
  </View>
72
72
  <View style={{ flex:1, padding:10, margin:10 }}>
73
73
  <View nativeID='cc_input' style={{ marginTop:10 }}>
@@ -164,8 +164,8 @@ const ManualCardAdd = ({ player, onAddAccount, onCancel }:ManualCardAddProps) =>
164
164
  />
165
165
  <Button
166
166
  title='ADD ACCOUNT'
167
- style={{ flex:3, opacity:valid?1:0.5 }}
168
- disabled={!valid}
167
+ style={{ flex:3, opacity:valid&&!loading?1:0.5 }}
168
+ disabled={!valid||loading}
169
169
  loading={loading}
170
170
  title_color={Colors.shades.white}
171
171
  padding={15}
@@ -15,32 +15,54 @@ type MyBalanceProps = {
15
15
  onNext:() => void
16
16
  }
17
17
 
18
- const MyBalance = ({ player, balance_account, player_balance, walkthrough, onClose, onNext }:MyBalanceProps) => {
19
-
20
- console.log(player, player_balance, balance_account)
18
+ const MyBalance = ({ player_balance, onClose, onNext }:MyBalanceProps) => {
21
19
 
22
20
 
23
21
  return (
24
22
  <View style={{ flex:1 }}>
25
23
  <View style={{ padding:20 }}>
26
- <Text size={30} color={Colors.brand.midnight} weight='bold'>BettorEdge Balance</Text>
27
- <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>All order and game activity goes in and out of your BettorEdge balance.</Text>
24
+ <Text size={26} color={Colors.brand.midnight} weight='bold'>BETTOREDGE BALANCES</Text>
25
+ <Text style={{ marginTop:10 }} size={16} color={Colors.brand.midnight} weight='regular'>All order and competition activity goes in and out of your BettorEdge balances. The specific balance depends on which app-mode you are in.</Text>
28
26
  </View>
29
- <View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
30
- <View>
31
- <Text size={14} color={Colors.brand.midnight}>Your BettorEdge balance is made up of 3 currencies</Text>
32
- </View>
33
- <View>
34
- <Text>REAL MONEY (USD)</Text>
27
+ <View style={{ flex:1, padding:10 }}>
28
+ <View style={{ padding:10, paddingBottom:0 }}>
29
+ <Text size={18} color={Colors.brand.midnight} weight='bold' textAlign='left'>APP MODES</Text>
35
30
  </View>
36
- <View>
37
- <Text>PROMO</Text>
31
+ <View style={{ backgroundColor:Colors.brand.cobalt, padding:10, borderRadius:8, margin:10 }}>
32
+ <View style={{ padding:5, flexDirection:'row', alignItems:'center' }}>
33
+ <Text style={{ flex:1 }} size={26} color={Colors.shades.white} weight='semibold'>Real-Money Mode</Text>
34
+ <Icons.USDIcon size={30} color={Colors.shades.white} />
35
+ </View>
36
+ <View style={{ padding:5, paddingBottom:10, borderBottomWidth:1, borderBottomColor:Colors.accents.accent200 }}>
37
+ <Text size={14} weight='regular' color={Colors.shades.shade100}>When in real-money mode. The app header will show as this dark blue color. All activity when in this mode will use your real-money (USD) balance.</Text>
38
+ </View>
39
+ <View style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
40
+ <Text style={{ flex:1 }} size={14} color={Colors.shades.white}>Real-Money / USD ($)</Text>
41
+ <Text size={16} weight='bold' color={Colors.shades.white}>${player_balance.balance.toFixed(2)}</Text>
42
+ </View>
43
+ <View style={{ padding:10 }}>
44
+ <View style={{ flexDirection:'row', alignItems:'center' }}>
45
+ <Text style={{ flex:1 }} size={14} color={Colors.shades.white}>Promo (P)</Text>
46
+ <Text size={16} weight='bold' color={Colors.shades.white}>P{player_balance.promo_balance.toFixed(2)}</Text>
47
+ </View>
48
+ <Text style={{ marginTop:3 }} size={12} color={Colors.utility.warning} weight='semibold'>Promo balance can be used for all real-money activities. Winnings will be returned as Real-Money/USD ($).</Text>
49
+ </View>
38
50
  </View>
39
- <View>
40
- <Text>EDGE COINS</Text>
51
+
52
+ <View style={{ backgroundColor:Colors.brand.cyan, padding:10, borderRadius:8, margin:10 }}>
53
+ <View style={{ padding:5, flexDirection:'row', alignItems:'center' }}>
54
+ <Text style={{ flex:1 }} size={26} color={Colors.shades.white} weight='semibold'>Demo Mode</Text>
55
+ <Icons.EdgeCoinIcon size={30} color={Colors.shades.white} />
56
+ </View>
57
+ <View style={{ padding:5, paddingBottom:10, borderBottomWidth:1, borderBottomColor:Colors.accents.accent100 }}>
58
+ <Text size={14} weight='regular' color={Colors.shades.shade100}>When in demo mode. The app header will show as this light blue color. All activity when in this mode will use your Edge Coin (E) balance.</Text>
59
+ </View>
60
+ <View style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
61
+ <Text style={{ flex:1 }} size={14} color={Colors.shades.white}>Edge Coins (E)</Text>
62
+ <Text size={16} weight='bold' color={Colors.shades.white}>E{player_balance.free_market_balance.toFixed(2)}</Text>
63
+ </View>
41
64
  </View>
42
65
  </View>
43
- {walkthrough ?
44
66
  <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
45
67
  <Button
46
68
  title='EXIT SETUP'
@@ -56,7 +78,6 @@ const MyBalance = ({ player, balance_account, player_balance, walkthrough, onClo
56
78
  <Icons.ChevronIcon size={20} direction='right' color={Colors.brand.midnight}/>
57
79
  </TouchableOpacity>
58
80
  </View>
59
- :<></>}
60
81
  </View>
61
82
  )
62
83
  }
@@ -0,0 +1,99 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { FlatList, View, ActivityIndicator } from 'react-native';
3
+ import { ItemOrderApi } from '../api';
4
+ import type { ItemOrderProps, ItemProps } from '../../types';
5
+ import ItemOrderCard from './ItemOrderCard';
6
+ import { Button, Text } from '../../Components';
7
+ import Colors from '../../constants/colors';
8
+
9
+ type OrderManagerProps = {
10
+ onClose: () => void
11
+ }
12
+
13
+ const OrderManager = ({ onClose }:OrderManagerProps) => {
14
+ const [ loading, setLoading ] = useState(false);
15
+ const [ data, setData ] = useState<{
16
+ offset: number,
17
+ items:ItemProps[],
18
+ item_orders:ItemOrderProps[]
19
+ }>({
20
+ offset:0,
21
+ items:[],
22
+ item_orders:[]
23
+ })
24
+
25
+ const { item_orders, offset } = data;
26
+
27
+ useEffect(() => {
28
+ getDataFromServer(0)
29
+ },[])
30
+
31
+ const getDataFromServer = async(offset:number) => {
32
+ setLoading(true);
33
+ console.log(offset)
34
+ const my_orders = await ItemOrderApi.getMyItemOrders(offset);
35
+ setData({
36
+ items:my_orders.items,
37
+ item_orders: my_orders.item_orders,
38
+ offset
39
+ })
40
+ setLoading(false)
41
+ }
42
+
43
+ const renderItemOrders = (data: { item:ItemOrderProps, index:number }) => {
44
+ return (
45
+ <ItemOrderCard
46
+ item_order={data.item}
47
+ />
48
+ )
49
+ }
50
+
51
+
52
+ return (
53
+ <View style={{ flex:1 }}>
54
+ <View style={{ padding:20 }}>
55
+ <Text size={26} color={Colors.brand.midnight} weight='bold'>ORDER HISTORY</Text>
56
+ <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>
57
+ </View>
58
+ <View style={{ flex:1, padding:10 }}>
59
+ {loading ?
60
+ <ActivityIndicator size='large' color={Colors.brand.midnight} />
61
+ :<></>}
62
+ <FlatList
63
+ data={item_orders}
64
+ renderItem={renderItemOrders}
65
+ keyExtractor={(item) => item.item_order_id.toString()}
66
+ />
67
+ </View>
68
+ <View style={{ flexDirection:'row', alignItems:'center', padding:20, paddingBottom:0 }}>
69
+ <Button
70
+ style={{ opacity: offset > 0 ? 1 : 0.5 }}
71
+ title='PREV'
72
+ disabled={offset == 0 ? true : false}
73
+ title_color={Colors.brand.electric}
74
+ backgroundColor='transparent'
75
+ onPress={() => getDataFromServer(offset - 1)}
76
+ />
77
+ <View style={{ flex:1 }} />
78
+ <Button
79
+ title='NEXT'
80
+ title_color={Colors.brand.electric}
81
+ backgroundColor='transparent'
82
+ onPress={() => getDataFromServer(offset + 1)}
83
+ />
84
+ </View>
85
+ <View style={{ padding:20 }}>
86
+ <Button
87
+ title='BACK'
88
+ title_color={Colors.brand.electric}
89
+ borderWidth={1}
90
+ borderColor={Colors.brand.electric}
91
+ padding={15}
92
+ onPress={() => onClose()}
93
+ />
94
+ </View>
95
+ </View>
96
+ )
97
+ }
98
+
99
+ export default OrderManager
@@ -56,8 +56,8 @@ const VerifyACHAccount = ({ account, onClose, onUpdateAccount }:VerifyACHWidgetP
56
56
  return (
57
57
  <View style={{ flex:1 }}>
58
58
  <View style={{ padding:20 }}>
59
- <Text size={30} color={Colors.brand.midnight} weight='bold'>VERIFY ACCOUNT</Text>
60
- <Text style={{ marginTop:15 }} size={16} color={Colors.brand.midnight} weight='regular'>Verify this account by entering the two deposit amounts received from Bettoredge when setting up the account.</Text>
59
+ <Text size={26} color={Colors.brand.midnight} weight='bold'>VERIFY ACCOUNT</Text>
60
+ <Text style={{ marginTop:10 }} size={16} color={Colors.brand.midnight} weight='regular'>Verify this account by entering the two deposit amounts received from Bettoredge when setting up the account.</Text>
61
61
  </View>
62
62
  <View nativeID='verify_inputs' style={{ flex:1, margin:20 }}>
63
63
  <View style={{marginTop:30}}>