be-components 3.5.9 → 3.6.1

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