be-components 7.4.2 → 7.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/ApiOverrides/index.js +4 -0
- package/lib/commonjs/ApiOverrides/index.js.map +1 -1
- package/lib/commonjs/BettorBot/api/index.js +64 -0
- package/lib/commonjs/BettorBot/api/index.js.map +1 -0
- package/lib/commonjs/BettorBot/components/BroadcastMessageCard.js +233 -0
- package/lib/commonjs/BettorBot/components/BroadcastMessageCard.js.map +1 -0
- package/lib/commonjs/BettorBot/components/ServerInfoCard.js +126 -0
- package/lib/commonjs/BettorBot/components/ServerInfoCard.js.map +1 -0
- package/lib/commonjs/BettorBot/index.js +532 -0
- package/lib/commonjs/BettorBot/index.js.map +1 -0
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.d.js.map +1 -1
- package/lib/module/ApiOverrides/index.js +4 -0
- package/lib/module/ApiOverrides/index.js.map +1 -1
- package/lib/module/BettorBot/api/index.js +57 -0
- package/lib/module/BettorBot/api/index.js.map +1 -0
- package/lib/module/BettorBot/components/BroadcastMessageCard.js +226 -0
- package/lib/module/BettorBot/components/BroadcastMessageCard.js.map +1 -0
- package/lib/module/BettorBot/components/ServerInfoCard.js +119 -0
- package/lib/module/BettorBot/components/ServerInfoCard.js.map +1 -0
- package/lib/module/BettorBot/index.js +524 -0
- package/lib/module/BettorBot/index.js.map +1 -0
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.d.js.map +1 -1
- package/lib/typescript/lib/commonjs/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/BettorBot/api/index.d.ts +9 -0
- package/lib/typescript/lib/commonjs/BettorBot/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BettorBot/components/BroadcastMessageCard.d.ts +10 -0
- package/lib/typescript/lib/commonjs/BettorBot/components/BroadcastMessageCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BettorBot/components/ServerInfoCard.d.ts +10 -0
- package/lib/typescript/lib/commonjs/BettorBot/components/ServerInfoCard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/BettorBot/index.d.ts +7 -0
- package/lib/typescript/lib/commonjs/BettorBot/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts +1 -0
- package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/BettorBot/api/index.d.ts +8 -0
- package/lib/typescript/lib/module/BettorBot/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/BettorBot/components/BroadcastMessageCard.d.ts +10 -0
- package/lib/typescript/lib/module/BettorBot/components/BroadcastMessageCard.d.ts.map +1 -0
- package/lib/typescript/lib/module/BettorBot/components/ServerInfoCard.d.ts +10 -0
- package/lib/typescript/lib/module/BettorBot/components/ServerInfoCard.d.ts.map +1 -0
- package/lib/typescript/lib/module/BettorBot/index.d.ts +7 -0
- package/lib/typescript/lib/module/BettorBot/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/index.d.ts +2 -1
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
- package/lib/typescript/src/BettorBot/api/index.d.ts +9 -0
- package/lib/typescript/src/BettorBot/api/index.d.ts.map +1 -0
- package/lib/typescript/src/BettorBot/components/BroadcastMessageCard.d.ts +15 -0
- package/lib/typescript/src/BettorBot/components/BroadcastMessageCard.d.ts.map +1 -0
- package/lib/typescript/src/BettorBot/components/ServerInfoCard.d.ts +12 -0
- package/lib/typescript/src/BettorBot/components/ServerInfoCard.d.ts.map +1 -0
- package/lib/typescript/src/BettorBot/index.d.ts +9 -0
- package/lib/typescript/src/BettorBot/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ApiOverrides/index.ts +4 -0
- package/src/BettorBot/api/index.ts +49 -0
- package/src/BettorBot/components/BroadcastMessageCard.tsx +159 -0
- package/src/BettorBot/components/ServerInfoCard.tsx +73 -0
- package/src/BettorBot/index.tsx +295 -0
- package/src/index.tsx +2 -0
- package/src/types.d.ts +48 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commonjs/BettorBot/index.js"],"names":[],"mappings":";;AAoBA;;;QA6fC"}
|
|
@@ -36,6 +36,7 @@ export const BEEventApi: any;
|
|
|
36
36
|
export const BELinkApi: any;
|
|
37
37
|
export const BEPostHog: any;
|
|
38
38
|
export const BetMatch: any;
|
|
39
|
+
export const BettorBotDashboard: any;
|
|
39
40
|
export const BettorSearch: any;
|
|
40
41
|
export const BracketCompetitionCard: any;
|
|
41
42
|
export const BracketRoom: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commonjs/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../commonjs/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0bA,2BAAkE;AAElE,iCAA8E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/ApiOverrides/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/ApiOverrides/index.js"],"names":[],"mappings":";IAkFS;;;;;;;OA4EN;IACgB;;OAsBhB;IACU;;OAQV;IACe,wCAEf;IACa,4BAEb;IACY,iHAYZ;IACY,sCAKZ;IACc,0CAOd;IACe,0CAMf;IACU,2BAOV;IACiB,kDAMjB;IAC4B,oEAW5B;IACgB,gDAMhB;IACa,kEAWb;IAC2B,iFAwC3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export namespace BettorBotApi {
|
|
2
|
+
function setEnvironment(): void;
|
|
3
|
+
function getServers(): Promise<any>;
|
|
4
|
+
function getDiscordStats(): Promise<any>;
|
|
5
|
+
function getPlayersByPlayerIds(player_ids: any): Promise<any>;
|
|
6
|
+
function broadcastMessage(message: any, targets: any): Promise<any>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../module/BettorBot/api/index.js"],"names":[],"mappings":";IAKkB,gCAIf;IACW,oCAeX;IACgB,yCAOhB;IACsB,8DAStB;IACiB,oEAUjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default BroadcastMessageCard;
|
|
2
|
+
declare function BroadcastMessageCard({ selected_servers, servers, onSendMessage, onFocusPosition, onClose }: {
|
|
3
|
+
selected_servers: any;
|
|
4
|
+
servers: any;
|
|
5
|
+
onSendMessage: any;
|
|
6
|
+
onFocusPosition: any;
|
|
7
|
+
onClose: any;
|
|
8
|
+
}): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
9
|
+
import React from 'react';
|
|
10
|
+
//# sourceMappingURL=BroadcastMessageCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BroadcastMessageCard.d.ts","sourceRoot":"","sources":["../../../../../module/BettorBot/components/BroadcastMessageCard.js"],"names":[],"mappings":";AAMA;;;;;;kGAyNC;kBA/N+B,OAAO"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default ServerInfoCard;
|
|
2
|
+
declare function ServerInfoCard({ server, selected_channels, onDeselectChannel, onSelectChannel, onClose }: {
|
|
3
|
+
server: any;
|
|
4
|
+
selected_channels: any;
|
|
5
|
+
onDeselectChannel: any;
|
|
6
|
+
onSelectChannel: any;
|
|
7
|
+
onClose: any;
|
|
8
|
+
}): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
9
|
+
import React from 'react';
|
|
10
|
+
//# sourceMappingURL=ServerInfoCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerInfoCard.d.ts","sourceRoot":"","sources":["../../../../../module/BettorBot/components/ServerInfoCard.js"],"names":[],"mappings":";AAKA;;;;;;kGA+GC;kBApH+B,OAAO"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export default BettorBotDashboard;
|
|
2
|
+
declare function BettorBotDashboard({ me, onFocusPosition }: {
|
|
3
|
+
me: any;
|
|
4
|
+
onFocusPosition: any;
|
|
5
|
+
}): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
6
|
+
import React from 'react';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/BettorBot/index.js"],"names":[],"mappings":";AAYA;;;kGA6fC;kBAzgB0C,OAAO"}
|
|
@@ -7,6 +7,7 @@ import CreateEngagement from './CreateEngagement';
|
|
|
7
7
|
import DiscordConnectionManager from './Discord';
|
|
8
8
|
import { BEEventApi } from './Observer';
|
|
9
9
|
import FlashCampaignManager from './PartnerPortal/components/FlashCampaignManager';
|
|
10
|
+
import BettorBotDashboard from './BettorBot';
|
|
10
11
|
import EmbedManager from './PartnerPortal/components/EmbedManager';
|
|
11
12
|
import RankingsCard from './RankingsCard';
|
|
12
13
|
import ManageFlashMarket from './FlashMarket/components/ManageFlashMarket';
|
|
@@ -71,5 +72,5 @@ import CompetitionCard from './Engage/components/CompetitionCard';
|
|
|
71
72
|
import SquaresCompetitionCard from './Engage/components/SquaresCompetitionCard';
|
|
72
73
|
import BracketCompetitionCard from './Engage/components/BracketCompetitionCard';
|
|
73
74
|
import SeasonCard from './Engage/components/SeasonCard';
|
|
74
|
-
export { Authenticator, Observer, MyAction, CreateEmbed, ReferralCodeManager, CreateEngagement, DiscordConnectionManager, BEEventApi, FlashCampaignManager, EmbedManager, RankingsCard, ManageFlashMarket, BELinkApi, PartnerPortal, SquaresManager, GuideView, BetMatch, ManageFilter, Ticker, Premium, CreateGroupWizard, LeaderboardCard, GroupComponent, LocationTracker, BEClarity, FlashMarket, ContactsCard, PlayerRecommender, GolfScoreboard, ContactsSelector, Campaign, BEPostHog, ManageBracketCompetitionForm, NotificationModule, FlashHolder, useNotifications, ClaritySmartEvents, ProfileManager, CompetitionManager, Components, SocialComponents, APIOverrides, LinearGradient, usePlayerLocation, BettorSearch, Colors, MyWallet, Share, Checkout, MarketComponents, EventComponents, PollCampaign, PollCampaignApi, PollApi, MarketMaker, CompetitionModule, SeasonManager, CreateCompetitionForm, CreateSeasonForm, SeasonModule, AdminCompetitionList, AdServer, Leaderboard, AdProvider, BracketRoom, SquaresModule, SocketManager, PromotedOrder, EngageModule, CompetitionCard, SquaresCompetitionCard, BracketCompetitionCard, SeasonCard };
|
|
75
|
+
export { Authenticator, Observer, MyAction, CreateEmbed, ReferralCodeManager, CreateEngagement, DiscordConnectionManager, BEEventApi, FlashCampaignManager, BettorBotDashboard, EmbedManager, RankingsCard, ManageFlashMarket, BELinkApi, PartnerPortal, SquaresManager, GuideView, BetMatch, ManageFilter, Ticker, Premium, CreateGroupWizard, LeaderboardCard, GroupComponent, LocationTracker, BEClarity, FlashMarket, ContactsCard, PlayerRecommender, GolfScoreboard, ContactsSelector, Campaign, BEPostHog, ManageBracketCompetitionForm, NotificationModule, FlashHolder, useNotifications, ClaritySmartEvents, ProfileManager, CompetitionManager, Components, SocialComponents, APIOverrides, LinearGradient, usePlayerLocation, BettorSearch, Colors, MyWallet, Share, Checkout, MarketComponents, EventComponents, PollCampaign, PollCampaignApi, PollApi, MarketMaker, CompetitionModule, SeasonManager, CreateCompetitionForm, CreateSeasonForm, SeasonModule, AdminCompetitionList, AdServer, Leaderboard, AdProvider, BracketRoom, SquaresModule, SocketManager, PromotedOrder, EngageModule, CompetitionCard, SquaresCompetitionCard, BracketCompetitionCard, SeasonCard };
|
|
75
76
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../module/index.js"],"names":[],"mappings":"0BAE0B,iBAAiB;qBAOK,YAAY;qBA6DvC,YAAY;wBAHT,wCAAwC;gCAChC,gDAAgD;6BAPnD,oBAAoB;qCAEZ,WAAW;2BAtDA,YAAY;iCA4D3B,iDAAiD;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../module/index.js"],"names":[],"mappings":"0BAE0B,iBAAiB;qBAOK,YAAY;qBA6DvC,YAAY;wBAHT,wCAAwC;gCAChC,gDAAgD;6BAPnD,oBAAoB;qCAEZ,WAAW;2BAtDA,YAAY;iCA4D3B,iDAAiD;+BAEnD,aAAa;yBALnB,yCAAyC;yBATzC,gBAAgB;8BAOX,4CAA4C;0BAvD1B,YAAY;0BAwDlC,iBAAiB;2BAHhB,kBAAkB;sBAJvB,SAAS;qBALV,YAAY;yBAER,oCAAoC;mBAb1C,UAAU;oBAYT,WAAW;8BAMD,sCAAsC;4BAhBxC,sCAAsC;2BAevC,SAAS;4BA3BR,mBAAmB;sBAoBzB,WAAW;wBAHT,eAAe;yBAHd,4CAA4C;8BADvC,qBAAqB;2BAGxB,kBAAkB;6BADhB,iDAAiD;qBANzD,YAAY;sBAUX,WAAW;yCAXQ,mDAAmD;+BAF7D,iBAAiB;wBAYxB,2BAA2B;iCAXlB,kCAAkC;+BAiBpC,uBAAuB;2BArD3B,kBAAkB;+BAmBd,sBAAsB;4BAlBzB,cAAc;kCACR,oBAAoB;6BACzB,gBAAgB;+BACd,sBAAsB;kCAMnB,kCAAkC;yBAH3C,gBAAgB;mBAFtB,oBAAoB;qBAGlB,UAAU;kBAoBb,SAAS;qBAnBN,YAAY;6BAiBJ,oBAAoB;4BACrB,mBAAmB;yBAhBtB,QAAQ;gCACQ,YAAY;wBAAZ,YAAY;wBAkB7B,eAAe;8BAjBT,eAAe;0BAUnB,4BAA4B;kCAHpB,uDAAuD;6BAK5D,wDAAwD;yBAD5D,qBAAqB;iCAHb,sDAAsD;qBAPlD,YAAY;wBA0BzB,WAAW;2BA1BE,YAAY;wBACzB,WAAW;0BAET,WAAW;0BADX,UAAU;0BAEV,iBAAiB;yBAIlB,UAAU;4BASP,qCAAqC;mCAC9B,4CAA4C;mCAC5C,4CAA4C;uBACxD,gCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ApiOverrides/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ApiOverrides/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiFlF,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,QAAA,MAAM,YAAY;+BACkB;QAAE,GAAG,EAAC,YAAY,GAAC,SAAS,GAAC,aAAa,GAAC,kBAAkB,CAAC;QAAC,QAAQ,EAAC,OAAO,CAAA;KAAE,KAAE,OAAO,CAAC,cAAc,CAAC;qCAiDrG,cAAc,WAAW;QAAE,KAAK,CAAC,EAAC,OAAO,CAAA;KAAE,KAAE,OAAO,CAAC;QAAE,MAAM,EAAE,SAAS,GAAC,MAAM,CAAA;KAAE,CAAC;qBAWpG,OAAO,CAAC;QAAC,MAAM,EAAE,SAAS,GAAC,MAAM,CAAA;KAAC,CAAC;0BAOjC,YAAY,GAAC,SAAS,GAAC,aAAa,GAAC,kBAAkB;;;;gCAM5C,MAAM,cAAa,MAAM,kBAAiB,MAAM,oBAAmB,GAAG;;;6BAoB9E,MAAM;;qCAgBE,MAAM;8CAOQ,MAAM,KAAE,OAAO,CAAC;QAAE,aAAa,EAAC,iBAAiB,CAAC;QAAC,KAAK,EAAC,UAAU,CAAC;QAAC,gBAAgB,EAAC,kBAAkB,EAAE,CAAA;KAAE,GAAC,SAAS,CAAC;mCAYvI,MAAM;0BAOV,MAAM,eAAc,MAAM,KAAE,OAAO,CAAC;QAAC,aAAa,EAAC,MAAM,CAAC;QAAC,YAAY,EAAC,MAAM,CAAC;QAAC,eAAe,EAAC,MAAM,CAAC;QAAC,SAAS,EAAC,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;wCASzH,MAAM,eAAc,MAAM;CA0BrE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BroadcastResult, BroadcastTarget, DiscordPlayerStatsProps, PublicPlayerProps, ServersResponse } from "../../types";
|
|
2
|
+
export declare const BettorBotApi: {
|
|
3
|
+
setEnvironment: () => void;
|
|
4
|
+
getServers: () => Promise<ServersResponse>;
|
|
5
|
+
getDiscordStats: () => Promise<DiscordPlayerStatsProps[]>;
|
|
6
|
+
getPlayersByPlayerIds: (player_ids: string[]) => Promise<PublicPlayerProps[]>;
|
|
7
|
+
broadcastMessage: (message: string, targets: BroadcastTarget[]) => Promise<BroadcastResult[]>;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/BettorBot/api/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAIjI,eAAO,MAAM,YAAY;;sBAMD,OAAO,CAAC,eAAe,CAAC;2BAYnB,OAAO,CAAC,uBAAuB,EAAE,CAAC;wCAQlB,MAAM,EAAE,KAAE,OAAO,CAAC,iBAAiB,EAAE,CAAC;gCAQ9C,MAAM,WAAU,eAAe,EAAE,KAAE,OAAO,CAAC,eAAe,EAAE,CAAC;CAQjG,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BroadcastResult, FocusPositionProps, ServerInfo } from '../../types';
|
|
3
|
+
type BroadcastMessageCardProps = {
|
|
4
|
+
selected_servers: {
|
|
5
|
+
guild_id: string;
|
|
6
|
+
channels: string[];
|
|
7
|
+
}[];
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
servers: ServerInfo[];
|
|
10
|
+
onFocusPosition?: (pos: FocusPositionProps) => void;
|
|
11
|
+
onSendMessage: (results: BroadcastResult[]) => void;
|
|
12
|
+
};
|
|
13
|
+
declare const BroadcastMessageCard: ({ selected_servers, servers, onSendMessage, onFocusPosition, onClose }: BroadcastMessageCardProps) => React.JSX.Element;
|
|
14
|
+
export default BroadcastMessageCard;
|
|
15
|
+
//# sourceMappingURL=BroadcastMessageCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BroadcastMessageCard.d.ts","sourceRoot":"","sources":["../../../../../src/BettorBot/components/BroadcastMessageCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAmB,kBAAkB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMpG,KAAK,yBAAyB,GAAG;IAC7B,gBAAgB,EAAE;QAAE,QAAQ,EAAC,MAAM,CAAC;QAAC,QAAQ,EAAC,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;IAC3D,OAAO,EAAC,MAAM,IAAI,CAAC;IACnB,OAAO,EAAC,UAAU,EAAE,CAAC;IACrB,eAAe,CAAC,EAAC,CAAC,GAAG,EAAC,kBAAkB,KAAK,IAAI,CAAC;IAClD,aAAa,EAAC,CAAC,OAAO,EAAC,eAAe,EAAE,KAAK,IAAI,CAAA;CACpD,CAAA;AACD,QAAA,MAAM,oBAAoB,GAAI,wEAAuE,yBAAyB,sBA6I7H,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ServerInfo } from '../../types';
|
|
3
|
+
type ServerInfoProps = {
|
|
4
|
+
server: ServerInfo;
|
|
5
|
+
selected_channels: string[];
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
onSelectChannel: (channel_id: string) => void;
|
|
8
|
+
onDeselectChannel: (channel_id: string) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const ServerInfoCard: ({ server, selected_channels, onDeselectChannel, onSelectChannel, onClose }: ServerInfoProps) => React.JSX.Element;
|
|
11
|
+
export default ServerInfoCard;
|
|
12
|
+
//# sourceMappingURL=ServerInfoCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerInfoCard.d.ts","sourceRoot":"","sources":["../../../../../src/BettorBot/components/ServerInfoCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;AAKjE,KAAK,eAAe,GAAG;IACnB,MAAM,EAAC,UAAU,CAAA;IACjB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,OAAO,EAAC,MAAM,IAAI,CAAC;IACnB,eAAe,EAAE,CAAC,UAAU,EAAC,MAAM,KAAK,IAAI,CAAC;IAC7C,iBAAiB,EAAE,CAAC,UAAU,EAAC,MAAM,KAAK,IAAI,CAAA;CACjD,CAAA;AACD,QAAA,MAAM,cAAc,GAAI,4EAA2E,eAAe,sBAwDjH,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FocusPositionProps, MyPlayerProps } from '../types';
|
|
3
|
+
type BettorBotDashboardProps = {
|
|
4
|
+
me?: MyPlayerProps;
|
|
5
|
+
onFocusPosition?: (pos: FocusPositionProps) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const BettorBotDashboard: ({ me, onFocusPosition }: BettorBotDashboardProps) => React.JSX.Element;
|
|
8
|
+
export default BettorBotDashboard;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/BettorBot/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,KAAK,EAA2B,kBAAkB,EAAE,aAAa,EAAiC,MAAM,UAAU,CAAC;AAS1H,KAAK,uBAAuB,GAAG;IAC3B,EAAE,CAAC,EAAC,aAAa,CAAC;IAClB,eAAe,CAAC,EAAC,CAAC,GAAG,EAAC,kBAAkB,KAAK,IAAI,CAAC;CACrD,CAAA;AAGD,QAAA,MAAM,kBAAkB,GAAI,yBAAwB,uBAAuB,sBAkR1E,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -67,5 +67,6 @@ import CreateEmbed from './PartnerPortal/components/CreateEmbed';
|
|
|
67
67
|
import ReferralCodeManager from './PartnerPortal/components/ReferralCodeManager';
|
|
68
68
|
import FlashCampaignManager from './PartnerPortal/components/FlashCampaignManager';
|
|
69
69
|
import MyAction from './MyAction';
|
|
70
|
-
|
|
70
|
+
import BettorBotDashboard from './BettorBot';
|
|
71
|
+
export { Authenticator, Observer, MyAction, CreateEmbed, ReferralCodeManager, CreateEngagement, DiscordConnectionManager, BEEventApi, FlashCampaignManager, BettorBotDashboard, EmbedManager, RankingsCard, ManageFlashMarket, BELinkApi, PartnerPortal, SquaresManager, GuideView, BetMatch, ManageFilter, Ticker, Premium, CreateGroupWizard, LeaderboardCard, GroupComponent, LocationTracker, BEClarity, FlashMarket, ContactsCard, PlayerRecommender, GolfScoreboard, ContactsSelector, Campaign, BEPostHog, ManageBracketCompetitionForm, NotificationModule, FlashHolder, useNotifications, ClaritySmartEvents, ProfileManager, CompetitionManager, Components, SocialComponents, APIOverrides, LinearGradient, usePlayerLocation, BettorSearch, Colors, MyWallet, Share, Checkout, MarketComponents, EventComponents, PollCampaign, PollCampaignApi, PollApi, MarketMaker, CompetitionModule, SeasonManager, CreateCompetitionForm, CreateSeasonForm, SeasonModule, AdminCompetitionList, AdServer, Leaderboard, AdProvider, BracketRoom, SquaresModule, SocketManager, PromotedOrder, EngageModule, CompetitionCard, SquaresCompetitionCard, BracketCompetitionCard, SeasonCard };
|
|
71
72
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,QAAQ,MAAM,UAAU,CAAC;AACh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YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,UAAU,EACX,CAAA"}
|
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ const ENVIRONMENT_ENDPOINTS = {
|
|
|
12
12
|
VOUCH_ID: 'adqEZph8t*_NBFy6u_l4!t~Hin6kpK',
|
|
13
13
|
VOUCHED_CALLBACK_URL: 'https://1f9b-64-159-204-178.ngrok-free.app/v1/players/vouch/hook',
|
|
14
14
|
VOUCHED_SANDBOX: true,
|
|
15
|
+
BOT_SVC_API: 'https://api.bot.bettoredge.com',
|
|
15
16
|
EVENT_SVC_API: 'http://localhost:3002',
|
|
16
17
|
MK_SVC_API:'http://localhost:3001',
|
|
17
18
|
TP_SVC_API: 'http://localhost:3006',
|
|
@@ -28,6 +29,7 @@ const ENVIRONMENT_ENDPOINTS = {
|
|
|
28
29
|
VOUCH_ID: 'adqEZph8t*_NBFy6u_l4!t~Hin6kpK',
|
|
29
30
|
VOUCHED_CALLBACK_URL: 'https://stage-be-auth-svc.herokuapp.com/v1/players/vouch/hook',
|
|
30
31
|
VOUCHED_SANDBOX: true,
|
|
32
|
+
BOT_SVC_API: 'https://api.bot.bettoredge.com',
|
|
31
33
|
EVENT_SVC_API: 'https://stage-be-sr-svc.herokuapp.com',
|
|
32
34
|
MK_SVC_API:'https://stage-be-mk-svc.herokuapp.com',
|
|
33
35
|
TP_SVC_API: 'https://stage-be-tp-svc.herokuapp.com',
|
|
@@ -44,6 +46,7 @@ const ENVIRONMENT_ENDPOINTS = {
|
|
|
44
46
|
VOUCH_ID: 'Q3tmJ3r9FnkN*n-MqS-!j0NS*k!mdo',
|
|
45
47
|
VOUCHED_CALLBACK_URL: 'https://be-auth-svc.herokuapp.com/v1/players/vouch/hook',
|
|
46
48
|
VOUCHED_SANDBOX: false,
|
|
49
|
+
BOT_SVC_API: 'https://api.bot.bettoredge.com',
|
|
47
50
|
EVENT_SVC_API: 'https://api.events.bettoredge.com',
|
|
48
51
|
MK_SVC_API: 'https://api.markets.bettoredge.com',
|
|
49
52
|
TP_SVC_API: 'https://be-tp-svc.herokuapp.com',
|
|
@@ -61,6 +64,7 @@ const ENVIRONMENT_ENDPOINTS = {
|
|
|
61
64
|
VOUCHED_CALLBACK_URL: 'https://be-auth-svc.herokuapp.com/v1/players/vouch/hook',
|
|
62
65
|
VOUCHED_SANDBOX: false,
|
|
63
66
|
EVENT_SVC_API: 'https://proxy.bettoredge.com/events',
|
|
67
|
+
BOT_SVC_API: 'https://api.bot.bettoredge.com',
|
|
64
68
|
MK_SVC_API: 'https://proxy.bettoredge.com/markets',
|
|
65
69
|
TP_SVC_API: 'https://be-tp-svc.herokuapp.com',
|
|
66
70
|
SOCIAL_SVC_API: 'https://proxy.bettoredge.com/social',
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { APIOverrides } from "../../ApiOverrides";
|
|
3
|
+
import type { BroadcastResult, BroadcastTarget, DiscordPlayerStatsProps, PublicPlayerProps, ServersResponse } from "../../types";
|
|
4
|
+
|
|
5
|
+
let BOT_SVC_API = ''
|
|
6
|
+
let AUTH_SVC_API = ''
|
|
7
|
+
export const BettorBotApi = {
|
|
8
|
+
setEnvironment: () => {
|
|
9
|
+
const endpoints = APIOverrides.getEndpoints();
|
|
10
|
+
AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
|
|
11
|
+
BOT_SVC_API = endpoints['BOT_SVC_API'] as string;
|
|
12
|
+
},
|
|
13
|
+
getServers: async():Promise<ServersResponse> => {
|
|
14
|
+
try {
|
|
15
|
+
console.log('Starting HERE!!!')
|
|
16
|
+
console.log(BOT_SVC_API)
|
|
17
|
+
const resp = await axios.get(`${BOT_SVC_API}/servers`);
|
|
18
|
+
console.log(resp.data)
|
|
19
|
+
return resp.data
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.log(e)
|
|
22
|
+
return { totalGuilds: 0, error:'Unable to get data', servers: [] }
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
getDiscordStats: async():Promise<DiscordPlayerStatsProps[]> => {
|
|
26
|
+
try {
|
|
27
|
+
const resp = await axios.get(`${AUTH_SVC_API}/v1/players/discord/stats`);
|
|
28
|
+
return resp.data.discord_player_stats
|
|
29
|
+
} catch (e) {
|
|
30
|
+
return []
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
getPlayersByPlayerIds : async(player_ids:string[]):Promise<PublicPlayerProps[]> => {
|
|
34
|
+
try {
|
|
35
|
+
const resp = await axios.post(`${AUTH_SVC_API}/v1/players/bulk/get`, { player_ids })
|
|
36
|
+
return resp.data.players
|
|
37
|
+
} catch (e) {
|
|
38
|
+
return []
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
broadcastMessage: async(message: string, targets:BroadcastTarget[]):Promise<BroadcastResult[]> => {
|
|
42
|
+
try {
|
|
43
|
+
const resp = await axios.post(`${BOT_SVC_API}/broadcast`, { message, targets });
|
|
44
|
+
return resp.data.results
|
|
45
|
+
} catch (e) {
|
|
46
|
+
return []
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Button, Text, TextInput, View } from "../../Components/Themed";
|
|
3
|
+
import type { BroadcastResult, BroadcastTarget, FocusPositionProps, ServerInfo } from '../../types';
|
|
4
|
+
import { useColors } from '../../constants/useColors';
|
|
5
|
+
import { BettorBotApi } from '../api';
|
|
6
|
+
import { FlatList, Image } from 'react-native';
|
|
7
|
+
import { Icons } from '../../Components';
|
|
8
|
+
|
|
9
|
+
type BroadcastMessageCardProps = {
|
|
10
|
+
selected_servers: { guild_id:string, channels:string[] }[],
|
|
11
|
+
onClose:() => void,
|
|
12
|
+
servers:ServerInfo[],
|
|
13
|
+
onFocusPosition?:(pos:FocusPositionProps) => void,
|
|
14
|
+
onSendMessage:(results:BroadcastResult[]) => void
|
|
15
|
+
}
|
|
16
|
+
const BroadcastMessageCard = ({ selected_servers, servers, onSendMessage, onFocusPosition, onClose }:BroadcastMessageCardProps) => {
|
|
17
|
+
const Colors = useColors();
|
|
18
|
+
const [ message, setMessage ] = useState('');
|
|
19
|
+
const [ action_loading, setActionLoading ] = useState(false);
|
|
20
|
+
const [ results, setResults ] = useState<BroadcastResult[]>([]);
|
|
21
|
+
const is_valid = message && selected_servers.length > 0 ? true : false
|
|
22
|
+
|
|
23
|
+
const handleSend = async() => {
|
|
24
|
+
if(!is_valid){ return alert('Please enter valid message') }
|
|
25
|
+
if(action_loading){ return }
|
|
26
|
+
setActionLoading(true);
|
|
27
|
+
let targets:BroadcastTarget[] = []
|
|
28
|
+
selected_servers.map(ss => {
|
|
29
|
+
ss.channels.map(c => {
|
|
30
|
+
targets.push({ guild_id: ss.guild_id, channel_id: c })
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
console.log(targets);
|
|
34
|
+
|
|
35
|
+
const results = await BettorBotApi.broadcastMessage(message, targets);
|
|
36
|
+
let success_results = results.filter(r => r.success);
|
|
37
|
+
let fail_results = results.filter(r => !r.success);
|
|
38
|
+
alert(`Message Sent!\nSuccessful : ${success_results.length}\nFailed: ${fail_results.length}`);
|
|
39
|
+
setResults(results);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const renderServers = (data:{ item:{ guild_id:string, channels:string[] }, index:number }) => {
|
|
43
|
+
const server = servers.find(s => s.id == data.item.guild_id);
|
|
44
|
+
if(!server){ return <></> }
|
|
45
|
+
return (
|
|
46
|
+
<View float style={{ margin:5, width:100 }}>
|
|
47
|
+
<Image
|
|
48
|
+
source={{ uri: server.icon ?? '' }}
|
|
49
|
+
style={{ height:50, width:100, borderTopRightRadius:8, borderTopLeftRadius:8 }}
|
|
50
|
+
resizeMode='cover'
|
|
51
|
+
/>
|
|
52
|
+
<View transparent style={{ padding:10 }}>
|
|
53
|
+
<Text theme='h1' textAlign='center'>{server.name}</Text>
|
|
54
|
+
<Text theme='description'>{data.item.channels.length} Channels</Text>
|
|
55
|
+
</View>
|
|
56
|
+
</View>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const renderResults = (data:{ item:BroadcastResult, index:number }) => {
|
|
61
|
+
const guild = servers.find(s => s.id == data.item.guild_id);
|
|
62
|
+
if(!guild){ return <></> }
|
|
63
|
+
const channel = guild.accessibleChannels.find(c => c.id == data.item.channel_id);
|
|
64
|
+
if(!channel){ return <></> }
|
|
65
|
+
return (
|
|
66
|
+
<View type='row' style={{ borderBottomWidth:1, borderColor:Colors.borders.light, padding:6 }}>
|
|
67
|
+
<Image
|
|
68
|
+
source={{ uri: guild.icon ?? '' }}
|
|
69
|
+
style={{ height:25, width:25 }}
|
|
70
|
+
resizeMode='cover'
|
|
71
|
+
/>
|
|
72
|
+
<View transparent style={{flex:1, marginLeft:10, marginRight:10}}>
|
|
73
|
+
<Text theme='h1'>{channel.name}</Text>
|
|
74
|
+
<Text theme='description' style={{ marginTop:3 }}>{guild.name}</Text>
|
|
75
|
+
</View>
|
|
76
|
+
{data.item.success ?
|
|
77
|
+
<Icons.CheckCirlceIcon size={20} color={Colors.text.success} />
|
|
78
|
+
:
|
|
79
|
+
<Icons.CloseIcon size={20} color={Colors.text.error} />
|
|
80
|
+
}
|
|
81
|
+
</View>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<View float style={{ flex:1 }}>
|
|
87
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
88
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
89
|
+
<Text theme='h1'>Send Message</Text>
|
|
90
|
+
<Text theme='description' style={{ marginTop:3 }}>Enter your message below and broadcast to {selected_servers.length} servers</Text>
|
|
91
|
+
</View>
|
|
92
|
+
<Button
|
|
93
|
+
float
|
|
94
|
+
title='X'
|
|
95
|
+
title_color={Colors.text.error}
|
|
96
|
+
style={{ padding:10 }}
|
|
97
|
+
onPress={() => {
|
|
98
|
+
if(results.length > 0){ return onSendMessage(results) }
|
|
99
|
+
return onClose()
|
|
100
|
+
}}
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
103
|
+
<View style={{ flex:1, padding:10 }}>
|
|
104
|
+
{results.length == 0 ?
|
|
105
|
+
<View transparent>
|
|
106
|
+
<TextInput
|
|
107
|
+
value={message}
|
|
108
|
+
onFocusPosition={onFocusPosition}
|
|
109
|
+
placeholder='Enter your message here'
|
|
110
|
+
onChangeText={(text) => setMessage(text)}
|
|
111
|
+
style={{ height:150, textAlign:'center' }}
|
|
112
|
+
/>
|
|
113
|
+
</View>
|
|
114
|
+
:
|
|
115
|
+
<FlatList
|
|
116
|
+
data={results}
|
|
117
|
+
key='message_results'
|
|
118
|
+
renderItem={renderResults}
|
|
119
|
+
keyExtractor={(item) => `${item.guild_id}:${item.channel_id}`}
|
|
120
|
+
/>
|
|
121
|
+
}
|
|
122
|
+
</View>
|
|
123
|
+
{results.length == 0 ?
|
|
124
|
+
<View style={{ padding:10 }}>
|
|
125
|
+
<Text theme='h1'>Sending Message To:</Text>
|
|
126
|
+
<FlatList
|
|
127
|
+
key={'server_list_message'}
|
|
128
|
+
horizontal
|
|
129
|
+
renderItem={renderServers}
|
|
130
|
+
data={selected_servers}
|
|
131
|
+
keyExtractor={item => item.guild_id}
|
|
132
|
+
/>
|
|
133
|
+
</View>
|
|
134
|
+
:<></>}
|
|
135
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
136
|
+
{results.length == 0 ?
|
|
137
|
+
<Button
|
|
138
|
+
title='SEND MESSAGE'
|
|
139
|
+
type='success'
|
|
140
|
+
disabled={!is_valid || action_loading}
|
|
141
|
+
loading={action_loading}
|
|
142
|
+
style={{ flex:1, opacity: !is_valid ? 0.5 : 1 }}
|
|
143
|
+
onPress={() => handleSend()}
|
|
144
|
+
/>
|
|
145
|
+
:
|
|
146
|
+
<Button
|
|
147
|
+
title='CLOSE'
|
|
148
|
+
type='close'
|
|
149
|
+
style={{ flex:1 }}
|
|
150
|
+
onPress={() => onSendMessage(results)}
|
|
151
|
+
/>
|
|
152
|
+
}
|
|
153
|
+
</View>
|
|
154
|
+
</View>
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export default BroadcastMessageCard
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Button, Text, View } from "../../Components/Themed";
|
|
3
|
+
import type { AccessibleChannel, ServerInfo } from '../../types';
|
|
4
|
+
import { FlatList, Image } from 'react-native';
|
|
5
|
+
import { Checkbox, SearchBox } from '../../Components';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
7
|
+
|
|
8
|
+
type ServerInfoProps = {
|
|
9
|
+
server:ServerInfo
|
|
10
|
+
selected_channels: string[],
|
|
11
|
+
onClose:() => void,
|
|
12
|
+
onSelectChannel: (channel_id:string) => void,
|
|
13
|
+
onDeselectChannel: (channel_id:string) => void
|
|
14
|
+
}
|
|
15
|
+
const ServerInfoCard = ({ server, selected_channels, onDeselectChannel, onSelectChannel, onClose }:ServerInfoProps) => {
|
|
16
|
+
const Colors = useColors();
|
|
17
|
+
const [ channel_search, setChannelSearch ] = useState('');
|
|
18
|
+
const filtered_channels = server.accessibleChannels.filter(c => `${c.name}`.toLowerCase().includes(channel_search));
|
|
19
|
+
|
|
20
|
+
const renderChannels = (data: { item: AccessibleChannel, index:number }) => {
|
|
21
|
+
const selected = selected_channels.includes(data.item.id) ? true : false
|
|
22
|
+
return (
|
|
23
|
+
<View transparent type='row' style={{ padding:8, borderBottomWidth:1, borderColor:Colors.borders.light }}>
|
|
24
|
+
<Checkbox
|
|
25
|
+
style={{ marginRight:10 }}
|
|
26
|
+
checked={selected}
|
|
27
|
+
onSelect={() => selected ? onDeselectChannel(data.item.id) : onSelectChannel(data.item.id)}
|
|
28
|
+
/>
|
|
29
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
30
|
+
<Text theme='h1'>{data.item.name}</Text>
|
|
31
|
+
</View>
|
|
32
|
+
</View>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<View float style={{ flex:1 }}>
|
|
38
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, borderTopRightRadius:8, borderTopLeftRadius:8 }}>
|
|
39
|
+
<Image
|
|
40
|
+
source={{ uri: server.icon ?? '' }}
|
|
41
|
+
style={{ height:40, width:40 }}
|
|
42
|
+
/>
|
|
43
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
44
|
+
<Text theme='h1'>{server.name}</Text>
|
|
45
|
+
<Text theme='description' style={{ marginTop:3 }}>{server.description}</Text>
|
|
46
|
+
</View>
|
|
47
|
+
</View>
|
|
48
|
+
<View style={{ flex:1, padding:10 }}>
|
|
49
|
+
<Text theme='h1' style={{ marginBottom:10 }}>Select Channels Below</Text>
|
|
50
|
+
<View transparent style={{ padding:5 }}>
|
|
51
|
+
<SearchBox onChange={(text) => setChannelSearch(text)} hide_search_button/>
|
|
52
|
+
</View>
|
|
53
|
+
<FlatList
|
|
54
|
+
key={'channel_list'}
|
|
55
|
+
data={filtered_channels.sort((a,b) => a.name.localeCompare(b.name))}
|
|
56
|
+
renderItem={renderChannels}
|
|
57
|
+
keyExtractor={(item) => item.id}
|
|
58
|
+
/>
|
|
59
|
+
</View>
|
|
60
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
61
|
+
<Button
|
|
62
|
+
type='close'
|
|
63
|
+
title='CLOSE'
|
|
64
|
+
style={{ flex:1 }}
|
|
65
|
+
onPress={() => onClose()}
|
|
66
|
+
/>
|
|
67
|
+
</View>
|
|
68
|
+
</View>
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default ServerInfoCard
|