be-components 6.3.2 → 6.3.4

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 (107) hide show
  1. package/lib/commonjs/Campaign/api/index.js +13 -0
  2. package/lib/commonjs/Campaign/api/index.js.map +1 -1
  3. package/lib/commonjs/Campaign/components/GolferAlert.js +135 -0
  4. package/lib/commonjs/Campaign/components/GolferAlert.js.map +1 -0
  5. package/lib/commonjs/Campaign/index.js +810 -2
  6. package/lib/commonjs/Campaign/index.js.map +1 -1
  7. package/lib/commonjs/Checkout/components/AccountSummaryCard.js +2 -2
  8. package/lib/commonjs/Checkout/components/AccountSummaryCard.js.map +1 -1
  9. package/lib/commonjs/Components/Jerseys.js +0 -1
  10. package/lib/commonjs/Components/Jerseys.js.map +1 -1
  11. package/lib/commonjs/FlashMarket/FlashHolder.js +12 -3
  12. package/lib/commonjs/FlashMarket/FlashHolder.js.map +1 -1
  13. package/lib/commonjs/FlashMarket/index.js +4 -2
  14. package/lib/commonjs/FlashMarket/index.js.map +1 -1
  15. package/lib/commonjs/Poll/api/index.js +10 -0
  16. package/lib/commonjs/Poll/api/index.js.map +1 -1
  17. package/lib/commonjs/Poll/index.js +4 -0
  18. package/lib/commonjs/Poll/index.js.map +1 -1
  19. package/lib/commonjs/Wallet/api/index.js +3 -0
  20. package/lib/commonjs/Wallet/api/index.js.map +1 -1
  21. package/lib/commonjs/Wallet/components/AccountCard.js +2 -2
  22. package/lib/commonjs/Wallet/components/AccountCard.js.map +1 -1
  23. package/lib/module/Campaign/api/index.js +13 -0
  24. package/lib/module/Campaign/api/index.js.map +1 -1
  25. package/lib/module/Campaign/components/GolferAlert.js +128 -0
  26. package/lib/module/Campaign/components/GolferAlert.js.map +1 -0
  27. package/lib/module/Campaign/index.js +812 -4
  28. package/lib/module/Campaign/index.js.map +1 -1
  29. package/lib/module/Checkout/components/AccountSummaryCard.js +2 -2
  30. package/lib/module/Checkout/components/AccountSummaryCard.js.map +1 -1
  31. package/lib/module/Components/Jerseys.js +0 -1
  32. package/lib/module/Components/Jerseys.js.map +1 -1
  33. package/lib/module/FlashMarket/FlashHolder.js +12 -3
  34. package/lib/module/FlashMarket/FlashHolder.js.map +1 -1
  35. package/lib/module/FlashMarket/index.js +4 -2
  36. package/lib/module/FlashMarket/index.js.map +1 -1
  37. package/lib/module/Poll/api/index.js +10 -0
  38. package/lib/module/Poll/api/index.js.map +1 -1
  39. package/lib/module/Poll/index.js +4 -0
  40. package/lib/module/Poll/index.js.map +1 -1
  41. package/lib/module/Wallet/api/index.js +3 -0
  42. package/lib/module/Wallet/api/index.js.map +1 -1
  43. package/lib/module/Wallet/components/AccountCard.js +2 -2
  44. package/lib/module/Wallet/components/AccountCard.js.map +1 -1
  45. package/lib/typescript/lib/commonjs/Campaign/api/index.d.ts +1 -0
  46. package/lib/typescript/lib/commonjs/Campaign/api/index.d.ts.map +1 -1
  47. package/lib/typescript/lib/commonjs/Campaign/components/GolferAlert.d.ts +10 -0
  48. package/lib/typescript/lib/commonjs/Campaign/components/GolferAlert.d.ts.map +1 -0
  49. package/lib/typescript/lib/commonjs/Campaign/index.d.ts +2 -1
  50. package/lib/typescript/lib/commonjs/Campaign/index.d.ts.map +1 -1
  51. package/lib/typescript/lib/commonjs/Components/Jerseys.d.ts.map +1 -1
  52. package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts +5 -1
  53. package/lib/typescript/lib/commonjs/FlashMarket/FlashHolder.d.ts.map +1 -1
  54. package/lib/typescript/lib/commonjs/FlashMarket/index.d.ts +3 -1
  55. package/lib/typescript/lib/commonjs/FlashMarket/index.d.ts.map +1 -1
  56. package/lib/typescript/lib/commonjs/Poll/api/index.d.ts +1 -0
  57. package/lib/typescript/lib/commonjs/Poll/api/index.d.ts.map +1 -1
  58. package/lib/typescript/lib/commonjs/Poll/index.d.ts +2 -1
  59. package/lib/typescript/lib/commonjs/Poll/index.d.ts.map +1 -1
  60. package/lib/typescript/lib/commonjs/Wallet/api/index.d.ts +1 -0
  61. package/lib/typescript/lib/commonjs/Wallet/api/index.d.ts.map +1 -1
  62. package/lib/typescript/lib/module/Campaign/api/index.d.ts +1 -0
  63. package/lib/typescript/lib/module/Campaign/api/index.d.ts.map +1 -1
  64. package/lib/typescript/lib/module/Campaign/components/GolferAlert.d.ts +10 -0
  65. package/lib/typescript/lib/module/Campaign/components/GolferAlert.d.ts.map +1 -0
  66. package/lib/typescript/lib/module/Campaign/index.d.ts +2 -1
  67. package/lib/typescript/lib/module/Campaign/index.d.ts.map +1 -1
  68. package/lib/typescript/lib/module/Components/Jerseys.d.ts.map +1 -1
  69. package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts +5 -1
  70. package/lib/typescript/lib/module/FlashMarket/FlashHolder.d.ts.map +1 -1
  71. package/lib/typescript/lib/module/FlashMarket/index.d.ts +3 -1
  72. package/lib/typescript/lib/module/FlashMarket/index.d.ts.map +1 -1
  73. package/lib/typescript/lib/module/Poll/api/index.d.ts +1 -0
  74. package/lib/typescript/lib/module/Poll/api/index.d.ts.map +1 -1
  75. package/lib/typescript/lib/module/Poll/index.d.ts +2 -1
  76. package/lib/typescript/lib/module/Poll/index.d.ts.map +1 -1
  77. package/lib/typescript/lib/module/Wallet/api/index.d.ts +1 -0
  78. package/lib/typescript/lib/module/Wallet/api/index.d.ts.map +1 -1
  79. package/lib/typescript/src/Campaign/api/index.d.ts +2 -1
  80. package/lib/typescript/src/Campaign/api/index.d.ts.map +1 -1
  81. package/lib/typescript/src/Campaign/components/GolferAlert.d.ts +12 -0
  82. package/lib/typescript/src/Campaign/components/GolferAlert.d.ts.map +1 -0
  83. package/lib/typescript/src/Campaign/index.d.ts +2 -1
  84. package/lib/typescript/src/Campaign/index.d.ts.map +1 -1
  85. package/lib/typescript/src/FlashMarket/FlashHolder.d.ts +5 -1
  86. package/lib/typescript/src/FlashMarket/FlashHolder.d.ts.map +1 -1
  87. package/lib/typescript/src/FlashMarket/index.d.ts +3 -1
  88. package/lib/typescript/src/FlashMarket/index.d.ts.map +1 -1
  89. package/lib/typescript/src/Poll/api/index.d.ts +1 -0
  90. package/lib/typescript/src/Poll/api/index.d.ts.map +1 -1
  91. package/lib/typescript/src/Poll/index.d.ts +2 -1
  92. package/lib/typescript/src/Poll/index.d.ts.map +1 -1
  93. package/lib/typescript/src/Wallet/api/index.d.ts +1 -0
  94. package/lib/typescript/src/Wallet/api/index.d.ts.map +1 -1
  95. package/package.json +1 -1
  96. package/src/Campaign/api/index.ts +10 -1
  97. package/src/Campaign/components/GolferAlert.tsx +74 -0
  98. package/src/Campaign/index.tsx +435 -10
  99. package/src/Checkout/components/AccountSummaryCard.tsx +2 -2
  100. package/src/Components/Jerseys.tsx +1 -1
  101. package/src/FlashMarket/FlashHolder.tsx +10 -4
  102. package/src/FlashMarket/index.tsx +5 -3
  103. package/src/Poll/api/index.ts +8 -0
  104. package/src/Poll/index.tsx +5 -1
  105. package/src/Wallet/api/index.ts +3 -0
  106. package/src/Wallet/components/AccountCard.tsx +2 -2
  107. package/src/types.d.ts +1 -1
@@ -18,10 +18,14 @@ type FlashHolderProps = {
18
18
  player?:MyPlayerProps,
19
19
  init_expanded?:boolean,
20
20
  contest_type?:string,
21
+ parent_style?:ViewStyle,
22
+ hide_footer?:boolean,
21
23
  contest_id?:string,
22
24
  hide_tabs?:boolean,
23
25
  style?:ViewStyle,
24
26
  side_type?:string,
27
+ hide_timer?:boolean,
28
+ no_highlight?:boolean,
25
29
  location?:LocationProps,
26
30
  side_id?:string,
27
31
  poll_id?:string,
@@ -31,7 +35,7 @@ type FlashHolderProps = {
31
35
  onRequestAuthenticate: () => void
32
36
  }
33
37
  const sections = [ 'selector','explainer','flash_market','options','footer' ]
34
- const FlashHolder = ({ float, compact, style, distinct_id, hide_tabs, league_id, init_expanded, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onSelectCompactPoll, onRequestAuthenticate, onFocusPosition, onRequestLocation } : FlashHolderProps) => {
38
+ const FlashHolder = ({ float, compact, style, hide_timer, distinct_id, hide_footer, no_highlight, hide_tabs, parent_style, league_id, init_expanded, player_id, player, location, contest_type, contest_id, side_type, side_id, poll_id, onSelectCompactPoll, onRequestAuthenticate, onFocusPosition, onRequestLocation } : FlashHolderProps) => {
35
39
  const Colors = useColors();
36
40
  const [ needs_reload, setNeedsReload ] = useState(false);
37
41
  const [ socket_campaigns, setSocketCampaigns ] = useState<PollCampaignProps[]>([]);
@@ -190,7 +194,7 @@ const FlashHolder = ({ float, compact, style, distinct_id, hide_tabs, league_id,
190
194
  return (
191
195
  <Button
192
196
  float={selected}
193
- style={{ padding:4, margin:1, borderRadius:0, borderTopRightRadius:8, borderTopLeftRadius:8, borderWidth:2, borderBottomWidth:0, borderColor:selected ? Colors.text.success : Colors.borders.light, opacity:selected?1:0.5 }}
197
+ style={{ padding:4, margin:1, borderRadius:0, borderTopRightRadius:8, borderTopLeftRadius:8, borderWidth:2, borderBottomWidth:0, borderColor:selected && !no_highlight ? Colors.text.success : Colors.borders.light, opacity:selected?1:0.5 }}
194
198
  onPress={() => handleSelectPoll(data.item.poll_id)}
195
199
  >
196
200
  {data.item.poll_image ?
@@ -267,11 +271,13 @@ const FlashHolder = ({ float, compact, style, distinct_id, hide_tabs, league_id,
267
271
  poll={flash_market}
268
272
  poll_options={poll_options}
269
273
  poll_summaries={poll_summaries}
274
+ hide_footer={hide_footer}
270
275
  poll_campaign={poll_campaign}
271
276
  flash_market_fees={flash_market_fees}
272
277
  loading={loading || holder_loading}
273
278
  hide_image
274
- card_style={{ borderWidth:2, borderColor:Colors.text.success, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}
279
+ hide_timer={hide_timer}
280
+ card_style={{ borderWidth:2, borderColor:!no_highlight?Colors.text.success:Colors.borders.light, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}
275
281
  init_expanded={init_expanded}
276
282
  footer_style={{ borderBottomRightRadius:8, borderBottomLeftRadius:8 }}
277
283
  header_style={{ borderTopRightRadius:0, borderTopLeftRadius:0 }}
@@ -286,7 +292,7 @@ const FlashHolder = ({ float, compact, style, distinct_id, hide_tabs, league_id,
286
292
  }
287
293
  }
288
294
  return (
289
- <View transparent>
295
+ <View transparent style={{ ...parent_style }}>
290
296
  {flash_markets.length > 0 || active_flash_market ?
291
297
  <View float={float} style={{ ...style }}>
292
298
  <FlatList
@@ -20,8 +20,10 @@ type FlashMarketProps = {
20
20
  location?:LocationProps,
21
21
  card_style?:any,
22
22
  init_expanded?:boolean,
23
+ hide_timer?:boolean,
23
24
  onReload:() => void,
24
25
  header_style?:any,
26
+ hide_footer?:boolean,
25
27
  footer_style?:any,
26
28
  player_id?:string
27
29
  player?:MyPlayerProps,
@@ -29,7 +31,7 @@ type FlashMarketProps = {
29
31
  onFocusPosition?: (position:{ x:number, y:number, width:number, height:number }) => void,
30
32
  onRequestAuthenticate: () => void
31
33
  }
32
- const FlashMarket = ({ loading, poll, poll_options, poll_summaries, poll_campaign, flash_market_fees, hide_image, init_expanded, card_style, header_style, footer_style, onReload, location, player, player_id, onRequestAuthenticate, onFocusPosition, onRequestLocation }:FlashMarketProps) => {
34
+ const FlashMarket = ({ loading, poll, hide_footer, hide_timer, poll_options, poll_summaries, poll_campaign, flash_market_fees, hide_image, init_expanded, card_style, header_style, footer_style, onReload, location, player, player_id, onRequestAuthenticate, onFocusPosition, onRequestLocation }:FlashMarketProps) => {
33
35
  const Colors = useColors();
34
36
  const [ admin_action, setAdminActions ] = useState<{
35
37
  selected_option_id?:string,
@@ -329,7 +331,7 @@ const FlashMarket = ({ loading, poll, poll_options, poll_summaries, poll_campaig
329
331
  <View transparent>
330
332
  {expanded ?
331
333
  <View transparent type='body' style={{ padding:10 }}>
332
- {!is_upcoming && poll.status == 'active' ?
334
+ {!hide_timer && !is_upcoming && poll.status == 'active' ?
333
335
  <MarketTimer
334
336
  poll={poll}
335
337
  onTimesUp={() => onReload()}
@@ -464,7 +466,7 @@ const FlashMarket = ({ loading, poll, poll_options, poll_summaries, poll_campaig
464
466
  :<></>}
465
467
  </View>
466
468
  :<></>}
467
- {expanded ?
469
+ {expanded && !hide_footer ?
468
470
  <View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, ...footer_style }}>
469
471
  <Button transparent style={{ justifyContent:'center', alignItems:'center', borderRadius:0, padding:5, paddingRight:10, marginRight:10, borderRightWidth:1, borderColor:Colors.borders.light }}
470
472
  onPress={() => setShowHelp(!show_help)}>
@@ -253,6 +253,14 @@ const PollOptionApi = {
253
253
  updatePollOption : async(poll_option:PollOptionProps):Promise<PollOptionProps> => {
254
254
  const resp = await axios.post(`${AUTH_SVC_API}/v1/polls/poll/option/update`, { poll_option })
255
255
  return resp.data.poll_option
256
+ },
257
+ getPollOptionsByPollIds: async(poll_ids:string[]):Promise<PollOptionProps[]> => {
258
+ try {
259
+ const resp = await axios.post(`${AUTH_SVC_API}/v1/polls/options/bulk/get`, { poll_ids });
260
+ return resp.data.poll_options
261
+ } catch (error) {
262
+ return []
263
+ }
256
264
  }
257
265
  }
258
266
 
@@ -17,6 +17,7 @@ type PollCampaignModuleProps = {
17
17
  player_id?:string,
18
18
  view_mode:'desktop'|'mobile',
19
19
  distinct_id:string,
20
+ onFlashSelect?:(poll_id:string) => void,
20
21
  insets?:{ top:number, bottom:number, left:number, right:number },
21
22
  onBack?:() => void,
22
23
  onEvent?:(be_event:BEEventProps) => void,
@@ -27,7 +28,7 @@ type PollCampaignModuleProps = {
27
28
  }
28
29
 
29
30
  const sections = ['header', 'progress', 'results','questions']
30
- const PollCampaign = ({ distinct_id, view_mode, poll_campaign_id, player_id, insets, onBack, onRequestAuthenticate, onSharePollCampaign }: PollCampaignModuleProps ) => {
31
+ const PollCampaign = ({ distinct_id, view_mode, poll_campaign_id, player_id, insets, onBack, onFlashSelect, onRequestAuthenticate, onSharePollCampaign }: PollCampaignModuleProps ) => {
31
32
  const [ needs_reload, setNeedsReload ] = useState(false);
32
33
  const [ socket_polls, setSocketPolls ] = useState<PollProps[]>([]);
33
34
  const [ socket_campaign, setSocketCampaign ] = useState<PollCampaignProps|undefined>(undefined);
@@ -171,6 +172,9 @@ const PollCampaign = ({ distinct_id, view_mode, poll_campaign_id, player_id, ins
171
172
  onSelectPoll={(p) => {
172
173
  if(!player_id){ return onRequestAuthenticate(poll_campaign.auth_strategy_id, poll_campaign.company_id) }
173
174
  if(['paused','pending','inactive'].includes(p.status)){ return Alert.alert('This question is not active. Please open when it becomes active') }
175
+ if(poll_campaign.market_type == 'FOR_MONEY' && onFlashSelect){
176
+ return onFlashSelect(p.poll_id)
177
+ }
174
178
  setModuleData({ ...module_data, active_poll_id: p.poll_id })
175
179
  }}
176
180
  />
@@ -326,6 +326,9 @@ const WalletHelpers = {
326
326
  if(!wallet_settings.agreed_to_terms || !wallet_settings.pin || !wallet_settings.auth_end_datetime || moment().isAfter(moment(wallet_settings.auth_end_datetime))){ return false }
327
327
  return true
328
328
  },
329
+ formateTimeToExpireDate: (date:any) => {
330
+ return moment.parseZone(date).utc().format('MM/YYYY')
331
+ },
329
332
  formatBalance: (balance:number) => {
330
333
  let round_down_balance = Math.round(balance * 100) / 100;
331
334
  let str_balance = round_down_balance.toFixed(2).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { AccountProps } from '../../types';
3
3
  import { Icons } from '../../Components';
4
- import moment from 'moment-mini';
5
4
  import { Button, Text, View } from '../../Components/Themed';
6
5
  import { useColors } from '../../constants/useColors';
6
+ import { WalletHelpers } from '../api';
7
7
 
8
8
  type AccountCardProps = {
9
9
  account:AccountProps,
@@ -61,7 +61,7 @@ const AccountCard = ({ account, hide_status, onSelectAccount }: AccountCardProps
61
61
  return account.ach_detail.account_type.toUpperCase()
62
62
  case 'card':
63
63
  if(!account.card_detail){ return '' }
64
- return `EXP ${moment(account.card_detail.expiration_date).format('MM/YYYY')}`
64
+ return `EXP ${WalletHelpers.formateTimeToExpireDate(account.card_detail.expiration_date)}`
65
65
  case 'paypal':
66
66
  return `Login to your Paypal and transact`
67
67
  default: return ''
package/src/types.d.ts CHANGED
@@ -731,7 +731,7 @@ export interface CampaignProps {
731
731
  campaign_name:string,
732
732
  description?:string,
733
733
  status:'active'|'inactive',
734
- sponsors?:bigint[],
734
+ sponsors?:string[],
735
735
  prize_description?:string,
736
736
  raffle_options?:string[],
737
737
  poll_campaign_ids?:string[],