be-components 2.3.5 → 2.3.8

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 (91) hide show
  1. package/lib/commonjs/Engage/components/CompanyCard.js +26 -2
  2. package/lib/commonjs/Engage/components/CompanyCard.js.map +1 -1
  3. package/lib/commonjs/Engage/components/EngageHeader.js +6 -2
  4. package/lib/commonjs/Engage/components/EngageHeader.js.map +1 -1
  5. package/lib/commonjs/Engage/index.js +6 -2
  6. package/lib/commonjs/Engage/index.js.map +1 -1
  7. package/lib/commonjs/MarketComponents/components/OrderGradeBar.js +3 -3
  8. package/lib/commonjs/MarketComponents/components/OrderGradeBar.js.map +1 -1
  9. package/lib/commonjs/SocialComponents/ArticleCard.js +73 -0
  10. package/lib/commonjs/SocialComponents/ArticleCard.js.map +1 -0
  11. package/lib/commonjs/SocialComponents/CompanyProfile/api/index.js +175 -0
  12. package/lib/commonjs/SocialComponents/CompanyProfile/api/index.js.map +1 -0
  13. package/lib/commonjs/SocialComponents/CompanyProfile/index.js +592 -0
  14. package/lib/commonjs/SocialComponents/CompanyProfile/index.js.map +1 -0
  15. package/lib/commonjs/SocialComponents/PodcastCard.js +53 -0
  16. package/lib/commonjs/SocialComponents/PodcastCard.js.map +1 -0
  17. package/lib/commonjs/SocialComponents/PodcastEpisodeCard.js +63 -0
  18. package/lib/commonjs/SocialComponents/PodcastEpisodeCard.js.map +1 -0
  19. package/lib/commonjs/SocialComponents/PodcastModule/api/index.js +53 -0
  20. package/lib/commonjs/SocialComponents/PodcastModule/api/index.js.map +1 -0
  21. package/lib/commonjs/SocialComponents/PodcastModule/index.js +242 -0
  22. package/lib/commonjs/SocialComponents/PodcastModule/index.js.map +1 -0
  23. package/lib/commonjs/SocialComponents/api/index.js +23 -1
  24. package/lib/commonjs/SocialComponents/api/index.js.map +1 -1
  25. package/lib/commonjs/SocialComponents/index.js +14 -0
  26. package/lib/commonjs/SocialComponents/index.js.map +1 -1
  27. package/lib/module/Engage/components/CompanyCard.js +24 -2
  28. package/lib/module/Engage/components/CompanyCard.js.map +1 -1
  29. package/lib/module/Engage/components/EngageHeader.js +6 -2
  30. package/lib/module/Engage/components/EngageHeader.js.map +1 -1
  31. package/lib/module/Engage/index.js +6 -2
  32. package/lib/module/Engage/index.js.map +1 -1
  33. package/lib/module/MarketComponents/components/OrderGradeBar.js +3 -3
  34. package/lib/module/MarketComponents/components/OrderGradeBar.js.map +1 -1
  35. package/lib/module/SocialComponents/ArticleCard.js +66 -0
  36. package/lib/module/SocialComponents/ArticleCard.js.map +1 -0
  37. package/lib/module/SocialComponents/CompanyProfile/api/index.js +169 -0
  38. package/lib/module/SocialComponents/CompanyProfile/api/index.js.map +1 -0
  39. package/lib/module/SocialComponents/CompanyProfile/index.js +583 -0
  40. package/lib/module/SocialComponents/CompanyProfile/index.js.map +1 -0
  41. package/lib/module/SocialComponents/PodcastCard.js +46 -0
  42. package/lib/module/SocialComponents/PodcastCard.js.map +1 -0
  43. package/lib/module/SocialComponents/PodcastEpisodeCard.js +56 -0
  44. package/lib/module/SocialComponents/PodcastEpisodeCard.js.map +1 -0
  45. package/lib/module/SocialComponents/PodcastModule/api/index.js +47 -0
  46. package/lib/module/SocialComponents/PodcastModule/api/index.js.map +1 -0
  47. package/lib/module/SocialComponents/PodcastModule/index.js +233 -0
  48. package/lib/module/SocialComponents/PodcastModule/index.js.map +1 -0
  49. package/lib/module/SocialComponents/api/index.js +23 -1
  50. package/lib/module/SocialComponents/api/index.js.map +1 -1
  51. package/lib/module/SocialComponents/index.js +3 -1
  52. package/lib/module/SocialComponents/index.js.map +1 -1
  53. package/lib/typescript/src/Engage/components/CompanyCard.d.ts +4 -2
  54. package/lib/typescript/src/Engage/components/CompanyCard.d.ts.map +1 -1
  55. package/lib/typescript/src/Engage/components/EngageHeader.d.ts +4 -2
  56. package/lib/typescript/src/Engage/components/EngageHeader.d.ts.map +1 -1
  57. package/lib/typescript/src/Engage/index.d.ts +4 -2
  58. package/lib/typescript/src/Engage/index.d.ts.map +1 -1
  59. package/lib/typescript/src/SocialComponents/ArticleCard.d.ts +12 -0
  60. package/lib/typescript/src/SocialComponents/ArticleCard.d.ts.map +1 -0
  61. package/lib/typescript/src/SocialComponents/CompanyProfile/api/index.d.ts +34 -0
  62. package/lib/typescript/src/SocialComponents/CompanyProfile/api/index.d.ts.map +1 -0
  63. package/lib/typescript/src/SocialComponents/CompanyProfile/index.d.ts +19 -0
  64. package/lib/typescript/src/SocialComponents/CompanyProfile/index.d.ts.map +1 -0
  65. package/lib/typescript/src/SocialComponents/PodcastCard.d.ts +10 -0
  66. package/lib/typescript/src/SocialComponents/PodcastCard.d.ts.map +1 -0
  67. package/lib/typescript/src/SocialComponents/PodcastEpisodeCard.d.ts +11 -0
  68. package/lib/typescript/src/SocialComponents/PodcastEpisodeCard.d.ts.map +1 -0
  69. package/lib/typescript/src/SocialComponents/PodcastModule/api/index.d.ts +9 -0
  70. package/lib/typescript/src/SocialComponents/PodcastModule/api/index.d.ts.map +1 -0
  71. package/lib/typescript/src/SocialComponents/PodcastModule/index.d.ts +14 -0
  72. package/lib/typescript/src/SocialComponents/PodcastModule/index.d.ts.map +1 -0
  73. package/lib/typescript/src/SocialComponents/api/index.d.ts +6 -2
  74. package/lib/typescript/src/SocialComponents/api/index.d.ts.map +1 -1
  75. package/lib/typescript/src/SocialComponents/index.d.ts +3 -1
  76. package/lib/typescript/src/SocialComponents/index.d.ts.map +1 -1
  77. package/package.json +1 -1
  78. package/src/Engage/components/CompanyCard.tsx +27 -5
  79. package/src/Engage/components/EngageHeader.tsx +6 -2
  80. package/src/Engage/index.tsx +6 -2
  81. package/src/MarketComponents/components/OrderGradeBar.tsx +3 -3
  82. package/src/SocialComponents/ArticleCard.tsx +54 -0
  83. package/src/SocialComponents/CompanyProfile/api/index.ts +151 -0
  84. package/src/SocialComponents/CompanyProfile/index.tsx +438 -0
  85. package/src/SocialComponents/PodcastCard.tsx +31 -0
  86. package/src/SocialComponents/PodcastEpisodeCard.tsx +41 -0
  87. package/src/SocialComponents/PodcastModule/api/index.ts +44 -0
  88. package/src/SocialComponents/PodcastModule/index.tsx +161 -0
  89. package/src/SocialComponents/api/index.ts +18 -3
  90. package/src/SocialComponents/index.tsx +5 -2
  91. package/src/types.d.ts +99 -0
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { PodcastProps } from '../types';
3
+ type PodcastCardType = {
4
+ podcast: PodcastProps;
5
+ width: number;
6
+ onSelectPodcast: (podcast: PodcastProps) => void;
7
+ };
8
+ declare const PodcastCard: ({ podcast, width, onSelectPodcast }: PodcastCardType) => React.JSX.Element;
9
+ export default PodcastCard;
10
+ //# sourceMappingURL=PodcastCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PodcastCard.d.ts","sourceRoot":"","sources":["../../../../src/SocialComponents/PodcastCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAM7C,KAAK,eAAe,GAAG;IACnB,OAAO,EAAC,YAAY,CAAC;IACrB,KAAK,EAAC,MAAM,CAAC;IACb,eAAe,EAAC,CAAC,OAAO,EAAC,YAAY,KAAK,IAAI,CAAA;CACjD,CAAA;AACD,QAAA,MAAM,WAAW,wCAAwC,eAAe,sBAgBvE,CAAA;AACD,eAAe,WAAW,CAAA"}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { PodcastEpisodesProps, PodcastProps } from '../types';
3
+ type PodcastEpisodeCardProps = {
4
+ podcast_episode: PodcastEpisodesProps;
5
+ podcast?: PodcastProps;
6
+ width: number;
7
+ onSelectEpisode: (pe: PodcastEpisodesProps) => void;
8
+ };
9
+ declare const PodcastEpisodeCard: ({ width, podcast_episode, podcast, onSelectEpisode }: PodcastEpisodeCardProps) => React.JSX.Element;
10
+ export default PodcastEpisodeCard;
11
+ //# sourceMappingURL=PodcastEpisodeCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PodcastEpisodeCard.d.ts","sourceRoot":"","sources":["../../../../src/SocialComponents/PodcastEpisodeCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAKnE,KAAK,uBAAuB,GAAG;IAC3B,eAAe,EAAC,oBAAoB,CAAA;IACpC,OAAO,CAAC,EAAC,YAAY,CAAC;IACtB,KAAK,EAAC,MAAM,CAAC;IACb,eAAe,EAAC,CAAC,EAAE,EAAC,oBAAoB,KAAK,IAAI,CAAA;CACpD,CAAA;AAED,QAAA,MAAM,kBAAkB,yDAA0D,uBAAuB,sBAuBxG,CAAA;AAED,eAAe,kBAAkB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { PodcastEpisodesProps, PodcastProps, PublicPlayerProps } from "../../../types";
2
+ export { PodcastApi };
3
+ declare const PodcastApi: {
4
+ setEnvironment: () => void;
5
+ getPodcastById: (podcast_id: string) => Promise<PodcastProps | undefined>;
6
+ getPodcastEpisodesByPodcast: (podcast_id: string, offset: number) => Promise<PodcastEpisodesProps[]>;
7
+ getPlayersByPlayerIds: (player_ids?: string[]) => Promise<PublicPlayerProps[]>;
8
+ };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/SocialComponents/PodcastModule/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAK5F,OAAO,EAAE,UAAU,EAAE,CAAA;AAErB,QAAA,MAAM,UAAU;;iCAMqB,MAAM,KAAE,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;8CAQ5B,MAAM,UAAS,MAAM,KAAE,OAAO,CAAC,oBAAoB,EAAE,CAAC;yCASzD,MAAM,EAAE,KAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAWrF,CAAA"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { PodcastEpisodesProps } from '../../types';
3
+ type PodcastModuleProps = {
4
+ podcast_id: string;
5
+ padding_insets?: {
6
+ top: number;
7
+ bottom: number;
8
+ };
9
+ onBack?: () => void;
10
+ onSelectEpisode: (pe: PodcastEpisodesProps) => void;
11
+ };
12
+ declare const PodcastModule: ({ podcast_id, padding_insets, onSelectEpisode, onBack }: PodcastModuleProps) => React.JSX.Element;
13
+ export default PodcastModule;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/SocialComponents/PodcastModule/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,oBAAoB,EAAmC,MAAM,aAAa,CAAC;AASzF,KAAK,kBAAkB,GAAG;IACtB,UAAU,EAAC,MAAM,CAAC;IAClB,cAAc,CAAC,EAAC;QAAE,GAAG,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,MAAM,CAAA;KAAE,CAAC;IAC9C,MAAM,CAAC,EAAC,MAAM,IAAI,CAAC;IACnB,eAAe,EAAC,CAAC,EAAE,EAAC,oBAAoB,KAAK,IAAI,CAAA;CACpD,CAAA;AAED,QAAA,MAAM,aAAa,4DAA4D,kBAAkB,sBA4IhG,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -1,5 +1,5 @@
1
- import type { AthleteProps, EventProps, LeagueProps, MatchProps, OrderProps, PlayerFollowerProps, PostReactionProps, TeamProps, TournamentProps } from "../../types";
2
- export { SocialComponentApi, SocialOrderHelpers };
1
+ import type { AthleteProps, EventProps, LeagueProps, MatchProps, OrderProps, PlayerFollowerProps, PodcastEpisodesProps, PodcastProps, PostReactionProps, TeamProps, TournamentProps } from "../../types";
2
+ export { SocialComponentApi, SocialOrderHelpers, SocialPodcastHelpers };
3
3
  declare const SocialComponentApi: {
4
4
  setEnvironment: () => void;
5
5
  getLeagues: () => Promise<LeagueProps[]>;
@@ -37,4 +37,8 @@ declare const SocialOrderHelpers: {
37
37
  };
38
38
  getOddsLabel: (odds: number, decimals?: number) => string;
39
39
  };
40
+ declare const SocialPodcastHelpers: {
41
+ getPodcastImage: (podcast: PodcastProps) => string;
42
+ getEpisodeImage: (podcast_episode: PodcastEpisodesProps) => string;
43
+ };
40
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/SocialComponents/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQrK,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAA;AAEjD,QAAA,MAAM,kBAAkB;;sBAQA,OAAO,CAAC,WAAW,EAAE,CAAC;0BAQhB,UAAU,KAAE,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;yCAQ5B,MAAM,EAAE;0CAIP,mBAAmB,KAAE,OAAO,CAAC,mBAAmB,CAAC;qCAItD,MAAM,EAAE,KAAE,OAAO,CAAC,UAAU,EAAE,CAAC;sCAS9B,MAAM,EAAE,KAAE,OAAO,CAAC,UAAU,EAAE,CAAC;oCAShC,MAAM,EAAE,KAAE,OAAO,CAAC,YAAY,EAAE,CAAC;oDASlB,MAAM,EAAE,KAAE,OAAO,CAAC,eAAe,EAAE,CAAC;8BAS1D,MAAM,EAAE;wCASE,iBAAiB,KAAE,OAAO,CAAC,iBAAiB,GAAC,SAAS,CAAC;wCAStD,iBAAiB,KAAE,OAAO,CAAC,iBAAiB,GAAC,SAAS,CAAC;CASnG,CAAA;AAGD,QAAA,MAAM,kBAAkB;0BACC,UAAU;8BAYN,UAAU;;;;kCAYN,MAAM,OAAM,MAAM;+BAWrB,UAAU,EAAE;;;;;;;+BAWZ,UAAU,UAAS,UAAU,EAAE,eAAc,eAAe,EAAE,WAAU,UAAU,EAAE,YAAW,YAAY,EAAE,SAAQ,SAAS,EAAE,WAAU,WAAW,EAAE,KAAE;QAAE,KAAK,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,MAAM,CAAC,EAAC,WAAW,CAAC;QAAC,OAAO,CAAC,EAAC,YAAY,CAAC;QAAC,IAAI,CAAC,EAAC,SAAS,CAAA;KAAE;yBAwBzP,MAAM,aAAY,MAAM;CAM/C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/SocialComponents/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAQzM,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,CAAA;AAEvE,QAAA,MAAM,kBAAkB;;sBAQA,OAAO,CAAC,WAAW,EAAE,CAAC;0BAQhB,UAAU,KAAE,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;yCAQ5B,MAAM,EAAE;0CAIP,mBAAmB,KAAE,OAAO,CAAC,mBAAmB,CAAC;qCAItD,MAAM,EAAE,KAAE,OAAO,CAAC,UAAU,EAAE,CAAC;sCAS9B,MAAM,EAAE,KAAE,OAAO,CAAC,UAAU,EAAE,CAAC;oCAShC,MAAM,EAAE,KAAE,OAAO,CAAC,YAAY,EAAE,CAAC;oDASlB,MAAM,EAAE,KAAE,OAAO,CAAC,eAAe,EAAE,CAAC;8BAS1D,MAAM,EAAE;wCASE,iBAAiB,KAAE,OAAO,CAAC,iBAAiB,GAAC,SAAS,CAAC;wCAStD,iBAAiB,KAAE,OAAO,CAAC,iBAAiB,GAAC,SAAS,CAAC;CASnG,CAAA;AAGD,QAAA,MAAM,kBAAkB;0BACC,UAAU;8BAYN,UAAU;;;;kCAYN,MAAM,OAAM,MAAM;+BAWrB,UAAU,EAAE;;;;;;;+BAWZ,UAAU,UAAS,UAAU,EAAE,eAAc,eAAe,EAAE,WAAU,UAAU,EAAE,YAAW,YAAY,EAAE,SAAQ,SAAS,EAAE,WAAU,WAAW,EAAE,KAAE;QAAE,KAAK,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,MAAM,CAAC,EAAC,WAAW,CAAC;QAAC,OAAO,CAAC,EAAC,YAAY,CAAC;QAAC,IAAI,CAAC,EAAC,SAAS,CAAA;KAAE;yBAwBzP,MAAM,aAAY,MAAM;CAM/C,CAAA;AAED,QAAA,MAAM,oBAAoB;+BACI,YAAY,KAAE,MAAM;uCAMZ,oBAAoB,KAAE,MAAM;CAMjE,CAAA"}
@@ -1,5 +1,7 @@
1
1
  import PlayerCard from "./PlayerCard";
2
2
  import PlayerList from "./PlayerList";
3
3
  import PlayerProfile from "./PlayerProfile";
4
- export { PlayerCard, PlayerList, PlayerProfile };
4
+ import CompanyProfile from './CompanyProfile';
5
+ import PodcastModule from './PodcastModule';
6
+ export { PlayerCard, PlayerList, PlayerProfile, CompanyProfile, PodcastModule };
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SocialComponents/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EACH,UAAU,EACV,UAAU,EACV,aAAa,EAChB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SocialComponents/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACH,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EAChB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-components",
3
- "version": "2.3.5",
3
+ "version": "2.3.8",
4
4
  "description": "Components for BettorEdge Apps",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -1,17 +1,38 @@
1
- import React from 'react';
1
+ import React, { useEffect, useRef } from 'react';
2
2
  import { View, Image, Linking, TouchableOpacity } from 'react-native';
3
- import type { CompanyProps } from '../../types';
3
+ import type { BEEventProps, CompanyProps } from '../../types';
4
4
  import { view_styles } from '../../constants/styles';
5
5
  import { Text } from '../../Components';
6
6
  import Colors from '../../constants/colors';
7
+ import { useIsInViewport } from '../../Components/ViewportObserver';
7
8
 
8
9
  type CompanyCardProps = {
9
10
  company:CompanyProps,
10
- width:number
11
+ width:number,
12
+ onEvent?:(be_event:BEEventProps) => void,
13
+ onSelectCompany?:(company:CompanyProps) => void
11
14
  }
12
15
  const MAX_IMAGE_WIDTH = 175
13
16
 
14
- const CompanyCard = ({company, width}:CompanyCardProps) => {
17
+ const CompanyCard = ({company, width, onEvent, onSelectCompany}:CompanyCardProps) => {
18
+
19
+ const company_ref = useRef(null)
20
+ const isInViewport = useIsInViewport(company_ref);
21
+ useEffect(() => {
22
+ if(isInViewport && onEvent){
23
+ let be_event:BEEventProps = {
24
+ event_name:'company_view',
25
+ event_data: {
26
+ view_type: 'engage',
27
+ view_location: 'header',
28
+ },
29
+ level:2
30
+ }
31
+
32
+ onEvent(be_event)
33
+ }
34
+ },[isInViewport])
35
+
15
36
  const image_width = width > MAX_IMAGE_WIDTH ? MAX_IMAGE_WIDTH : width
16
37
 
17
38
  let description = company.company_description
@@ -20,8 +41,9 @@ const CompanyCard = ({company, width}:CompanyCardProps) => {
20
41
  }
21
42
 
22
43
  return (
23
- <TouchableOpacity style={{ ...view_styles.section ,width:image_width, backgroundColor:company.brand_primary ?? Colors.shades.shade100, borderRadius:8 }}
44
+ <TouchableOpacity ref={company_ref} style={{ ...view_styles.section, width:image_width, backgroundColor:company.brand_primary ?? Colors.shades.shade100, borderRadius:8 }}
24
45
  onPress={() => {
46
+ if(onSelectCompany){ onSelectCompany(company) }
25
47
  if(company.company_url){ Linking.openURL(company.company_url) }
26
48
  return
27
49
  }}>
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { View, Image, FlatList, TouchableOpacity, ActivityIndicator } from "react-native";
3
- import type { CompanyProps } from '../../types';
3
+ import type { BEEventProps, CompanyProps } from '../../types';
4
4
  import LinearGradient from 'react-native-linear-gradient';
5
5
  import Colors from '../../constants/colors';
6
6
  import { Button, Icons, Text } from '../../Components';
@@ -12,10 +12,12 @@ import { EngageApi } from '../api';
12
12
  type EngageHeaderProps = {
13
13
  companies:CompanyProps[],
14
14
  width:number,
15
+ onEvent?:(be_event:BEEventProps) => void,
16
+ onSelectCompany?:(company:CompanyProps) => void,
15
17
  onManage?:() => void
16
18
  }
17
19
 
18
- const EngageHeader = ({ companies, width, onManage }:EngageHeaderProps) => {
20
+ const EngageHeader = ({ companies, width, onManage, onEvent, onSelectCompany }:EngageHeaderProps) => {
19
21
  const [ active_company, setActiveComany ] = useState<number>(0);
20
22
  const [ search, setSearch ] = useState<{
21
23
  loading:boolean,
@@ -65,6 +67,8 @@ const EngageHeader = ({ companies, width, onManage }:EngageHeaderProps) => {
65
67
  <CompanyCard
66
68
  company={data.item}
67
69
  width={width / 2.5}
70
+ onEvent={onEvent}
71
+ onSelectCompany={onSelectCompany}
68
72
  />
69
73
  </View>
70
74
  )
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { View, ActivityIndicator, FlatList, ScrollView } from 'react-native';
3
- import type { BracketCompetitionProps, BracketProps, CompanyProps, CompetitionPayoutTypeProps, CompetitionProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, EventProps, LeagueProps, PublicPlayerProps, SquaresCompetitionProps } from '../types';
3
+ import type { BEEventProps, BracketCompetitionProps, BracketProps, CompanyProps, CompetitionPayoutTypeProps, CompetitionProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, EventProps, LeagueProps, PublicPlayerProps, SquaresCompetitionProps } from '../types';
4
4
  import Colors from '../constants/colors';
5
5
  import { EngageApi, EngageHelpers } from './api';
6
6
  import CompetitionCard from './components/CompetitionCard';
@@ -17,8 +17,10 @@ import PrivateCodePrompt from './components/PrivateCodePrompt';
17
17
 
18
18
  type EngageModuleProps = {
19
19
  player_id?:string,
20
+ onEvent?:(be_event:BEEventProps) => void,
20
21
  onManage:() => void,
21
22
  onCreateSeason?:() => void,
23
+ onSelectCompany?:(c:CompanyProps) => void,
22
24
  onCreateCompetition?:() => void,
23
25
  onCreateSquares?: () => void,
24
26
  onCreateBracketCompetition?:() => void,
@@ -29,7 +31,7 @@ type EngageModuleProps = {
29
31
  }
30
32
 
31
33
  const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelectSquaresCompetition, onSelectCompetitionSeason,
32
- onCreateSeason, onCreateCompetition, onCreateBracketCompetition, onCreateSquares, onManage
34
+ onCreateSeason, onCreateCompetition, onCreateBracketCompetition, onCreateSquares, onManage, onEvent, onSelectCompany
33
35
  }:EngageModuleProps) => {
34
36
  const [ module_size, setModuleSize ] = useState({ width:0, height:0 });
35
37
  const [ show_code_prompt, setShowCodePrompt ] = useState(false);
@@ -213,6 +215,8 @@ const EngageModule = ({ onSelectBracketCompetition, onSelectCompetition, onSelec
213
215
  companies={companies}
214
216
  width={module_size.width}
215
217
  onManage={onManage}
218
+ onEvent={onEvent}
219
+ onSelectCompany={onSelectCompany}
216
220
  />
217
221
  <View style={{ ...view_styles.body_row, margin:10, backgroundColor:Colors.shades.white, borderRadius:22, borderWidth:4, borderColor:Colors.shades.shade100}}>
218
222
  <Button
@@ -45,7 +45,7 @@ const OrderGradeBar = ({ grade, view_type, mask, onSelectGrade }:OrderGradeBarPr
45
45
  if(!grade && grade !== 0){ return <></> }
46
46
  //Check if the grade is greater than the minumum of the box
47
47
  const filled = grade >= data.item.min ? true : false
48
- const success = grade > 97.5 ? true : false
48
+ const success = grade > 98 ? true : false
49
49
  const locked = !premium ? true : false
50
50
  //Render the box
51
51
  return (
@@ -68,7 +68,7 @@ const OrderGradeBar = ({ grade, view_type, mask, onSelectGrade }:OrderGradeBarPr
68
68
  if(!grade && grade !== 0){ return <></> }
69
69
  //Check if the grade is greater than the minumum of the box
70
70
  const filled = grade >= data.item.min ? true : false
71
- const success = grade > 100 ? true : false
71
+ const success = grade > 98 ? true : false
72
72
  const locked = !premium ? true : false
73
73
 
74
74
  //Render the box
@@ -84,7 +84,7 @@ const OrderGradeBar = ({ grade, view_type, mask, onSelectGrade }:OrderGradeBarPr
84
84
  }
85
85
 
86
86
  if(view_type == 'market'){
87
- const success = grade > 100 ? true : false
87
+ const success = grade > 98 ? true : false
88
88
  if(!premium){
89
89
  return (<></>)
90
90
  }
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+ import { View, Image, TouchableOpacity } from 'react-native';
3
+ import type { ArticleFeedProps, ArticleProps, BEEventProps } from "../types"
4
+ import { Text } from '../Components';
5
+ import { view_styles } from '../constants/styles';
6
+ import Colors from '../constants/colors';
7
+
8
+ type ArticleCardProps = {
9
+ article_feed?:ArticleFeedProps,
10
+ article:ArticleProps,
11
+ width:number,
12
+ onEvent?:(be_event:BEEventProps) => void,
13
+ onSelectArticle:(article:ArticleProps) => void
14
+ }
15
+ const ArticleCard = ({ article_feed, article, width, onSelectArticle, onEvent }:ArticleCardProps) => {
16
+
17
+ return (
18
+ <TouchableOpacity style={{ ...view_styles.section, width, flex:1 }} onPress={() => {
19
+ onSelectArticle(article)
20
+ if(onEvent){
21
+ onEvent({
22
+ event_name: 'article_click',
23
+ event_data: {
24
+ article_id: article.article_id,
25
+ company_id: article.company_id,
26
+ },
27
+ level:2
28
+ })
29
+ }
30
+ }}>
31
+ {article_feed ?
32
+ <View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100 }}>
33
+ <View style={{ flex:1 }}>
34
+ <Text theme='header_2'>{article_feed.feed_name}</Text>
35
+ </View>
36
+ </View>
37
+ :<></>}
38
+ <View style={{ ...view_styles.section_body, padding:0 }}>
39
+ <View>
40
+ <Image
41
+ source={{ uri: article.image?.url }}
42
+ style={{ width:width, height:width * 0.66 }}
43
+ resizeMode='cover'
44
+ />
45
+ </View>
46
+ <View style={{ padding:5 }}>
47
+ <Text theme='header_2'>{article.title}</Text>
48
+ </View>
49
+ </View>
50
+ </TouchableOpacity>
51
+ )
52
+ }
53
+
54
+ export default ArticleCard
@@ -0,0 +1,151 @@
1
+ import axios from "axios";
2
+ import { APIOverrides } from "../../../ApiOverrides";
3
+ import type { ArticleFeedProps, ArticleProps, BracketCompetitionProps, BracketProps, CompanyProps, CompetitionPayoutTypeProps, CompetitionProps, CompetitionResultTypeProps, CompetitionTypeProps, EventProps, LeagueProps, PodcastProps, PublicPlayerProps, SquaresCompetitionProps } from "../../../types";
4
+ import type { CompanyMemberProps } from "../../../Authenticator/api/types";
5
+ import moment from "moment-mini";
6
+
7
+ let AUTH_SVC_API = '';
8
+ let SOCIAL_SVC_API = '';
9
+ let TP_SVC_API = '';
10
+ let EVENT_SVC_API = '';
11
+
12
+ export { CompanyProfileApi, CompanyProfileHelpers }
13
+
14
+ const CompanyProfileApi = {
15
+ setEnvironment: () => {
16
+ const endpoints = APIOverrides.getEndpoints();
17
+ SOCIAL_SVC_API = endpoints['SOCIAL_SVC_API'] as string;
18
+ AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
19
+ TP_SVC_API = endpoints['TP_SVC_API'] as string;
20
+ EVENT_SVC_API = endpoints['EVENT_SVC_API'] as string;
21
+ },
22
+ getCompanyById: async (company_id: string): Promise<{ company: CompanyProps, company_members: CompanyMemberProps[] } | undefined> => {
23
+ try {
24
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/companies/company/id/${company_id}`)
25
+ return resp.data
26
+ } catch (e) {
27
+ return undefined
28
+ }
29
+ },
30
+ getPlayersByPlayerIds: async (player_ids: string[]): Promise<PublicPlayerProps[]> => {
31
+ if (player_ids.length == 0) { return [] }
32
+ try {
33
+ const resp = await axios.post(`${AUTH_SVC_API}/v1/players/bulk/get`, { player_ids })
34
+ return resp.data.players
35
+ } catch (e) {
36
+ console.log(e);
37
+ return []
38
+ }
39
+ },
40
+ getLeagues: async():Promise<LeagueProps[]> => {
41
+ try {
42
+ const resp = await axios.get(`${EVENT_SVC_API}/v1/leagues?status=active`)
43
+ return resp.data.leagues
44
+ } catch (e) {
45
+ return []
46
+ }
47
+ },
48
+ getEventsByEventIds: async(event_ids:string[]):Promise<EventProps[]> => {
49
+ try {
50
+ if(event_ids.length == 0){ return [] }
51
+ const resp = await axios.post(`${EVENT_SVC_API}/v1/events/bulk/get`, { attribute:'event_id', values: event_ids })
52
+ return resp.data.events
53
+ } catch (e) {
54
+ return []
55
+ }
56
+ },
57
+ getBracketsByIds: async(bracket_ids:string[]):Promise<BracketProps[]> => {
58
+ try {
59
+ if(bracket_ids.length == 0){ return [] }
60
+ const resp = await axios.post(`${EVENT_SVC_API}/v1/brackets/bulk/get`, { bracket_ids })
61
+ return resp.data.brackets
62
+ } catch (e) {
63
+ console.log(e)
64
+ return []
65
+ }
66
+ },
67
+ getCompetitionOptions: async():Promise<undefined | {competition_types:CompetitionTypeProps[], competition_result_types:CompetitionResultTypeProps[], competition_payout_types:CompetitionPayoutTypeProps[]}> => {
68
+ try {
69
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/options`)
70
+ return resp.data
71
+ } catch (e) {
72
+ console.log(e)
73
+ return undefined
74
+ }
75
+
76
+ },
77
+ getCompetitionsByCompanyId: async (company_id: string, offset: number, status: 'active' | 'closed'): Promise<CompetitionProps[]> => {
78
+ try {
79
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/company/${company_id}?offset=${offset}&status=${status}`)
80
+ return resp.data.competitions
81
+ } catch (e) {
82
+ console.log(e);
83
+ return []
84
+ }
85
+ },
86
+
87
+ getSquaresByCompanyId: async (company_id: string, offset: number, status: 'active' | 'closed'): Promise<CompetitionProps[]> => {
88
+ try {
89
+ const resp = await axios.get(`${TP_SVC_API}/v1/competitions/company/${company_id}?offset=${offset}&status=${status}`)
90
+ return resp.data.competitions
91
+ } catch (e) {
92
+ console.log(e);
93
+ return []
94
+ }
95
+ },
96
+ getSquaresCompsByCompanyId: async (company_id: string, status: string): Promise<SquaresCompetitionProps[]> => {
97
+ try {
98
+ const resp = await axios.get(`${TP_SVC_API}/tp/squares/company/${company_id}?status=${status}`);
99
+ return resp.data.squares_competitions
100
+ } catch (e) {
101
+ console.log(e);
102
+ return []
103
+ }
104
+ },
105
+ getBracketCompetitionsByCompanyId: async (company_id: string, offset: number, status?: 'active' | 'closed'): Promise<BracketCompetitionProps[]> => {
106
+ try {
107
+ const resp = await axios.get(`${TP_SVC_API}/v1/brackets/competitions/company/${company_id}?offset=${offset}&status=${status}`)
108
+ return resp.data.bracket_competitions
109
+ } catch (e) {
110
+ console.log(e);
111
+ return []
112
+ }
113
+ },
114
+ getPodcastsByCompanyId:async(company_id:string, offset:number):Promise<PodcastProps[]> => {
115
+ try {
116
+ const resp = await axios.get(`${SOCIAL_SVC_API}/v1/podcasts/company/${company_id}?offset=${offset}`);
117
+ return resp.data.podcasts
118
+ } catch (e) {
119
+ console.log(e);
120
+ return []
121
+ }
122
+ },
123
+ getArticlesByCompanyId: async(company_id:string, offset:number):Promise<ArticleProps[]> => {
124
+ try {
125
+ const resp = await axios.get(`${SOCIAL_SVC_API}/v1/articles/company/${company_id}?offset=${offset}`);
126
+ console.log(resp.data)
127
+ return resp.data.articles
128
+ } catch (e) {
129
+ return []
130
+ }
131
+ },
132
+ getArticleFeedsByCompanyId: async(company_id:string):Promise<ArticleFeedProps[]> => {
133
+ try {
134
+ const resp = await axios.get(`${SOCIAL_SVC_API}/v1/articles/feeds/company/${company_id}`)
135
+ console.log(resp.data)
136
+ return resp.data.article_feeds
137
+ } catch (e) {
138
+ return []
139
+ }
140
+ }
141
+ }
142
+
143
+ const CompanyProfileHelpers = {
144
+ sortComps: (comps:CompetitionProps[], bcs:BracketCompetitionProps[], scs:SquaresCompetitionProps[]):{ type: 'competition'|'squares_competition'|'bracket_competition', id:string, start_time:any }[] => {
145
+ let sorted_comps:{ type:'competition'|'squares_competition'|'bracket_competition', id:string, start_time:any }[] = [];
146
+ comps.map(c => sorted_comps.push({ type: 'competition', id: c.competition_id, start_time: moment(c.scheduled_datetime) }));
147
+ bcs.map(bc => sorted_comps.push({ type: 'bracket_competition', id:bc.bracket_competition_id, start_time: moment(bc.scheduled_datetime) }));
148
+ scs.map(s => sorted_comps.push({ type: 'squares_competition', id:s.sq_comp_id, start_time: moment(s.begin_datetime) }));
149
+ return sorted_comps
150
+ }
151
+ }