be-components 7.0.4 → 7.0.6
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/Competition/index.js +12 -1
- package/lib/commonjs/Competition/index.js.map +1 -1
- package/lib/commonjs/CompetitionManager/api/index.js +0 -1
- package/lib/commonjs/CompetitionManager/api/index.js.map +1 -1
- package/lib/commonjs/Discord/api/index.js +61 -0
- package/lib/commonjs/Discord/api/index.js.map +1 -0
- package/lib/commonjs/Discord/index.js +516 -0
- package/lib/commonjs/Discord/index.js.map +1 -0
- package/lib/commonjs/Squares/index.js +65 -2
- package/lib/commonjs/Squares/index.js.map +1 -1
- package/lib/commonjs/SquaresManager/index.js +1 -1
- package/lib/commonjs/SquaresManager/index.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/types.d.js +2 -0
- package/lib/commonjs/types.d.js.map +1 -1
- package/lib/module/Competition/index.js +12 -1
- package/lib/module/Competition/index.js.map +1 -1
- package/lib/module/CompetitionManager/api/index.js +0 -1
- package/lib/module/CompetitionManager/api/index.js.map +1 -1
- package/lib/module/Discord/api/index.js +54 -0
- package/lib/module/Discord/api/index.js.map +1 -0
- package/lib/module/Discord/index.js +509 -0
- package/lib/module/Discord/index.js.map +1 -0
- package/lib/module/Squares/index.js +65 -2
- package/lib/module/Squares/index.js.map +1 -1
- package/lib/module/SquaresManager/index.js +1 -1
- package/lib/module/SquaresManager/index.js.map +1 -1
- package/lib/module/index.js +2 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/types.d.js +2 -0
- package/lib/module/types.d.js.map +1 -1
- package/lib/typescript/lib/commonjs/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/CompetitionManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Discord/api/index.d.ts +9 -0
- package/lib/typescript/lib/commonjs/Discord/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Discord/index.d.ts +11 -0
- package/lib/typescript/lib/commonjs/Discord/index.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Squares/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Squares/index.d.ts.map +1 -1
- 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/Competition/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/CompetitionManager/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Discord/api/index.d.ts +8 -0
- package/lib/typescript/lib/module/Discord/api/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/Discord/index.d.ts +11 -0
- package/lib/typescript/lib/module/Discord/index.d.ts.map +1 -0
- package/lib/typescript/lib/module/Squares/index.d.ts +2 -1
- package/lib/typescript/lib/module/Squares/index.d.ts.map +1 -1
- 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/Competition/index.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Discord/api/index.d.ts +9 -0
- package/lib/typescript/src/Discord/api/index.d.ts.map +1 -0
- package/lib/typescript/src/Discord/index.d.ts +13 -0
- package/lib/typescript/src/Discord/index.d.ts.map +1 -0
- package/lib/typescript/src/Squares/index.d.ts +2 -1
- package/lib/typescript/src/Squares/index.d.ts.map +1 -1
- 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/Competition/index.tsx +8 -1
- package/src/CompetitionManager/api/index.ts +0 -1
- package/src/Discord/api/index.ts +57 -0
- package/src/Discord/index.tsx +300 -0
- package/src/Squares/index.tsx +34 -2
- package/src/SquaresManager/index.tsx +1 -1
- package/src/index.tsx +2 -0
- package/src/types.d.ts +15 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ViewStyle } from 'react-native';
|
|
3
|
+
type DiscordConnectionManagerProps = {
|
|
4
|
+
player_id?: string;
|
|
5
|
+
refresh_key?: string;
|
|
6
|
+
header_style?: ViewStyle;
|
|
7
|
+
float?: boolean;
|
|
8
|
+
footer_style?: ViewStyle;
|
|
9
|
+
onRequestAuthenticate: () => void;
|
|
10
|
+
};
|
|
11
|
+
declare const DiscordConnectionManager: ({ player_id, refresh_key, header_style, footer_style, float, onRequestAuthenticate }: DiscordConnectionManagerProps) => React.JSX.Element;
|
|
12
|
+
export default DiscordConnectionManager;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Discord/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAK/D,KAAK,6BAA6B,GAAG;IACjC,SAAS,CAAC,EAAC,MAAM,CAAC;IAClB,WAAW,CAAC,EAAC,MAAM,CAAC;IACpB,YAAY,CAAC,EAAC,SAAS,CAAC;IACxB,KAAK,CAAC,EAAC,OAAO,CAAC;IACf,YAAY,CAAC,EAAC,SAAS,CAAC;IACxB,qBAAqB,EAAE,MAAM,IAAI,CAAA;CACpC,CAAA;AAGD,QAAA,MAAM,wBAAwB,GAAI,sFAAqF,6BAA6B,sBAsRnJ,CAAA;AAED,eAAe,wBAAwB,CAAA"}
|
|
@@ -4,6 +4,7 @@ type SquaresModuleProps = {
|
|
|
4
4
|
player_id?: string;
|
|
5
5
|
distinct_id: string;
|
|
6
6
|
info_header?: boolean;
|
|
7
|
+
onClose: () => void;
|
|
7
8
|
view_mode: 'desktop' | 'mobile';
|
|
8
9
|
sq_comp_id: string;
|
|
9
10
|
onManageSquares?: (sc: SquaresCompetitionProps) => void;
|
|
@@ -16,6 +17,6 @@ type SquaresModuleProps = {
|
|
|
16
17
|
onPlayerSelect: (player: PublicPlayerProps) => void;
|
|
17
18
|
onEvent: (ev: BEEventProps) => void;
|
|
18
19
|
};
|
|
19
|
-
declare const SquaresModule: ({ sq_comp_id, info_header, view_mode, insets, player_id, distinct_id, onManageSquares, onRequestAuthenticate, onShareCompetition, onPlayerSelect }: SquaresModuleProps) => React.JSX.Element;
|
|
20
|
+
declare const SquaresModule: ({ sq_comp_id, info_header, view_mode, insets, player_id, distinct_id, onClose, onManageSquares, onRequestAuthenticate, onShareCompetition, onPlayerSelect }: SquaresModuleProps) => React.JSX.Element;
|
|
20
21
|
export default SquaresModule;
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Squares/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,KAAK,EAAE,YAAY,EAA+G,iBAAiB,EAAsE,uBAAuB,EAAwC,MAAM,UAAU,CAAA;AAoB/S,KAAK,kBAAkB,GAAG;IACtB,SAAS,CAAC,EAAC,MAAM,CAAC;IAClB,WAAW,EAAC,MAAM,CAAC;IACnB,WAAW,CAAC,EAAC,OAAO,CAAC;IACrB,SAAS,EAAC,SAAS,GAAC,QAAQ,CAAC;IAC7B,UAAU,EAAC,MAAM,CAAC;IAClB,eAAe,CAAC,EAAC,CAAC,EAAE,EAAC,uBAAuB,KAAK,IAAI,CAAC;IACtD,MAAM,CAAC,EAAE;QAAE,GAAG,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,MAAM,CAAA;KAAE,CAAC;IACvC,qBAAqB,EAAE,CAAC,gBAAgB,CAAC,EAAC,MAAM,KAAK,IAAI,CAAC;IAC1D,kBAAkB,EAAC,CAAC,mBAAmB,EAAC,uBAAuB,KAAK,IAAI,CAAC;IACzE,cAAc,EAAC,CAAC,MAAM,EAAC,iBAAiB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAC,CAAC,EAAE,EAAC,YAAY,KAAK,IAAI,CAAA;CACpC,CAAA;AAID,QAAA,MAAM,aAAa,GAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Squares/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,KAAK,EAAE,YAAY,EAA+G,iBAAiB,EAAsE,uBAAuB,EAAwC,MAAM,UAAU,CAAA;AAoB/S,KAAK,kBAAkB,GAAG;IACtB,SAAS,CAAC,EAAC,MAAM,CAAC;IAClB,WAAW,EAAC,MAAM,CAAC;IACnB,WAAW,CAAC,EAAC,OAAO,CAAC;IACrB,OAAO,EAAC,MAAM,IAAI,CAAC;IACnB,SAAS,EAAC,SAAS,GAAC,QAAQ,CAAC;IAC7B,UAAU,EAAC,MAAM,CAAC;IAClB,eAAe,CAAC,EAAC,CAAC,EAAE,EAAC,uBAAuB,KAAK,IAAI,CAAC;IACtD,MAAM,CAAC,EAAE;QAAE,GAAG,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,MAAM,CAAA;KAAE,CAAC;IACvC,qBAAqB,EAAE,CAAC,gBAAgB,CAAC,EAAC,MAAM,KAAK,IAAI,CAAC;IAC1D,kBAAkB,EAAC,CAAC,mBAAmB,EAAC,uBAAuB,KAAK,IAAI,CAAC;IACzE,cAAc,EAAC,CAAC,MAAM,EAAC,iBAAiB,KAAK,IAAI,CAAC;IAClD,OAAO,EAAC,CAAC,EAAE,EAAC,YAAY,KAAK,IAAI,CAAA;CACpC,CAAA;AAID,QAAA,MAAM,aAAa,GAAI,6JAA4J,kBAAkB,sBA6sBpM,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -59,5 +59,6 @@ import GroupComponent from './Group';
|
|
|
59
59
|
import CreateGroupWizard from './Group/components/CreateGroupWizard';
|
|
60
60
|
import CreateEngagement from './CreateEngagement';
|
|
61
61
|
import SquaresManager from './SquaresManager';
|
|
62
|
-
|
|
62
|
+
import DiscordConnectionManager from './Discord';
|
|
63
|
+
export { Authenticator, Observer, CreateEngagement, DiscordConnectionManager, BEEventApi, RankingsCard, BELinkApi, 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 };
|
|
63
64
|
//# 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;AAChC,OAAO,Q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AAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,UAAU,EACX,CAAA"}
|
package/package.json
CHANGED
|
@@ -601,7 +601,7 @@ const CompetitionModule = ({ competition_id, view_mode, insets, player_id, confi
|
|
|
601
601
|
renderItem={renderSections}
|
|
602
602
|
/>
|
|
603
603
|
<SocketManager
|
|
604
|
-
subscribed_events={['V1_UPDATE_COMPETITION_RECORDS','V1_UPDATE_COMPETITION_PLAYERS', 'ACTIVATE_COMPETITION']}
|
|
604
|
+
subscribed_events={['V1_UPDATE_COMPETITION_RECORDS','V1_UPDATE_COMPETITION_PLAYERS', 'ACTIVATE_COMPETITION','DELETE_COMPETITION']}
|
|
605
605
|
onConnect={() => {
|
|
606
606
|
if(needs_reload){ getCompetitionFromServer(competition_id); console.log('RELOADING DATA!!!!') }
|
|
607
607
|
}}
|
|
@@ -615,6 +615,13 @@ const CompetitionModule = ({ competition_id, view_mode, insets, player_id, confi
|
|
|
615
615
|
if(comp.competition_id != competition_id){ return } //Not our competition!!!
|
|
616
616
|
getCompetitionFromServer(competition_id);
|
|
617
617
|
break
|
|
618
|
+
case 'DELETE_COMPETITION':
|
|
619
|
+
//competition = message.competition
|
|
620
|
+
let del_comp:CompetitionProps | undefined = event.competition as CompetitionProps | undefined
|
|
621
|
+
if(!del_comp){ return }
|
|
622
|
+
if(del_comp.competition_id != competition_id){ return } //Not our competition!!!
|
|
623
|
+
getCompetitionFromServer(competition_id);
|
|
624
|
+
break
|
|
618
625
|
case 'V1_UPDATE_COMPETITION_PLAYERS':
|
|
619
626
|
let competition_players = event.data as CompetitionPlayerProps[]
|
|
620
627
|
let competition = event.competition as CompetitionProps
|
|
@@ -47,7 +47,6 @@ const ManageCompetitionApi = {
|
|
|
47
47
|
getMyActiveAdminSquares: async():Promise<SquaresCompetitionProps[]> => {
|
|
48
48
|
try {
|
|
49
49
|
const resp = await axios.get(`${TP_SVC_API}/v1/squares/admin/active`);
|
|
50
|
-
console.log(resp.data)
|
|
51
50
|
return resp.data.squares_competitions
|
|
52
51
|
} catch (e) {
|
|
53
52
|
return []
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { APIOverrides } from '../../ApiOverrides';
|
|
4
|
+
import type { DiscordPlayerProps } from '../../types';
|
|
5
|
+
|
|
6
|
+
//let SOCIAL_SVC_API = '';
|
|
7
|
+
//let EVENT_SVC_API = '';
|
|
8
|
+
//let MK_SVC_API = '';
|
|
9
|
+
let AUTH_SVC_API = '';
|
|
10
|
+
//let TP_SVC_API = ''
|
|
11
|
+
|
|
12
|
+
export const DiscordPlayerApi = {
|
|
13
|
+
setEnvironment: () => {
|
|
14
|
+
const endpoints = APIOverrides.getEndpoints();
|
|
15
|
+
//SOCIAL_SVC_API = endpoints['SOCIAL_SVC_API'] as string;
|
|
16
|
+
//EVENT_SVC_API = endpoints['EVENT_SVC_API'] as string;
|
|
17
|
+
//MK_SVC_API = endpoints['MK_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
|
+
},
|
|
21
|
+
getMyDiscordConnection: async():Promise<DiscordPlayerProps | undefined> => {
|
|
22
|
+
try {
|
|
23
|
+
const resp = await axios.get(`${AUTH_SVC_API}/v1/players/discord/me`);
|
|
24
|
+
return resp.data.discord_player
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.log(e);
|
|
27
|
+
return undefined
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
startConnnection: async():Promise<DiscordPlayerProps | undefined> => {
|
|
31
|
+
try {
|
|
32
|
+
const resp = await axios.post(`${AUTH_SVC_API}/v1/players/discord/connect`);
|
|
33
|
+
return resp.data.discord_player
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.log(e)
|
|
36
|
+
return undefined
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
confirmConnection: async():Promise<DiscordPlayerProps | undefined> => {
|
|
41
|
+
try {
|
|
42
|
+
const resp = await axios.post(`${AUTH_SVC_API}/v1/players/discord/confirm`);
|
|
43
|
+
return resp.data.discord_player
|
|
44
|
+
} catch (e) {
|
|
45
|
+
console.log(e);
|
|
46
|
+
return undefined
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
disconnect: async():Promise<DiscordPlayerProps | undefined> => {
|
|
50
|
+
try {
|
|
51
|
+
const resp = await axios.post(`${AUTH_SVC_API}/v1/players/discord/disconnect`);
|
|
52
|
+
return resp.data.discord_player
|
|
53
|
+
} catch (e) {
|
|
54
|
+
return undefined
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Button, Text, View } from "../Components/Themed"
|
|
3
|
+
import { DiscordPlayerApi } from './api';
|
|
4
|
+
import type { DiscordPlayerProps } from '../types';
|
|
5
|
+
import { FlatList, Image, type ViewStyle } from 'react-native';
|
|
6
|
+
import { Icons, Toggle } from '../Components';
|
|
7
|
+
import { useColors } from '../constants/useColors';
|
|
8
|
+
import * as Clipboard from 'expo-clipboard';
|
|
9
|
+
|
|
10
|
+
type DiscordConnectionManagerProps = {
|
|
11
|
+
player_id?:string,
|
|
12
|
+
refresh_key?:string,
|
|
13
|
+
header_style?:ViewStyle,
|
|
14
|
+
float?:boolean,
|
|
15
|
+
footer_style?:ViewStyle,
|
|
16
|
+
onRequestAuthenticate: () => void
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const sections = ['header','toggle', 'logo', 'success', 'step_1','step_2','step_3']
|
|
20
|
+
const DiscordConnectionManager = ({ player_id, refresh_key, header_style, footer_style, float, onRequestAuthenticate }:DiscordConnectionManagerProps) => {
|
|
21
|
+
const Colors = useColors();
|
|
22
|
+
const [ state, setState ] = useState<{
|
|
23
|
+
loading:boolean,
|
|
24
|
+
discord_player?:DiscordPlayerProps,
|
|
25
|
+
active_step:string
|
|
26
|
+
}>({
|
|
27
|
+
loading: false,
|
|
28
|
+
active_step: 'step_1'
|
|
29
|
+
});
|
|
30
|
+
const { loading, discord_player, active_step } = state;
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
DiscordPlayerApi.setEnvironment();
|
|
34
|
+
if(!player_id){ return onRequestAuthenticate() }
|
|
35
|
+
getData();
|
|
36
|
+
},[player_id, refresh_key]);
|
|
37
|
+
|
|
38
|
+
const getData = async() => {
|
|
39
|
+
setState({ ...state, loading:true });
|
|
40
|
+
const dp = await DiscordPlayerApi.getMyDiscordConnection();
|
|
41
|
+
if(!dp){ return alert('Unable to get your connection status') }
|
|
42
|
+
const step = dp.status == 'inactive' ? 'step_1' : dp.status == 'requested' ? 'step_2' : dp.status == 'pending' ? 'step_3' : 'step_1'
|
|
43
|
+
setState({
|
|
44
|
+
...state,
|
|
45
|
+
loading:false,
|
|
46
|
+
discord_player: dp,
|
|
47
|
+
active_step: step
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const handleStartConnection = async() => {
|
|
52
|
+
if(loading){ return }
|
|
53
|
+
setState({ ...state, loading:true });
|
|
54
|
+
const dp = await DiscordPlayerApi.startConnnection();
|
|
55
|
+
if(!dp){
|
|
56
|
+
alert('Unable to process at this time. Please try again')
|
|
57
|
+
getData();
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
setState({
|
|
61
|
+
...state,
|
|
62
|
+
discord_player: dp,
|
|
63
|
+
active_step: 'step_2',
|
|
64
|
+
loading:false
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const handleConfirmConnection = async() => {
|
|
69
|
+
if(loading){ return }
|
|
70
|
+
setState({ ...state, loading:true });
|
|
71
|
+
const dp = await DiscordPlayerApi.confirmConnection();
|
|
72
|
+
if(!dp){
|
|
73
|
+
alert('Unable to process at this time. Please try again')
|
|
74
|
+
getData();
|
|
75
|
+
return
|
|
76
|
+
}
|
|
77
|
+
setState({
|
|
78
|
+
...state,
|
|
79
|
+
discord_player: dp,
|
|
80
|
+
loading:false
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const handleDisconnect = async() => {
|
|
85
|
+
if(loading){ return }
|
|
86
|
+
setState({ ...state, loading:true });
|
|
87
|
+
const dp = await DiscordPlayerApi.disconnect();
|
|
88
|
+
if(!dp){
|
|
89
|
+
alert('Unable to process at this time. Please try again')
|
|
90
|
+
getData();
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
setState({
|
|
94
|
+
...state,
|
|
95
|
+
discord_player: dp,
|
|
96
|
+
loading:false
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
const renderSections = (data:{item:string, index:number}) => {
|
|
102
|
+
switch(data.item){
|
|
103
|
+
case 'header':
|
|
104
|
+
return (
|
|
105
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, ...header_style }}>
|
|
106
|
+
<Image
|
|
107
|
+
source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1758212751/discord_xkfzgw.jpg' }}
|
|
108
|
+
style={{ height:40, width:40 }}
|
|
109
|
+
resizeMode='contain'
|
|
110
|
+
/>
|
|
111
|
+
<View transparent style={{ flex:1, marginLeft:10 }}>
|
|
112
|
+
<Text theme='h1'>Connect Your Discord!</Text>
|
|
113
|
+
<Text theme='description'>Follow the instructions below to authenticate discord with your account</Text>
|
|
114
|
+
</View>
|
|
115
|
+
<Button float style={{ padding:10 }} onPress={() => getData()}>
|
|
116
|
+
<Icons.RefreshIcon size={18} color={Colors.text.h1}/>
|
|
117
|
+
</Button>
|
|
118
|
+
</View>
|
|
119
|
+
)
|
|
120
|
+
case 'toggle':
|
|
121
|
+
if(discord_player?.status == 'active'){ return <></> }
|
|
122
|
+
return (
|
|
123
|
+
<View style={{padding:10}}>
|
|
124
|
+
<Toggle
|
|
125
|
+
options={[
|
|
126
|
+
{ key: 'step_1', label: 'Step 1' },
|
|
127
|
+
{ key: 'step_2', label: 'Step 2' },
|
|
128
|
+
{ key: 'step_3', label: 'Step 3' }
|
|
129
|
+
]}
|
|
130
|
+
selected_option={active_step}
|
|
131
|
+
onSelectOption={(step) => setState({ ...state, active_step:step })}
|
|
132
|
+
/>
|
|
133
|
+
</View>
|
|
134
|
+
)
|
|
135
|
+
case 'success':
|
|
136
|
+
if(discord_player?.status != 'active'){ return <></> }
|
|
137
|
+
return (
|
|
138
|
+
<View style={{ padding:10 }}>
|
|
139
|
+
<View float style={{ padding:2, backgroundColor: '#7289da', borderRadius:100, alignSelf:'center' }}>
|
|
140
|
+
{discord_player.image?
|
|
141
|
+
<Image
|
|
142
|
+
source={{ uri: discord_player.image.url }}
|
|
143
|
+
style={{ height:125, width:125, borderRadius:100 }}
|
|
144
|
+
resizeMode='cover'
|
|
145
|
+
/>
|
|
146
|
+
:
|
|
147
|
+
<Image
|
|
148
|
+
source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1758213727/discord-logo_zsufoi.png' }}
|
|
149
|
+
style={{ height:125, width:125, borderRadius:100 }}
|
|
150
|
+
resizeMode='cover'
|
|
151
|
+
/>
|
|
152
|
+
}
|
|
153
|
+
</View>
|
|
154
|
+
<View float style={{ marginTop:40}}>
|
|
155
|
+
<View transparent style={{ flexDirection:'row', alignItems:'center', padding:10}}>
|
|
156
|
+
{discord_player.image?
|
|
157
|
+
<Image
|
|
158
|
+
source={{ uri: discord_player.image.url }}
|
|
159
|
+
style={{ height:50, width:50, borderRadius:100 }}
|
|
160
|
+
resizeMode='cover'
|
|
161
|
+
/>
|
|
162
|
+
:
|
|
163
|
+
<Image
|
|
164
|
+
source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1758213727/discord-logo_zsufoi.png' }}
|
|
165
|
+
style={{ height:50, width:50, borderRadius:100 }}
|
|
166
|
+
resizeMode='cover'
|
|
167
|
+
/>
|
|
168
|
+
}
|
|
169
|
+
<View transparent style={{ flex:1, marginLeft:10, marginRight:10 }}>
|
|
170
|
+
<Text theme='h1' size={18}>@{discord_player.username}</Text>
|
|
171
|
+
<Text theme='success' style={{ marginTop:5 }}>CONNECTED</Text>
|
|
172
|
+
</View>
|
|
173
|
+
<Icons.CheckCirlceIcon color={Colors.text.success} size={20} />
|
|
174
|
+
</View>
|
|
175
|
+
</View>
|
|
176
|
+
</View>
|
|
177
|
+
)
|
|
178
|
+
case 'logo':
|
|
179
|
+
if(discord_player?.status == 'active'){ return <></> }
|
|
180
|
+
return (
|
|
181
|
+
<View transparent style={{ flexDirection:'row', paddingLeft:10, paddingRight:10 }}>
|
|
182
|
+
{active_step == 'step_2' ?
|
|
183
|
+
<View style={{ flex:1 }} />
|
|
184
|
+
:active_step == 'step_3' ?
|
|
185
|
+
<View style={{ flex:2 }} />
|
|
186
|
+
:<></>}
|
|
187
|
+
<View style={{ flex:1, justifyContent:'center', alignItems:'center' }}>
|
|
188
|
+
<View float style={{ padding:10, backgroundColor: '#7289da', borderRadius:100 }}>
|
|
189
|
+
<Image
|
|
190
|
+
source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/v1758213727/discord-logo_zsufoi.png' }}
|
|
191
|
+
style={{ height:50, width:50, borderRadius:100 }}
|
|
192
|
+
resizeMode='cover'
|
|
193
|
+
/>
|
|
194
|
+
</View>
|
|
195
|
+
</View>
|
|
196
|
+
{active_step == 'step_1' ?
|
|
197
|
+
<View style={{ flex:2 }} />
|
|
198
|
+
:active_step == 'step_2' ?
|
|
199
|
+
<View style={{ flex:1 }} />
|
|
200
|
+
:<></>}
|
|
201
|
+
</View>
|
|
202
|
+
)
|
|
203
|
+
case 'step_1':
|
|
204
|
+
if(active_step != 'step_1'){ return <></> }
|
|
205
|
+
if(discord_player && discord_player.status == 'active'){ return <></> }
|
|
206
|
+
return (
|
|
207
|
+
<View float style={{ padding:20, margin:10, justifyContent:'center', alignItems:'center' }}>
|
|
208
|
+
<Text theme='h1' size={20} style={{ marginTop:20 }} textAlign='center'>Press Start Connection below</Text>
|
|
209
|
+
<Text theme='h1' size={20} style={{ marginTop:20 }} textAlign='center'>You’ll get a temporary code valid for 10 minutes</Text>
|
|
210
|
+
<Text theme='h1' size={20} style={{ marginTop:20 }} textAlign='center'>Keep this code handy—you’ll need it in Discord</Text>
|
|
211
|
+
</View>
|
|
212
|
+
)
|
|
213
|
+
case 'step_2':
|
|
214
|
+
if(active_step != 'step_2' || !discord_player){ return <></> }
|
|
215
|
+
if(discord_player?.status == 'active'){ return <></> }
|
|
216
|
+
return (
|
|
217
|
+
<View float style={{ padding:20, margin:10, justifyContent:'center', alignItems:'center' }}>
|
|
218
|
+
<Text theme='h1' size={20} style={{ marginTop:20 }} textAlign='center'>Open Discord where the bot is installed.</Text>
|
|
219
|
+
<Text theme='h1' size={20} style={{ marginTop:20 }} textAlign='center'>Use the slash command{'\n'} /connect {discord_player.auth_code}</Text>
|
|
220
|
+
<Text theme='h1' size={20} style={{ marginTop:20 }} textAlign='center'>Make sure to enter the code exactly as shown. It will expire in 10 minutes</Text>
|
|
221
|
+
</View>
|
|
222
|
+
)
|
|
223
|
+
case 'step_3':
|
|
224
|
+
if(active_step != 'step_3' || !discord_player){ return <></> }
|
|
225
|
+
if(discord_player?.status == 'active'){ return <></> }
|
|
226
|
+
return (
|
|
227
|
+
<View float style={{ padding:20, margin:10, justifyContent:'center', alignItems:'center' }}>
|
|
228
|
+
<Text theme='h1' size={20} style={{ marginTop:20 }} textAlign='center'>Once Validated, you can confirm the connection</Text>
|
|
229
|
+
<Text theme='h1' size={20} style={{ marginTop:20 }} textAlign='center'>Press confirm connection below.</Text>
|
|
230
|
+
<Text theme='h1' size={20} style={{ marginTop:20 }} textAlign='center'>Once confirmed, you can use authenticated commands in descord!</Text>
|
|
231
|
+
</View>
|
|
232
|
+
)
|
|
233
|
+
default: return <></>
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return (
|
|
238
|
+
<View float={float} style={{ flex:1 }}>
|
|
239
|
+
<FlatList
|
|
240
|
+
data={sections}
|
|
241
|
+
key={'discord_connection_sections'}
|
|
242
|
+
keyExtractor={item => item}
|
|
243
|
+
renderItem={renderSections}
|
|
244
|
+
/>
|
|
245
|
+
{discord_player ?
|
|
246
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, ...footer_style }}>
|
|
247
|
+
{discord_player.status == 'inactive' ?
|
|
248
|
+
<Button
|
|
249
|
+
title='START CONNECTION'
|
|
250
|
+
title_color={Colors.text.white}
|
|
251
|
+
backgroundColor='#7289da'
|
|
252
|
+
loading={loading}
|
|
253
|
+
style={{ flex:1 }}
|
|
254
|
+
onPress={() => handleStartConnection()}
|
|
255
|
+
/>
|
|
256
|
+
:discord_player.status == 'requested' ?
|
|
257
|
+
<Button
|
|
258
|
+
type='text'
|
|
259
|
+
loading={loading}
|
|
260
|
+
style={{ flex:1, alignItems:'center', justifyContent:'center' }}
|
|
261
|
+
onPress={async() => {
|
|
262
|
+
if(!discord_player.auth_code){ return }
|
|
263
|
+
await Clipboard.setStringAsync(discord_player.auth_code)
|
|
264
|
+
alert('Code copied to clipboard')
|
|
265
|
+
}}>
|
|
266
|
+
<Text theme='action' size={14}>Press to Copy: {discord_player.auth_code}</Text>
|
|
267
|
+
</Button>
|
|
268
|
+
:discord_player.status == 'pending' ?
|
|
269
|
+
<Button
|
|
270
|
+
title='CONFIRM CONNECTION'
|
|
271
|
+
type='success'
|
|
272
|
+
loading={loading}
|
|
273
|
+
style={{ flex:1 }}
|
|
274
|
+
onPress={() => handleConfirmConnection()}
|
|
275
|
+
/>
|
|
276
|
+
:discord_player.status == 'active'?
|
|
277
|
+
<Button
|
|
278
|
+
title='DISCONNECT'
|
|
279
|
+
type='error'
|
|
280
|
+
loading={loading}
|
|
281
|
+
style={{ flex:1 }}
|
|
282
|
+
onPress={() => handleDisconnect()}
|
|
283
|
+
/>
|
|
284
|
+
:<></>}
|
|
285
|
+
</View>
|
|
286
|
+
:
|
|
287
|
+
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:10, ...footer_style }}>
|
|
288
|
+
<Button
|
|
289
|
+
type='success'
|
|
290
|
+
style={{ flex:1 }}
|
|
291
|
+
title='LOG IN FIRST'
|
|
292
|
+
onPress={() => onRequestAuthenticate()}
|
|
293
|
+
/>
|
|
294
|
+
</View>
|
|
295
|
+
}
|
|
296
|
+
</View>
|
|
297
|
+
)
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export default DiscordConnectionManager
|
package/src/Squares/index.tsx
CHANGED
|
@@ -24,6 +24,7 @@ type SquaresModuleProps = {
|
|
|
24
24
|
player_id?:string,
|
|
25
25
|
distinct_id:string,
|
|
26
26
|
info_header?:boolean,
|
|
27
|
+
onClose:() => void,
|
|
27
28
|
view_mode:'desktop'|'mobile',
|
|
28
29
|
sq_comp_id:string,
|
|
29
30
|
onManageSquares?:(sc:SquaresCompetitionProps) => void,
|
|
@@ -36,7 +37,7 @@ type SquaresModuleProps = {
|
|
|
36
37
|
|
|
37
38
|
const squares_sections = ['header', 'activate', 'offers', 'toggle', 'event', 'board', 'board_stats', 'my_stats', 'results', 'my_squares', 'winners','hidden_prizes','details', 'owners']
|
|
38
39
|
|
|
39
|
-
const SquaresModule = ({ sq_comp_id, info_header, view_mode, insets, player_id, distinct_id, onManageSquares, onRequestAuthenticate, onShareCompetition, onPlayerSelect }:SquaresModuleProps) => {
|
|
40
|
+
const SquaresModule = ({ sq_comp_id, info_header, view_mode, insets, player_id, distinct_id, onClose, onManageSquares, onRequestAuthenticate, onShareCompetition, onPlayerSelect }:SquaresModuleProps) => {
|
|
40
41
|
const C = useColors();
|
|
41
42
|
const [ active_tab, setActiveTab ] = useState('board');
|
|
42
43
|
const [ needs_reload, setNeedsReload ] = useState(false);
|
|
@@ -614,6 +615,30 @@ const SquaresModule = ({ sq_comp_id, info_header, view_mode, insets, player_id,
|
|
|
614
615
|
renderItem={renderSections}
|
|
615
616
|
keyExtractor={(item) => item}
|
|
616
617
|
/>
|
|
618
|
+
{squares_competition?.status == 'archived' ?
|
|
619
|
+
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, justifyContent:'center', alignItems:'center' }}>
|
|
620
|
+
<View float style={{ width: '70%' }}>
|
|
621
|
+
<View type='header' style={{ justifyContent:'center', alignItems:'center', padding:10 }}>
|
|
622
|
+
<Text theme='h1'>Competition Has Been Deleted</Text>
|
|
623
|
+
</View>
|
|
624
|
+
<View style={{ padding:10, justifyContent:'center', alignItems:'center' }}>
|
|
625
|
+
<Image
|
|
626
|
+
source={{ uri: squares_competition.image?.url }}
|
|
627
|
+
style={{ height:75, width: 75 }}
|
|
628
|
+
resizeMode='cover'
|
|
629
|
+
/>
|
|
630
|
+
<Text theme='h1'>{squares_competition.sq_comp_name}</Text>
|
|
631
|
+
</View>
|
|
632
|
+
<View type='footer' style={{ padding:10 }}>
|
|
633
|
+
<Button
|
|
634
|
+
title='CLOSE'
|
|
635
|
+
type='close'
|
|
636
|
+
onPress={() => onClose()}
|
|
637
|
+
/>
|
|
638
|
+
</View>
|
|
639
|
+
</View>
|
|
640
|
+
</View>
|
|
641
|
+
:<></>}
|
|
617
642
|
</View>
|
|
618
643
|
|
|
619
644
|
<SocketManager
|
|
@@ -641,10 +666,17 @@ const SquaresModule = ({ sq_comp_id, info_header, view_mode, insets, player_id,
|
|
|
641
666
|
if(socket_comp.sq_comp_id != sq_comp_id){ return } //Dont do anything here
|
|
642
667
|
getDataFromServer(sq_comp_id, {});
|
|
643
668
|
break;
|
|
669
|
+
case 'DELETE_SQUARES':
|
|
670
|
+
//When activated - we should just reload the modules
|
|
671
|
+
let delete_comp = ev.squares_competition as SquaresCompetitionProps
|
|
672
|
+
if(!delete_comp){return}
|
|
673
|
+
if(delete_comp.sq_comp_id != sq_comp_id){ return } //Dont do anything here
|
|
674
|
+
getDataFromServer(sq_comp_id, {});
|
|
675
|
+
break;
|
|
644
676
|
default: break;
|
|
645
677
|
}
|
|
646
678
|
}}
|
|
647
|
-
subscribed_events={['V1_UPDATE_SQUARE_DETAILS', 'ACTIVATE_SQUARES']}
|
|
679
|
+
subscribed_events={['V1_UPDATE_SQUARE_DETAILS', 'ACTIVATE_SQUARES', 'DELETE_SQUARES']}
|
|
648
680
|
/>
|
|
649
681
|
<Modal
|
|
650
682
|
transparent
|
|
@@ -403,7 +403,7 @@ const SquaresManager = ({ sq_comp_id, float, player, header_style, onFocusPositi
|
|
|
403
403
|
<View transparent style={{ marginTop:20 }}>
|
|
404
404
|
<FlatList
|
|
405
405
|
data={leagues.sort((a,b) => a.priority - b.priority)}
|
|
406
|
-
key={'
|
|
406
|
+
key={'competition_leagues_list'}
|
|
407
407
|
keyExtractor={item => item.league_id.toString()}
|
|
408
408
|
renderItem={renderLeagues}
|
|
409
409
|
/>
|
package/src/index.tsx
CHANGED
|
@@ -61,10 +61,12 @@ import GroupComponent from './Group';
|
|
|
61
61
|
import CreateGroupWizard from './Group/components/CreateGroupWizard';
|
|
62
62
|
import CreateEngagement from './CreateEngagement';
|
|
63
63
|
import SquaresManager from './SquaresManager';
|
|
64
|
+
import DiscordConnectionManager from './Discord';
|
|
64
65
|
export {
|
|
65
66
|
Authenticator,
|
|
66
67
|
Observer,
|
|
67
68
|
CreateEngagement,
|
|
69
|
+
DiscordConnectionManager,
|
|
68
70
|
BEEventApi,
|
|
69
71
|
RankingsCard,
|
|
70
72
|
BELinkApi,
|
package/src/types.d.ts
CHANGED
|
@@ -132,7 +132,21 @@ export interface PublicPlayerProps {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
//DiscordPlayer
|
|
136
|
+
export interface DiscordPlayerProps {
|
|
137
|
+
discord_player_id:string,
|
|
138
|
+
player_id:string,
|
|
139
|
+
discord_id?:string,
|
|
140
|
+
token?: string,
|
|
141
|
+
username?:string,
|
|
142
|
+
image?:{url:string},
|
|
143
|
+
refresh_token?:string,
|
|
144
|
+
status: 'active'|'inactive'|'requested'|'pending',
|
|
145
|
+
auth_code?: string,
|
|
146
|
+
expire_time?: any,
|
|
147
|
+
create_datetime:any,
|
|
148
|
+
last_update_datetime:any
|
|
149
|
+
}
|
|
136
150
|
|
|
137
151
|
export interface GolfLeaderProps {
|
|
138
152
|
tournament_id:string,
|