be-components 3.6.1 → 3.6.2

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 (172) hide show
  1. package/lib/commonjs/Checkout/components/AccountSummaryCard.js +52 -57
  2. package/lib/commonjs/Checkout/components/AccountSummaryCard.js.map +1 -1
  3. package/lib/commonjs/Checkout/components/ItemSummaryCard.js +8 -11
  4. package/lib/commonjs/Checkout/components/ItemSummaryCard.js.map +1 -1
  5. package/lib/commonjs/Checkout/components/OrderSummaryCard.js +21 -25
  6. package/lib/commonjs/Checkout/components/OrderSummaryCard.js.map +1 -1
  7. package/lib/commonjs/Checkout/components/PayPalHtml.js +32 -0
  8. package/lib/commonjs/Checkout/components/PayPalHtml.js.map +1 -0
  9. package/lib/commonjs/Checkout/components/PayPalWebview.js +125 -0
  10. package/lib/commonjs/Checkout/components/PayPalWebview.js.map +1 -0
  11. package/lib/commonjs/Checkout/components/ShippingSummaryCard.js +11 -15
  12. package/lib/commonjs/Checkout/components/ShippingSummaryCard.js.map +1 -1
  13. package/lib/commonjs/Checkout/index.js +92 -146
  14. package/lib/commonjs/Checkout/index.js.map +1 -1
  15. package/lib/commonjs/Components/Checkbox.js +7 -5
  16. package/lib/commonjs/Components/Checkbox.js.map +1 -1
  17. package/lib/commonjs/Components/Icons.js +9 -9
  18. package/lib/commonjs/Components/Icons.js.map +1 -1
  19. package/lib/commonjs/Wallet/components/ACHAddCard.js +233 -194
  20. package/lib/commonjs/Wallet/components/ACHAddCard.js.map +1 -1
  21. package/lib/commonjs/Wallet/components/AddressCard.js +19 -17
  22. package/lib/commonjs/Wallet/components/AddressCard.js.map +1 -1
  23. package/lib/commonjs/Wallet/components/AddressManager.js +64 -92
  24. package/lib/commonjs/Wallet/components/AddressManager.js.map +1 -1
  25. package/lib/commonjs/Wallet/components/FundAccountCard.js +106 -95
  26. package/lib/commonjs/Wallet/components/FundAccountCard.js.map +1 -1
  27. package/lib/commonjs/Wallet/components/LinkAccountManager.js +80 -106
  28. package/lib/commonjs/Wallet/components/LinkAccountManager.js.map +1 -1
  29. package/lib/commonjs/Wallet/components/ManualACHAdd.js +155 -151
  30. package/lib/commonjs/Wallet/components/ManualACHAdd.js.map +1 -1
  31. package/lib/commonjs/Wallet/components/ManualCardAdd.js +207 -204
  32. package/lib/commonjs/Wallet/components/ManualCardAdd.js.map +1 -1
  33. package/lib/commonjs/Wallet/components/MyBalance.js +73 -66
  34. package/lib/commonjs/Wallet/components/MyBalance.js.map +1 -1
  35. package/lib/commonjs/Wallet/components/WalletSetup.js +286 -246
  36. package/lib/commonjs/Wallet/components/WalletSetup.js.map +1 -1
  37. package/lib/commonjs/Wallet/index.js +1 -0
  38. package/lib/commonjs/Wallet/index.js.map +1 -1
  39. package/lib/module/Checkout/components/AccountSummaryCard.js +25 -30
  40. package/lib/module/Checkout/components/AccountSummaryCard.js.map +1 -1
  41. package/lib/module/Checkout/components/ItemSummaryCard.js +4 -7
  42. package/lib/module/Checkout/components/ItemSummaryCard.js.map +1 -1
  43. package/lib/module/Checkout/components/OrderSummaryCard.js +9 -13
  44. package/lib/module/Checkout/components/OrderSummaryCard.js.map +1 -1
  45. package/lib/module/Checkout/components/PayPalHtml.js +25 -0
  46. package/lib/module/Checkout/components/PayPalHtml.js.map +1 -0
  47. package/lib/module/Checkout/components/PayPalWebview.js +118 -0
  48. package/lib/module/Checkout/components/PayPalWebview.js.map +1 -0
  49. package/lib/module/Checkout/components/ShippingSummaryCard.js +5 -9
  50. package/lib/module/Checkout/components/ShippingSummaryCard.js.map +1 -1
  51. package/lib/module/Checkout/index.js +58 -112
  52. package/lib/module/Checkout/index.js.map +1 -1
  53. package/lib/module/Components/Checkbox.js +6 -4
  54. package/lib/module/Components/Checkbox.js.map +1 -1
  55. package/lib/module/Components/Icons.js +10 -10
  56. package/lib/module/Components/Icons.js.map +1 -1
  57. package/lib/module/Wallet/components/ACHAddCard.js +233 -194
  58. package/lib/module/Wallet/components/ACHAddCard.js.map +1 -1
  59. package/lib/module/Wallet/components/AddressCard.js +14 -12
  60. package/lib/module/Wallet/components/AddressCard.js.map +1 -1
  61. package/lib/module/Wallet/components/AddressManager.js +29 -57
  62. package/lib/module/Wallet/components/AddressManager.js.map +1 -1
  63. package/lib/module/Wallet/components/FundAccountCard.js +71 -60
  64. package/lib/module/Wallet/components/FundAccountCard.js.map +1 -1
  65. package/lib/module/Wallet/components/LinkAccountManager.js +55 -81
  66. package/lib/module/Wallet/components/LinkAccountManager.js.map +1 -1
  67. package/lib/module/Wallet/components/ManualACHAdd.js +146 -141
  68. package/lib/module/Wallet/components/ManualACHAdd.js.map +1 -1
  69. package/lib/module/Wallet/components/ManualCardAdd.js +204 -201
  70. package/lib/module/Wallet/components/ManualCardAdd.js.map +1 -1
  71. package/lib/module/Wallet/components/MyBalance.js +45 -38
  72. package/lib/module/Wallet/components/MyBalance.js.map +1 -1
  73. package/lib/module/Wallet/components/WalletSetup.js +287 -247
  74. package/lib/module/Wallet/components/WalletSetup.js.map +1 -1
  75. package/lib/module/Wallet/index.js +1 -0
  76. package/lib/module/Wallet/index.js.map +1 -1
  77. package/lib/typescript/lib/commonjs/Checkout/components/AccountSummaryCard.d.ts.map +1 -1
  78. package/lib/typescript/lib/commonjs/Checkout/components/ItemSummaryCard.d.ts.map +1 -1
  79. package/lib/typescript/lib/commonjs/Checkout/components/OrderSummaryCard.d.ts.map +1 -1
  80. package/lib/typescript/lib/commonjs/Checkout/components/PayPalHtml.d.ts +3 -0
  81. package/lib/typescript/lib/commonjs/Checkout/components/PayPalHtml.d.ts.map +1 -0
  82. package/lib/typescript/lib/commonjs/Checkout/components/PayPalWebview.d.ts +4 -0
  83. package/lib/typescript/lib/commonjs/Checkout/components/PayPalWebview.d.ts.map +1 -0
  84. package/lib/typescript/lib/commonjs/Checkout/components/ShippingSummaryCard.d.ts.map +1 -1
  85. package/lib/typescript/lib/commonjs/Checkout/index.d.ts.map +1 -1
  86. package/lib/typescript/lib/commonjs/Components/Checkbox.d.ts.map +1 -1
  87. package/lib/typescript/lib/commonjs/Wallet/components/ACHAddCard.d.ts.map +1 -1
  88. package/lib/typescript/lib/commonjs/Wallet/components/AddressCard.d.ts.map +1 -1
  89. package/lib/typescript/lib/commonjs/Wallet/components/AddressManager.d.ts.map +1 -1
  90. package/lib/typescript/lib/commonjs/Wallet/components/FundAccountCard.d.ts.map +1 -1
  91. package/lib/typescript/lib/commonjs/Wallet/components/LinkAccountManager.d.ts.map +1 -1
  92. package/lib/typescript/lib/commonjs/Wallet/components/ManualACHAdd.d.ts.map +1 -1
  93. package/lib/typescript/lib/commonjs/Wallet/components/ManualCardAdd.d.ts.map +1 -1
  94. package/lib/typescript/lib/commonjs/Wallet/components/MyBalance.d.ts.map +1 -1
  95. package/lib/typescript/lib/commonjs/Wallet/components/WalletSetup.d.ts.map +1 -1
  96. package/lib/typescript/lib/commonjs/Wallet/index.d.ts.map +1 -1
  97. package/lib/typescript/lib/module/Checkout/components/AccountSummaryCard.d.ts +1 -2
  98. package/lib/typescript/lib/module/Checkout/components/AccountSummaryCard.d.ts.map +1 -1
  99. package/lib/typescript/lib/module/Checkout/components/ItemSummaryCard.d.ts +1 -2
  100. package/lib/typescript/lib/module/Checkout/components/ItemSummaryCard.d.ts.map +1 -1
  101. package/lib/typescript/lib/module/Checkout/components/OrderSummaryCard.d.ts +1 -2
  102. package/lib/typescript/lib/module/Checkout/components/OrderSummaryCard.d.ts.map +1 -1
  103. package/lib/typescript/lib/module/Checkout/components/PayPalHtml.d.ts +2 -0
  104. package/lib/typescript/lib/module/Checkout/components/PayPalHtml.d.ts.map +1 -0
  105. package/lib/typescript/lib/module/Checkout/components/PayPalWebview.d.ts +5 -0
  106. package/lib/typescript/lib/module/Checkout/components/PayPalWebview.d.ts.map +1 -0
  107. package/lib/typescript/lib/module/Checkout/components/ShippingSummaryCard.d.ts +1 -2
  108. package/lib/typescript/lib/module/Checkout/components/ShippingSummaryCard.d.ts.map +1 -1
  109. package/lib/typescript/lib/module/Checkout/index.d.ts +1 -2
  110. package/lib/typescript/lib/module/Checkout/index.d.ts.map +1 -1
  111. package/lib/typescript/lib/module/Components/Checkbox.d.ts +1 -2
  112. package/lib/typescript/lib/module/Components/Checkbox.d.ts.map +1 -1
  113. package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
  114. package/lib/typescript/lib/module/Wallet/components/ACHAddCard.d.ts +1 -2
  115. package/lib/typescript/lib/module/Wallet/components/ACHAddCard.d.ts.map +1 -1
  116. package/lib/typescript/lib/module/Wallet/components/AddressCard.d.ts +1 -2
  117. package/lib/typescript/lib/module/Wallet/components/AddressCard.d.ts.map +1 -1
  118. package/lib/typescript/lib/module/Wallet/components/AddressManager.d.ts +1 -2
  119. package/lib/typescript/lib/module/Wallet/components/AddressManager.d.ts.map +1 -1
  120. package/lib/typescript/lib/module/Wallet/components/FundAccountCard.d.ts +1 -2
  121. package/lib/typescript/lib/module/Wallet/components/FundAccountCard.d.ts.map +1 -1
  122. package/lib/typescript/lib/module/Wallet/components/LinkAccountManager.d.ts +1 -2
  123. package/lib/typescript/lib/module/Wallet/components/LinkAccountManager.d.ts.map +1 -1
  124. package/lib/typescript/lib/module/Wallet/components/ManualACHAdd.d.ts +1 -2
  125. package/lib/typescript/lib/module/Wallet/components/ManualACHAdd.d.ts.map +1 -1
  126. package/lib/typescript/lib/module/Wallet/components/ManualCardAdd.d.ts +1 -2
  127. package/lib/typescript/lib/module/Wallet/components/ManualCardAdd.d.ts.map +1 -1
  128. package/lib/typescript/lib/module/Wallet/components/MyBalance.d.ts +1 -2
  129. package/lib/typescript/lib/module/Wallet/components/MyBalance.d.ts.map +1 -1
  130. package/lib/typescript/lib/module/Wallet/components/WalletSetup.d.ts +1 -2
  131. package/lib/typescript/lib/module/Wallet/components/WalletSetup.d.ts.map +1 -1
  132. package/lib/typescript/lib/module/Wallet/index.d.ts.map +1 -1
  133. package/lib/typescript/src/Checkout/components/AccountSummaryCard.d.ts.map +1 -1
  134. package/lib/typescript/src/Checkout/components/ItemSummaryCard.d.ts.map +1 -1
  135. package/lib/typescript/src/Checkout/components/OrderSummaryCard.d.ts.map +1 -1
  136. package/lib/typescript/src/Checkout/components/PayPalHtml.d.ts +2 -0
  137. package/lib/typescript/src/Checkout/components/PayPalHtml.d.ts.map +1 -0
  138. package/lib/typescript/src/Checkout/components/PayPalWebview.d.ts +4 -0
  139. package/lib/typescript/src/Checkout/components/PayPalWebview.d.ts.map +1 -0
  140. package/lib/typescript/src/Checkout/components/ShippingSummaryCard.d.ts.map +1 -1
  141. package/lib/typescript/src/Checkout/index.d.ts.map +1 -1
  142. package/lib/typescript/src/Components/Checkbox.d.ts.map +1 -1
  143. package/lib/typescript/src/Wallet/components/ACHAddCard.d.ts.map +1 -1
  144. package/lib/typescript/src/Wallet/components/AddressCard.d.ts.map +1 -1
  145. package/lib/typescript/src/Wallet/components/AddressManager.d.ts.map +1 -1
  146. package/lib/typescript/src/Wallet/components/FundAccountCard.d.ts.map +1 -1
  147. package/lib/typescript/src/Wallet/components/LinkAccountManager.d.ts.map +1 -1
  148. package/lib/typescript/src/Wallet/components/ManualACHAdd.d.ts.map +1 -1
  149. package/lib/typescript/src/Wallet/components/ManualCardAdd.d.ts.map +1 -1
  150. package/lib/typescript/src/Wallet/components/MyBalance.d.ts.map +1 -1
  151. package/lib/typescript/src/Wallet/components/WalletSetup.d.ts.map +1 -1
  152. package/package.json +2 -1
  153. package/src/Checkout/components/AccountSummaryCard.tsx +25 -27
  154. package/src/Checkout/components/ItemSummaryCard.tsx +4 -6
  155. package/src/Checkout/components/OrderSummaryCard.tsx +9 -11
  156. package/src/Checkout/components/PayPalHtml.ts +26 -0
  157. package/src/Checkout/components/PayPalOrderCapture.tsx +1 -1
  158. package/src/Checkout/components/PayPalWebview.tsx +118 -0
  159. package/src/Checkout/components/ShippingSummaryCard.tsx +5 -8
  160. package/src/Checkout/index.tsx +68 -96
  161. package/src/Components/Checkbox.tsx +7 -6
  162. package/src/Components/Icons.tsx +10 -10
  163. package/src/Wallet/components/ACHAddCard.tsx +90 -60
  164. package/src/Wallet/components/AddressCard.tsx +11 -11
  165. package/src/Wallet/components/AddressManager.tsx +33 -44
  166. package/src/Wallet/components/FundAccountCard.tsx +52 -51
  167. package/src/Wallet/components/LinkAccountManager.tsx +49 -59
  168. package/src/Wallet/components/ManualACHAdd.tsx +99 -79
  169. package/src/Wallet/components/ManualCardAdd.tsx +119 -95
  170. package/src/Wallet/components/MyBalance.tsx +38 -40
  171. package/src/Wallet/components/WalletSetup.tsx +138 -113
  172. package/src/Wallet/index.tsx +7 -7
@@ -1,18 +1,20 @@
1
1
  import React, { useState } from 'react';
2
- import { View, StyleSheet, ScrollView } from "react-native";
3
2
  import { WalletApi, WalletHelpers } from '../api';
4
- import { Button, Icons, Text, TextInput } from '../../Components';
5
- import Colors from '../../constants/colors';
3
+ import { Icons } from '../../Components';
6
4
  import type { AccountProps, MyPlayerProps } from '../../types';
7
5
  import moment from 'moment-mini';
6
+ import { Button, Text, TextInput, View } from '../../Components/Themed';
7
+ import { useColors } from '../../constants/useColors';
8
+ import { FlatList } from 'react-native';
8
9
 
9
10
  type ManualCardAddProps = {
10
11
  player:MyPlayerProps,
11
12
  onAddAccount:(acct:AccountProps) => void,
12
13
  onCancel:() => void
13
14
  }
14
-
15
+ const card_sections = ['header','card_number','first_name','last_name','expire_date']
15
16
  const ManualCardAdd = ({ player, onAddAccount, onCancel }:ManualCardAddProps) => {
17
+ const Colors = useColors();
16
18
  const [ loading, setLoading ] = useState(false);
17
19
  const [ error, setError ] = useState<string>();
18
20
  const [ card_account, setCardAccount ] = useState({
@@ -20,7 +22,6 @@ const ManualCardAdd = ({ player, onAddAccount, onCancel }:ManualCardAddProps) =>
20
22
  card_detail: { ...WalletHelpers.getEmptyCardDetails(), first_name: player.first_name, last_name: player.last_name }
21
23
  })
22
24
 
23
-
24
25
  const { account, card_detail } = card_account;
25
26
  const { valid, card_number, first_name, last_name, expiration_date } = WalletHelpers.isCardValid(card_detail);
26
27
 
@@ -58,107 +59,135 @@ const ManualCardAdd = ({ player, onAddAccount, onCancel }:ManualCardAddProps) =>
58
59
  case 'DISCOVER':
59
60
  return <Icons.DiscoverCardIcon size={30} />
60
61
  default:
61
- return <Icons.CreditCardIcon size={22} color={Colors.brand.midnight}/>
62
+ return <Icons.CreditCardIcon size={22} color={Colors.text.h1}/>
62
63
  }
63
64
  }
64
65
 
65
- return (
66
- <View style={{ flex:1 }}>
67
- <View style={{ padding:20 }}>
68
- <Text size={26} color={Colors.brand.midnight} weight='bold'>NEW CARD ACCOUNT</Text>
69
- <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>
70
- </View>
71
- <ScrollView style={{ flex:1, padding:10, margin:10 }}>
72
- <View nativeID='cc_input' style={{ marginTop:10 }}>
73
- <View nativeID='card_number' style={{ padding:5 }}>
74
- <View style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
75
- <Text style={{flex:1}} size={14} color={Colors.brand.midnight} weight='semibold'>Card Number</Text>
76
- <View style={{ flexDirection:'row', alignItems:'center' }}>
77
- <View style={local_styles.inactive_brand}>
78
- <Icons.CreditCardIcon size={24} color={Colors.brand.midnight}/>
79
- </View>
80
- <View style={card_detail.card_brand == 'VISA' ? local_styles.active_brand : local_styles.inactive_brand}>
81
- <Icons.VisaCardIcon size={30} />
82
- </View>
83
- <View style={card_detail.card_brand == 'MASTERCARD' ? local_styles.active_brand : local_styles.inactive_brand}>
84
- <Icons.MasterCardIcon size={30} />
66
+ const renderSections = (data:{item:string, index:number}) => {
67
+ switch(data.item){
68
+ case 'header':
69
+ return (
70
+ <View type='header' style={{ padding:20 }}>
71
+ <Text theme='h1'>NEW CARD ACCOUNT</Text>
72
+ <Text style={{ marginTop:5 }} theme='description'>Complete the form below to add a new card account. Once successfully added, you can transact immediately.</Text>
73
+ </View>
74
+ )
75
+ case 'card_number':
76
+ return (
77
+ <View style={{padding:10}}>
78
+ <View nativeID='card_number' style={{ padding:5 }}>
79
+ <View style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
80
+ <Text style={{flex:1}} size={14} theme='h2'>Card Number</Text>
81
+ <View style={{ flexDirection:'row', alignItems:'center' }}>
82
+ <View>
83
+ <Icons.CreditCardIcon size={24} color={Colors.text.h1}/>
84
+ </View>
85
+ <View style={card_detail.card_brand == 'VISA' ? {} : {}}>
86
+ <Icons.VisaCardIcon size={30} />
87
+ </View>
88
+ <View style={card_detail.card_brand == 'MASTERCARD' ? {} : {}}>
89
+ <Icons.MasterCardIcon size={30} />
90
+ </View>
91
+ <View style={card_detail.card_brand == 'AMEX' ? {} : {}}>
92
+ <Icons.AmexCardIcon size={30} />
93
+ </View>
94
+ <View style={card_detail.card_brand == 'DISCOVER' ? {} : {}}>
95
+ <Icons.DiscoverCardIcon size={30} />
96
+ </View>
97
+
85
98
  </View>
86
- <View style={card_detail.card_brand == 'AMEX' ? local_styles.active_brand : local_styles.inactive_brand}>
87
- <Icons.AmexCardIcon size={30} />
99
+ </View>
100
+ <View type='input' style={{ flexDirection:'row' }}>
101
+ <View style={{ justifyContent:'center', alignItems:'center', paddingLeft:10, paddingRight:10 }}>
102
+ {renderCardIcon(card_detail.card_brand)}
88
103
  </View>
89
- <View style={card_detail.card_brand == 'DISCOVER' ? local_styles.active_brand : local_styles.inactive_brand}>
90
- <Icons.DiscoverCardIcon size={30} />
104
+ <TextInput
105
+ style={{ borderWidth:0, padding:15, flex:1 }}
106
+ placeholder='1234 5678 9876 5432'
107
+ keyboardType='decimal-pad'
108
+ value={WalletHelpers.formatCardNumber(card_detail.card_number)}
109
+ onChangeText={(e) => handleCardNumber(e)}
110
+ />
91
111
  </View>
92
-
93
- </View>
94
- </View>
95
- <View style={{ flexDirection:'row', borderRadius:22, backgroundColor:Colors.shades.white }}>
96
- <View style={{ justifyContent:'center', alignItems:'center', paddingLeft:10, paddingRight:10 }}>
97
- {renderCardIcon(card_detail.card_brand)}
98
112
  </View>
99
- <TextInput
100
- style={{ borderWidth:0, padding:15, flex:1 }}
101
- placeholder='1234 5678 9876 5432'
102
- placeholderTextColor={Colors.shades.shade600}
103
- value={WalletHelpers.formatCardNumber(card_detail.card_number)}
104
- onChangeText={(e) => handleCardNumber(e)}
105
- />
113
+ {card_detail.card_number && !card_number ?
114
+ <Text size={14} color={Colors.text.warning} weight='semibold'>Card number is not valid</Text>
115
+ :<></>}
116
+ </View>
117
+
118
+ )
119
+ case 'first_name':
120
+ return (
121
+ <View style={{padding:10}}>
122
+ <View nativeID='first_name' style={{ padding:5 }}>
123
+ <Text style={{ padding:10 }} size={14} theme='h2'>First Name</Text>
124
+ <TextInput
125
+ placeholder='Jonathan'
126
+ value={card_detail.first_name}
127
+ onChangeText={(e) => setCardAccount({ ...card_account, card_detail: { ...card_detail, first_name: e } })}
128
+ />
106
129
  </View>
130
+ {!first_name ?
131
+ <Text size={14} color={Colors.text.warning} weight='semibold'>First name is not valid</Text>
132
+ :<></>}
107
133
  </View>
108
- {card_detail.card_number && !card_number ?
109
- <Text size={14} color={Colors.utility.warning} weight='semibold'>Card number is not valid</Text>
110
- :<></>}
111
- <View nativeID='first_name' style={{ padding:5 }}>
112
- <Text style={{ padding:10 }} size={14} color={Colors.brand.midnight} weight='semibold'>First Name</Text>
134
+ )
135
+ case 'last_name':
136
+ return (
137
+ <View style={{padding:10}}>
138
+ <View nativeID='last_name' style={{ padding:5 }}>
139
+ <Text size={14} theme='h2' style={{ padding:10 }}>Last Name</Text>
113
140
  <TextInput
114
- placeholder='Jonathan'
115
- placeholderTextColor={Colors.shades.shade600}
116
- value={card_detail.first_name}
117
- onChangeText={(e) => setCardAccount({ ...card_account, card_detail: { ...card_detail, first_name: e } })}
141
+ placeholder='Smith'
142
+ value={card_detail.last_name}
143
+ onChangeText={(e) => setCardAccount({ ...card_account, card_detail: { ...card_detail, last_name: e } })}
118
144
  />
145
+ </View>
146
+ {!last_name ?
147
+ <Text size={14} color={Colors.text.warning} weight='semibold'>Last name is not valid</Text>
148
+ :<></>}
119
149
  </View>
120
- {!first_name ?
121
- <Text size={14} color={Colors.utility.warning} weight='semibold'>First name is not valid</Text>
122
- :<></>}
123
- <View nativeID='last_name' style={{ padding:5 }}>
124
- <Text size={14} color={Colors.brand.midnight} weight='semibold' style={{ padding:10 }}>Last Name</Text>
125
- <TextInput
126
- placeholder='Smith'
127
- placeholderTextColor={Colors.shades.shade600}
128
- value={card_detail.last_name}
129
- onChangeText={(e) => setCardAccount({ ...card_account, card_detail: { ...card_detail, last_name: e } })}
130
- />
131
- </View>
132
- {!last_name ?
133
- <Text size={14} color={Colors.utility.warning} weight='semibold'>Last name is not valid</Text>
134
- :<></>}
135
- <View nativeID='expiration_date' style={{ padding:5 }}>
136
- <Text size={14} color={Colors.brand.midnight} weight='semibold' style={{ padding:10 }}>Expiration Date (MM/YYYY)</Text>
137
- <TextInput
138
- value={card_detail.expiration_date}
139
- placeholder={'MM/YYYY'}
140
- placeholderTextColor={Colors.shades.shade600}
141
- onChangeText={(e) => handleExpiry(e)}
142
- />
150
+ )
151
+ case 'expire_date':
152
+ return (
153
+ <View style={{padding:10, paddingBottom:300}}>
154
+ <View nativeID='expiration_date' style={{ padding:5 }}>
155
+ <Text size={14} theme='h2' style={{ padding:10 }}>Expiration Date (MM/YYYY)</Text>
156
+ <TextInput
157
+ value={card_detail.expiration_date}
158
+ placeholder={'MM/YYYY'}
159
+ onChangeText={(e) => handleExpiry(e)}
160
+ />
161
+ </View>
162
+ {card_detail.expiration_date && !expiration_date ?
163
+ <Text size={14} color={Colors.text.warning} weight='semibold'>Expiration date is not valid</Text>
164
+ :<></>}
165
+ {error ?
166
+ <View style={{ padding:10 }}>
167
+ <Text size={16} color={Colors.text.warning} weight='bold' textAlign='center'>{error}</Text>
168
+ </View>
169
+ :<></>}
143
170
  </View>
144
- {card_detail.expiration_date && !expiration_date ?
145
- <Text size={14} color={Colors.utility.warning} weight='semibold'>Expiration date is not valid</Text>
146
- :<></>}
147
- </View>
148
- </ScrollView>
149
- {error ?
150
- <View style={{ padding:10 }}>
151
- <Text size={16} color={Colors.utility.warning} weight='bold' textAlign='center'>{error}</Text>
171
+ )
172
+ default: return <></>
173
+ }
174
+ }
175
+
176
+ return (
177
+ <View style={{ flex:1 }}>
178
+ <View style={{ flex:1 }}>
179
+ <FlatList
180
+ data={card_sections}
181
+ key={'card_sections'}
182
+ keyExtractor={(item) => item}
183
+ renderItem={renderSections}
184
+ />
152
185
  </View>
153
- :<></>}
154
186
  <View style={{ flexDirection:'row', padding:20 }}>
155
187
  <Button
156
188
  title='CANCEL'
157
189
  style={{ flex:1, marginRight:5 }}
158
- title_color={Colors.brand.electric}
159
- padding={15}
160
- borderWidth={1}
161
- borderColor={Colors.brand.electric}
190
+ type='error'
162
191
  onPress={() => onCancel()}
163
192
  />
164
193
  <Button
@@ -166,9 +195,7 @@ const ManualCardAdd = ({ player, onAddAccount, onCancel }:ManualCardAddProps) =>
166
195
  style={{ flex:3, opacity:valid&&!loading?1:0.5 }}
167
196
  disabled={!valid||loading}
168
197
  loading={loading}
169
- title_color={Colors.shades.white}
170
- padding={15}
171
- backgroundColor={Colors.utility.success}
198
+ type='success'
172
199
  onPress={() => handleSaveCard()}
173
200
  />
174
201
  </View>
@@ -176,9 +203,6 @@ const ManualCardAdd = ({ player, onAddAccount, onCancel }:ManualCardAddProps) =>
176
203
  )
177
204
  }
178
205
 
179
- const local_styles = StyleSheet.create({
180
- active_brand: { borderRadius:4, padding:3, borderWidth:2, borderColor:Colors.brand.midnight },
181
- inactive_brand: { padding:3, borderWidth:2, borderColor:'transparent' }
182
- })
206
+
183
207
 
184
208
  export default ManualCardAdd
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
- import { View, TouchableOpacity, ScrollView } from "react-native"
3
2
  import type { AccountProps, MyPlayerProps, PlayerBalanceProps } from '../../types';
4
- import { Button, Icons, Text } from '../../Components';
5
- import Colors from '../../constants/colors';
6
- import { button_styles } from '../../constants/styles';
3
+ import { Icons } from '../../Components';
4
+ import { useColors } from '../../constants/useColors';
5
+ import { Button, Text, View } from '../../Components/Themed';
7
6
 
8
7
  type MyBalanceProps = {
9
8
  player:MyPlayerProps,
@@ -15,67 +14,66 @@ type MyBalanceProps = {
15
14
  }
16
15
 
17
16
  const MyBalance = ({ player_balance, onClose, onNext }:MyBalanceProps) => {
18
-
17
+ const Colors = useColors();
19
18
 
20
19
  return (
21
20
  <View style={{ flex:1 }}>
22
21
  <View style={{ padding:20 }}>
23
- <Text size={26} color={Colors.brand.midnight} weight='bold'>BETTOREDGE BALANCES</Text>
24
- <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>
22
+ <Text size={26} theme='h1'>BETTOREDGE BALANCES</Text>
23
+ <Text style={{ marginTop:10 }} size={16} theme='description'>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>
25
24
  </View>
26
- <ScrollView style={{ flex:1, padding:10 }}>
25
+ <View style={{ flex:1, padding:10 }}>
27
26
  <View style={{ padding:10, paddingBottom:0 }}>
28
- <Text size={18} color={Colors.brand.midnight} weight='bold' textAlign='left'>APP MODES</Text>
27
+ <Text size={18} theme='h1' textAlign='left'>APP MODES</Text>
29
28
  </View>
30
- <View style={{ backgroundColor:Colors.brand.cobalt, padding:10, borderRadius:8, margin:10 }}>
31
- <View style={{ padding:5, flexDirection:'row', alignItems:'center' }}>
32
- <Text style={{ flex:1 }} size={26} color={Colors.shades.white} weight='semibold'>Real-Money Mode</Text>
33
- <Icons.USDIcon size={30} color={Colors.shades.white} />
29
+ <View float style={{ padding:10, borderRadius:8, margin:10 }}>
30
+ <View transparent style={{ padding:5, flexDirection:'row', alignItems:'center' }}>
31
+ <Text style={{ flex:1 }} size={26} theme='h2'>Real-Money Mode</Text>
32
+ <Icons.USDIcon size={30} color={Colors.text.h1} />
34
33
  </View>
35
- <View style={{ padding:5, paddingBottom:10, borderBottomWidth:1, borderBottomColor:Colors.accents.accent200 }}>
36
- <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>
34
+ <View transparent style={{ padding:5, paddingBottom:10, borderBottomWidth:1, borderBottomColor:Colors.borders.light }}>
35
+ <Text size={14} weight='regular' color={Colors.text.h1}>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>
37
36
  </View>
38
- <View style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
39
- <Text style={{ flex:1 }} size={14} color={Colors.shades.white}>Real-Money / USD ($)</Text>
40
- <Text size={16} weight='bold' color={Colors.shades.white}>${player_balance.balance.toFixed(2)}</Text>
37
+ <View transparent style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
38
+ <Text style={{ flex:1 }} size={14} theme='description'>Real-Money / USD ($)</Text>
39
+ <Text size={16} weight='bold' theme='h1'>${player_balance.balance.toFixed(2)}</Text>
41
40
  </View>
42
- <View style={{ padding:10 }}>
43
- <View style={{ flexDirection:'row', alignItems:'center' }}>
44
- <Text style={{ flex:1 }} size={14} color={Colors.shades.white}>Promo (P)</Text>
45
- <Text size={16} weight='bold' color={Colors.shades.white}>P{player_balance.promo_balance.toFixed(2)}</Text>
41
+ <View transparent style={{ padding:10 }}>
42
+ <View transparent style={{ flexDirection:'row', alignItems:'center' }}>
43
+ <Text style={{ flex:1 }} size={14} theme='description'>Promo (P)</Text>
44
+ <Text size={16} weight='bold' theme='h1'>P{player_balance.promo_balance.toFixed(2)}</Text>
46
45
  </View>
47
- <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>
46
+ <Text style={{ marginTop:3 }} size={12} color={Colors.text.warning} weight='semibold'>Promo balance can be used for all real-money activities. Winnings will be returned as Real-Money/USD ($).</Text>
48
47
  </View>
49
48
  </View>
50
49
 
51
- <View style={{ backgroundColor:Colors.brand.cyan, padding:10, borderRadius:8, margin:10 }}>
52
- <View style={{ padding:5, flexDirection:'row', alignItems:'center' }}>
53
- <Text style={{ flex:1 }} size={26} color={Colors.shades.white} weight='semibold'>Demo Mode</Text>
54
- <Icons.EdgeCoinIcon size={30} color={Colors.shades.white} />
50
+ <View float style={{ padding:10, borderRadius:8, margin:10 }}>
51
+ <View transparent style={{ padding:5, flexDirection:'row', alignItems:'center' }}>
52
+ <Text style={{ flex:1 }} size={26} theme='h2'>Demo Mode</Text>
53
+ <Icons.EdgeCoinIcon size={30} color={Colors.text.h1} />
55
54
  </View>
56
- <View style={{ padding:5, paddingBottom:10, borderBottomWidth:1, borderBottomColor:Colors.accents.accent100 }}>
57
- <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>
55
+ <View transparent style={{ padding:5, paddingBottom:10, borderBottomWidth:1, borderBottomColor:Colors.borders.light }}>
56
+ <Text size={14} theme='description'>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>
58
57
  </View>
59
- <View style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
60
- <Text style={{ flex:1 }} size={14} color={Colors.shades.white}>Edge Coins (E)</Text>
61
- <Text size={16} weight='bold' color={Colors.shades.white}>E{player_balance.free_market_balance.toFixed(2)}</Text>
58
+ <View transparent style={{ padding:10, flexDirection:'row', alignItems:'center' }}>
59
+ <Text style={{ flex:1 }} size={14} theme='description'>Edge Coins (E)</Text>
60
+ <Text size={16} weight='bold' theme='h1'>E{player_balance.free_market_balance.toFixed(2)}</Text>
62
61
  </View>
63
62
  </View>
64
- </ScrollView>
63
+ </View>
65
64
  <View nativeID='action_row' style={{ flexDirection:'row', justifyContent:'space-between', padding:10 }}>
66
65
  <Button
67
66
  title='EXIT SETUP'
68
- title_color={Colors.utility.error}
69
- backgroundColor='transparent'
67
+ type='error'
70
68
  onPress={() => onClose()}
71
69
  />
72
- <TouchableOpacity
73
- style={button_styles.wizard_valid}
70
+ <Button
71
+ float
72
+ style={{ borderRadius:100, height:50, width:50, justifyContent:'center', alignItems:'center' }}
74
73
  onPress={() => onNext()}
75
- //disabled={loading}
76
74
  >
77
- <Icons.ChevronIcon size={20} direction='right' color={Colors.brand.midnight}/>
78
- </TouchableOpacity>
75
+ <Icons.ChevronIcon size={18} direction='right' color={Colors.text.h1}/>
76
+ </Button>
79
77
  </View>
80
78
  </View>
81
79
  )