be-components 6.7.0 → 6.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/Group/api/index.js +75 -0
- package/lib/commonjs/Group/api/index.js.map +1 -1
- package/lib/commonjs/Group/components/CreateGroupWizard.js +605 -0
- package/lib/commonjs/Group/components/CreateGroupWizard.js.map +1 -0
- package/lib/commonjs/Group/components/GroupPlayerActionForm.js +17 -4
- package/lib/commonjs/Group/components/GroupPlayerActionForm.js.map +1 -1
- package/lib/commonjs/Group/index.js +2 -0
- package/lib/commonjs/Group/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.map +1 -1
- package/lib/module/Group/api/index.js +75 -0
- package/lib/module/Group/api/index.js.map +1 -1
- package/lib/module/Group/components/CreateGroupWizard.js +597 -0
- package/lib/module/Group/components/CreateGroupWizard.js.map +1 -0
- package/lib/module/Group/components/GroupPlayerActionForm.js +17 -4
- package/lib/module/Group/components/GroupPlayerActionForm.js.map +1 -1
- package/lib/module/Group/index.js +2 -0
- package/lib/module/Group/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.map +1 -1
- package/lib/typescript/lib/commonjs/Group/api/index.d.ts +21 -0
- package/lib/typescript/lib/commonjs/Group/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Group/components/CreateGroupWizard.d.ts +13 -0
- package/lib/typescript/lib/commonjs/Group/components/CreateGroupWizard.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/Group/components/GroupPlayerActionForm.d.ts +3 -1
- package/lib/typescript/lib/commonjs/Group/components/GroupPlayerActionForm.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Group/index.d.ts +2 -1
- package/lib/typescript/lib/commonjs/Group/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/Group/api/index.d.ts +21 -0
- package/lib/typescript/lib/module/Group/api/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Group/components/CreateGroupWizard.d.ts +13 -0
- package/lib/typescript/lib/module/Group/components/CreateGroupWizard.d.ts.map +1 -0
- package/lib/typescript/lib/module/Group/components/GroupPlayerActionForm.d.ts +3 -1
- package/lib/typescript/lib/module/Group/components/GroupPlayerActionForm.d.ts.map +1 -1
- package/lib/typescript/lib/module/Group/index.d.ts +2 -1
- package/lib/typescript/lib/module/Group/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/Group/api/index.d.ts +6 -1
- package/lib/typescript/src/Group/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Group/components/CreateGroupWizard.d.ts +16 -0
- package/lib/typescript/src/Group/components/CreateGroupWizard.d.ts.map +1 -0
- package/lib/typescript/src/Group/components/GroupPlayerActionForm.d.ts +3 -2
- package/lib/typescript/src/Group/components/GroupPlayerActionForm.d.ts.map +1 -1
- package/lib/typescript/src/Group/index.d.ts +2 -1
- package/lib/typescript/src/Group/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/Group/api/index.ts +62 -2
- package/src/Group/components/CreateGroupWizard.tsx +380 -0
- package/src/Group/components/GroupPlayerActionForm.tsx +16 -6
- package/src/Group/index.tsx +3 -1
- package/src/index.tsx +2 -1
- package/src/types.d.ts +7 -0
|
@@ -9,12 +9,13 @@ type GroupComponentProps = {
|
|
|
9
9
|
onNudgePlayer: (p: PublicPlayerProps, gp: GroupPlayerProps) => void;
|
|
10
10
|
onSelectPlayer: (p: PublicPlayerProps) => void;
|
|
11
11
|
onSelectCompetition: (c: CompetitionProps) => void;
|
|
12
|
+
onRequestAuthenticate: () => void;
|
|
12
13
|
onSelectPollCampaign: (pc: PollCampaignProps) => void;
|
|
13
14
|
onSelectSquaresCompetition: (sq: SquaresCompetitionProps) => void;
|
|
14
15
|
onCreateEngagement?: (g: GroupProps) => void;
|
|
15
16
|
onShareGroup?: (g: GroupProps) => void;
|
|
16
17
|
player?: MyPlayerProps;
|
|
17
18
|
};
|
|
18
|
-
declare const GroupComponent: ({ refresh_key, group_id, player, mode, onCreateEngagement, onShareGroup, onInvitePlayer, onSelectCompetition, onSelectChat, onSelectPlayer, onNudgePlayer, onSelectPollCampaign, onSelectSquaresCompetition }: GroupComponentProps) => React.JSX.Element;
|
|
19
|
+
declare const GroupComponent: ({ refresh_key, group_id, player, mode, onCreateEngagement, onRequestAuthenticate, onShareGroup, onInvitePlayer, onSelectCompetition, onSelectChat, onSelectPlayer, onNudgePlayer, onSelectPollCampaign, onSelectSquaresCompetition }: GroupComponentProps) => React.JSX.Element;
|
|
19
20
|
export default GroupComponent;
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Group/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,KAAK,EAAsD,gBAAgB,EAAmI,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAwD,iBAAiB,EAAa,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAenZ,KAAK,mBAAmB,GAAG;IACvB,QAAQ,EAAC,MAAM,CAAC;IAChB,IAAI,EAAC,SAAS,GAAC,QAAQ,CAAC;IACxB,WAAW,EAAC,MAAM,CAAC;IACnB,YAAY,CAAC,EAAC,CAAC,KAAK,EAAC,UAAU,KAAK,IAAI,CAAA;IACxC,cAAc,EAAC,MAAM,IAAI,CAAC;IAC1B,aAAa,EAAC,CAAC,CAAC,EAAC,iBAAiB,EAAE,EAAE,EAAC,gBAAgB,KAAK,IAAI,CAAC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C,oBAAoB,EAAC,CAAC,EAAE,EAAC,iBAAiB,KAAK,IAAI,CAAC;IACpD,0BAA0B,EAAC,CAAC,EAAE,EAAC,uBAAuB,KAAK,IAAI,CAAC;IAChE,kBAAkB,CAAC,EAAE,CAAC,CAAC,EAAC,UAAU,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAC,CAAC,CAAC,EAAC,UAAU,KAAK,IAAI,CAAC;IACrC,MAAM,CAAC,EAAC,aAAa,CAAA;CACxB,CAAA;AA8BD,QAAA,MAAM,cAAc,GAAI,sOAAuO,mBAAmB,sBAknBjR,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -56,5 +56,6 @@ import ClaritySmartEvents from './Clarity/SmartEvents';
|
|
|
56
56
|
import RankingsCard from './RankingsCard';
|
|
57
57
|
import GuideView from './Guide';
|
|
58
58
|
import GroupComponent from './Group';
|
|
59
|
-
|
|
59
|
+
import CreateGroupWizard from './Group/components/CreateGroupWizard';
|
|
60
|
+
export { Authenticator, Observer, BEEventApi, RankingsCard, BELinkApi, 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 };
|
|
60
61
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"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AiB,MAAM,sCAAsC,CAAC;AACrE,OAAO,EACL,aAAa,EACb,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EACf,SAAS,EACT,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,4BAA4B,EAC5B,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,QAAQ,EACR,WAAW,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
package/src/Group/api/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios from "axios";
|
|
2
2
|
import { APIOverrides } from "../../ApiOverrides"
|
|
3
|
-
import type { BracketCompetitionProps, CompetitionPayoutTypeProps, CompetitionPlayerProps, CompetitionProps, CompetitionRecordProps, CompetitionResultProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, EventProps, GroupMessageProps, GroupPlayerProps, GroupProps, NewOverallAnalytics, OrderAnalyticsProps, OrderProps, PollCampaignProps, PostProps, PublicPlayerProps, SquaresCompetitionProps } from "../../types";
|
|
3
|
+
import type { BracketCompetitionProps, CompetitionPayoutTypeProps, CompetitionPlayerProps, CompetitionProps, CompetitionRecordProps, CompetitionResultProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps, CreateGroupStepProps, EventProps, GroupMessageProps, GroupPlayerProps, GroupProps, NewOverallAnalytics, OrderAnalyticsProps, OrderProps, PollCampaignProps, PostProps, PublicPlayerProps, SquaresCompetitionProps } from "../../types";
|
|
4
4
|
import type { Moment } from "moment-mini";
|
|
5
5
|
import moment from "moment-mini";
|
|
6
6
|
|
|
@@ -21,6 +21,33 @@ const GroupApi = {
|
|
|
21
21
|
AUTH_SVC_API = endpoints['AUTH_SVC_API'] as string;
|
|
22
22
|
SOCIAL_SVC_API = endpoints['SOCIAL_SVC_API'] as string;
|
|
23
23
|
},
|
|
24
|
+
createGroup: async(name?:string, description?:string, invite_code?:string):Promise<GroupProps | undefined> => {
|
|
25
|
+
try {
|
|
26
|
+
const resp = await axios.post(`${SOCIAL_SVC_API}/v2/groups/group/create`, { name, description, invite_code });
|
|
27
|
+
return resp.data.group
|
|
28
|
+
} catch (e) {
|
|
29
|
+
console.log(e)
|
|
30
|
+
return undefined
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
activateGroup: async(group_id:string):Promise<GroupProps | undefined> => {
|
|
34
|
+
try {
|
|
35
|
+
const resp = await axios.post(`${SOCIAL_SVC_API}/v2/groups/group/activate`, { group_id });
|
|
36
|
+
return resp.data.group
|
|
37
|
+
} catch (e) {
|
|
38
|
+
console.log(e)
|
|
39
|
+
return undefined
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
deleteGroup: async(group_id:string):Promise<GroupProps|undefined> => {
|
|
43
|
+
try {
|
|
44
|
+
const resp = await axios.post(`${SOCIAL_SVC_API}/v2/groups/group/delete`, { group_id });
|
|
45
|
+
return resp.data.group
|
|
46
|
+
} catch (e) {
|
|
47
|
+
console.log(e)
|
|
48
|
+
return undefined
|
|
49
|
+
}
|
|
50
|
+
},
|
|
24
51
|
getGroupById: async(group_id:string):Promise<undefined|{ group:GroupProps, group_messages:GroupMessageProps[], group_players:GroupPlayerProps[], my_group_player?:GroupPlayerProps }> => {
|
|
25
52
|
try {
|
|
26
53
|
const resp = await axios.get(`${SOCIAL_SVC_API}/v2/groups/group/${group_id}`);
|
|
@@ -216,7 +243,40 @@ const GroupHelpers = {
|
|
|
216
243
|
poll_campaigns.map(pc => data.push({ id: pc.poll_campaign_id, type: 'poll_campaign', scheduled_datetime: moment(pc.create_datetime) }));
|
|
217
244
|
return data.sort((a,b) => a.scheduled_datetime.unix() - b.scheduled_datetime.unix())
|
|
218
245
|
},
|
|
219
|
-
|
|
246
|
+
generateGroup: ():GroupProps => {
|
|
247
|
+
return {
|
|
248
|
+
group_id: '',
|
|
249
|
+
description: ``,
|
|
250
|
+
name: '',
|
|
251
|
+
competition_alerts: false,
|
|
252
|
+
position_alerts: false,
|
|
253
|
+
order_alerts: false,
|
|
254
|
+
group_admin: '0',
|
|
255
|
+
group_image: {},
|
|
256
|
+
invite_only: true,
|
|
257
|
+
invite_code: (Math.random()*10000000000).toFixed(),
|
|
258
|
+
leaderboard_ind: false,
|
|
259
|
+
type: 'multiple',
|
|
260
|
+
status:'pending',
|
|
261
|
+
create_datetime: '',
|
|
262
|
+
last_update_datetime: ''
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
isStepValid: (step:CreateGroupStepProps, draft_group:GroupProps):string[] => {
|
|
266
|
+
let errors:string[] = []
|
|
267
|
+
switch(step.step_key){
|
|
268
|
+
case 'info':
|
|
269
|
+
if(!draft_group.name){ errors.push('Please provide a valid name') }
|
|
270
|
+
if(!draft_group.description){ errors.push('Please provide a description') }
|
|
271
|
+
break
|
|
272
|
+
case 'image':
|
|
273
|
+
if(!draft_group.group_image?.url){ errors.push('Please add an image to continue') }
|
|
274
|
+
break
|
|
275
|
+
default: break
|
|
276
|
+
}
|
|
277
|
+
return errors
|
|
278
|
+
},
|
|
279
|
+
aggregateAnalytics: (analytics:OrderAnalyticsProps[]):NewOverallAnalytics => {
|
|
220
280
|
const wins = analytics.reduce((a,b) => a + b.wins, 0);
|
|
221
281
|
const losses = analytics.reduce((a,b) => a + b.losses, 0);
|
|
222
282
|
const draws = analytics.reduce((a,b) => a + b.draws, 0);
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Button, Text, TextInput, View } from "../../Components/Themed";
|
|
3
|
+
import { FlatList, Image, type ViewStyle } from 'react-native';
|
|
4
|
+
import type { CreateGroupStepProps, GroupPlayerProps, GroupProps, MyPlayerProps, PublicPlayerProps } from '../../types';
|
|
5
|
+
import { Icons } from '../../Components';
|
|
6
|
+
import { useColors } from '../../constants/useColors';
|
|
7
|
+
import { GroupApi, GroupHelpers } from '../api';
|
|
8
|
+
import ImageUploader from '../../Components/ImageUploader';
|
|
9
|
+
import { showConfirmAlert } from '../../Components/ConfirmAlert';
|
|
10
|
+
|
|
11
|
+
type CreateGroupWizardProps = {
|
|
12
|
+
player:MyPlayerProps,
|
|
13
|
+
refresh_key:string,
|
|
14
|
+
header_style?:ViewStyle,
|
|
15
|
+
footer_style?:ViewStyle,
|
|
16
|
+
onInvitePlayers:() => void,
|
|
17
|
+
onRequestAuthenticate:() => void,
|
|
18
|
+
onClose:() => void,
|
|
19
|
+
onFinish:(group:GroupProps, group_players:GroupPlayerProps[]) => void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const wizard_steps:CreateGroupStepProps[] = [
|
|
25
|
+
{ num: 1, step_key:'intro', title: 'BettorEdge Groups', description: 'Groups bring your group chat, discord server, family banter to real life! Track your friends stats, compete against each other and have fun!' },
|
|
26
|
+
{ num: 2, step_key:'info', title: 'Describe Your Group', description: 'Give this group a name and a description that is unique and will entice players and friends to join!' },
|
|
27
|
+
{ num: 3, step_key: 'image', title: 'Add a fun photo', description: 'Add an image so its easy to recognize your group!' },
|
|
28
|
+
{ num: 4, step_key: 'invite', title: 'Invite Friends!', description: 'Groups are of no use without friends to join! Have a group text, slack, discord? Add them to start competing and smack talking!' },
|
|
29
|
+
{ num: 5, step_key: 'success', title: 'Group Successfully Created!', description: 'Your group has been created successfully! Activate it now and start playing with friends.' }
|
|
30
|
+
]
|
|
31
|
+
const sections = ['header', 'intro', 'info', 'input']
|
|
32
|
+
const CreateGroupWizard = ({ player, refresh_key, header_style, footer_style, onRequestAuthenticate, onClose, onInvitePlayers, onFinish }:CreateGroupWizardProps) => {
|
|
33
|
+
const Colors = useColors();
|
|
34
|
+
const [ wiz_size, setSize ] = useState({ height: 0, width:0 })
|
|
35
|
+
const [ wiz_state, setState ] = useState<{
|
|
36
|
+
loading:boolean,
|
|
37
|
+
active_step: CreateGroupStepProps,
|
|
38
|
+
draft_group:GroupProps,
|
|
39
|
+
group_players:GroupPlayerProps[],
|
|
40
|
+
players:PublicPlayerProps[]
|
|
41
|
+
}>({
|
|
42
|
+
loading:false,
|
|
43
|
+
draft_group: GroupHelpers.generateGroup(),
|
|
44
|
+
group_players: [],
|
|
45
|
+
players:[],
|
|
46
|
+
active_step: wizard_steps[0] as CreateGroupStepProps
|
|
47
|
+
});
|
|
48
|
+
const { active_step, loading, draft_group, group_players, players } = wiz_state;
|
|
49
|
+
const errors = GroupHelpers.isStepValid(active_step, draft_group);
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
GroupApi.setEnvironment();
|
|
53
|
+
refreshData();
|
|
54
|
+
},[refresh_key]);
|
|
55
|
+
|
|
56
|
+
const refreshData = async() => {
|
|
57
|
+
if(!draft_group.group_id){ return } //Group hasnt been created yet!
|
|
58
|
+
setState({ ...wiz_state, loading: true });
|
|
59
|
+
const resp = await GroupApi.getGroupById(draft_group.group_id)
|
|
60
|
+
if(!resp){
|
|
61
|
+
return setState({
|
|
62
|
+
...wiz_state,
|
|
63
|
+
loading:false
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
//Lets grab the players!
|
|
67
|
+
let player_ids = resp.group_players.map(p => p.player_id);
|
|
68
|
+
let plyers = await GroupApi.getPlayersByIds(player_ids);
|
|
69
|
+
setState({
|
|
70
|
+
...wiz_state,
|
|
71
|
+
draft_group: resp.group,
|
|
72
|
+
players: plyers,
|
|
73
|
+
group_players: resp.group_players,
|
|
74
|
+
loading:false
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const handleDeleteAndClose = async() => {
|
|
79
|
+
setState({ ...wiz_state, loading: true });
|
|
80
|
+
//If we created a group but are closing it - we need to delete the group
|
|
81
|
+
let deleted_group = await GroupApi.deleteGroup(draft_group.group_id);
|
|
82
|
+
if(!deleted_group){ alert('Group was created. You can manage this group from your social tab') }
|
|
83
|
+
//Reset state on close!
|
|
84
|
+
setState({
|
|
85
|
+
...wiz_state,
|
|
86
|
+
loading: false,
|
|
87
|
+
draft_group: GroupHelpers.generateGroup(),
|
|
88
|
+
group_players: [],
|
|
89
|
+
players:[],
|
|
90
|
+
});
|
|
91
|
+
return onClose()
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const handleClose = async() => {
|
|
95
|
+
if(!draft_group.group_id){ return onClose() }
|
|
96
|
+
showConfirmAlert('Are you sure?', 'Exiting now will delete the group in progress',
|
|
97
|
+
async() => await handleDeleteAndClose(),
|
|
98
|
+
() => console.log('')
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
const handleFinishStep = async(step:CreateGroupStepProps) => {
|
|
104
|
+
if(errors.length > 0){ return }
|
|
105
|
+
switch(step.step_key){
|
|
106
|
+
case 'intro':
|
|
107
|
+
if(!player){ return onRequestAuthenticate() }
|
|
108
|
+
let first_step = wizard_steps.find(s => s.num == step.num + 1);
|
|
109
|
+
if(!first_step){ return }
|
|
110
|
+
setState({
|
|
111
|
+
...wiz_state,
|
|
112
|
+
loading: false,
|
|
113
|
+
active_step: first_step,
|
|
114
|
+
});
|
|
115
|
+
return
|
|
116
|
+
case 'info':
|
|
117
|
+
setState({ ...wiz_state, loading: true });
|
|
118
|
+
let new_group:GroupProps | undefined = undefined
|
|
119
|
+
if(draft_group.group_id){
|
|
120
|
+
new_group = await GroupApi.updateGroup(draft_group);
|
|
121
|
+
} else {
|
|
122
|
+
new_group = await GroupApi.createGroup(draft_group.name, draft_group.description, draft_group.invite_code)
|
|
123
|
+
}
|
|
124
|
+
if(!new_group){
|
|
125
|
+
alert('Unable to create group. Please try again later.')
|
|
126
|
+
return setState({ ...wiz_state, loading: false })
|
|
127
|
+
}
|
|
128
|
+
let next_step = wizard_steps.find(s => s.num == step.num + 1);
|
|
129
|
+
if(!next_step){ return }
|
|
130
|
+
setState({
|
|
131
|
+
...wiz_state,
|
|
132
|
+
loading: false,
|
|
133
|
+
active_step: next_step,
|
|
134
|
+
draft_group: new_group
|
|
135
|
+
});
|
|
136
|
+
return
|
|
137
|
+
case 'image':
|
|
138
|
+
if(!draft_group.group_id){ return alert('Unable to process') }
|
|
139
|
+
setState({ ...wiz_state, loading: true });
|
|
140
|
+
|
|
141
|
+
let image_group = await GroupApi.updateGroup(draft_group);
|
|
142
|
+
if(!image_group){
|
|
143
|
+
alert('Unable to create group. Please try again later.')
|
|
144
|
+
return setState({ ...wiz_state, loading: false })
|
|
145
|
+
}
|
|
146
|
+
let next_image_step = wizard_steps.find(s => s.num == step.num + 1);
|
|
147
|
+
if(!next_image_step){ return }
|
|
148
|
+
setState({
|
|
149
|
+
...wiz_state,
|
|
150
|
+
loading: false,
|
|
151
|
+
active_step: next_image_step,
|
|
152
|
+
draft_group: image_group
|
|
153
|
+
});
|
|
154
|
+
return
|
|
155
|
+
case 'invite':
|
|
156
|
+
let success_step = wizard_steps.find(s => s.num == step.num + 1);
|
|
157
|
+
if(!success_step){ return }
|
|
158
|
+
setState({
|
|
159
|
+
...wiz_state,
|
|
160
|
+
loading: false,
|
|
161
|
+
active_step: success_step,
|
|
162
|
+
});
|
|
163
|
+
return
|
|
164
|
+
case 'success':
|
|
165
|
+
if(!draft_group.group_id){ return alert('Unable to activate group. Please try again') }
|
|
166
|
+
setState({ ...wiz_state, loading: true });
|
|
167
|
+
let activated_group = await GroupApi.activateGroup(draft_group.group_id);
|
|
168
|
+
if(!activated_group){
|
|
169
|
+
alert('Unable to activate group. Please try again later.')
|
|
170
|
+
return setState({ ...wiz_state, loading: false })
|
|
171
|
+
}
|
|
172
|
+
setState({
|
|
173
|
+
...wiz_state,
|
|
174
|
+
loading: false,
|
|
175
|
+
draft_group: activated_group
|
|
176
|
+
});
|
|
177
|
+
onFinish(activated_group, group_players);
|
|
178
|
+
return
|
|
179
|
+
default: return
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const renderPlayers = (data:{ item:GroupPlayerProps, index:number }) => {
|
|
184
|
+
const pl = players.find(p => p.player_id == data.item.player_id);
|
|
185
|
+
if(!pl){ return <></> }
|
|
186
|
+
return (
|
|
187
|
+
<View key={data.item.group_player_id.toString()} float style={{ width:100, margin:5 }}>
|
|
188
|
+
<Image
|
|
189
|
+
source={{ uri: pl.profile_pic }}
|
|
190
|
+
style={{ height:50, width:100, borderTopLeftRadius:8, borderTopRightRadius: 8 }}
|
|
191
|
+
resizeMode='cover'
|
|
192
|
+
/>
|
|
193
|
+
<View transparent style={{ padding:10 }}>
|
|
194
|
+
<Text theme='h1' textAlign='center'>@{pl.username}</Text>
|
|
195
|
+
</View>
|
|
196
|
+
</View>
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const renderSections = (data:{ item:string, index:number }) => {
|
|
201
|
+
switch(data.item){
|
|
202
|
+
case 'header':
|
|
203
|
+
return (
|
|
204
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10, ...header_style }}>
|
|
205
|
+
<View transparent style={{ flex:1 }}>
|
|
206
|
+
<Text theme='h1'>Create Group Wizard</Text>
|
|
207
|
+
<Text theme='description' style={{ marginTop:3 }}>Complete the steps to create your group!</Text>
|
|
208
|
+
</View>
|
|
209
|
+
<Button
|
|
210
|
+
title='X'
|
|
211
|
+
float
|
|
212
|
+
title_color={Colors.text.error}
|
|
213
|
+
style={{ padding:10 }}
|
|
214
|
+
onPress={() => handleClose()}
|
|
215
|
+
/>
|
|
216
|
+
</View>
|
|
217
|
+
)
|
|
218
|
+
case 'intro':
|
|
219
|
+
if(active_step?.step_key != 'intro'){ return <></> }
|
|
220
|
+
return (
|
|
221
|
+
<View>
|
|
222
|
+
<Image
|
|
223
|
+
source={{ uri: 'https://res.cloudinary.com/hoabts6mc/image/upload/w_1000,ar_16:9,c_fill,g_auto,e_sharpen/v1756998145/ChatGPT_Image_Sep_4_2025_10_00_58_AM_xemjix.png' }}
|
|
224
|
+
style={{ alignSelf:'center', width: wiz_size.width > 600 ? 600 : wiz_size.width, height: wiz_size.width > 600 ? 300 : wiz_size.width * 0.5 }}
|
|
225
|
+
resizeMode='cover'
|
|
226
|
+
/>
|
|
227
|
+
</View>
|
|
228
|
+
)
|
|
229
|
+
case 'info':
|
|
230
|
+
if(!active_step){ return <></> }
|
|
231
|
+
return (
|
|
232
|
+
<View style={{ padding:20 }}>
|
|
233
|
+
<Text theme='h1' size={40}>{active_step.title}</Text>
|
|
234
|
+
<Text theme='description' size={18} color={errors.length > 0 ? Colors.text.warning : Colors.text.success} style={{ marginTop:10 }}>{active_step.description}</Text>
|
|
235
|
+
</View>
|
|
236
|
+
)
|
|
237
|
+
case 'input':
|
|
238
|
+
if(!active_step){ return <></> }
|
|
239
|
+
switch(active_step.step_key){
|
|
240
|
+
case 'info':
|
|
241
|
+
return (
|
|
242
|
+
<View style={{ padding:10 }}>
|
|
243
|
+
<Text theme='h1' style={{ marginLeft:10 }}>Group Name</Text>
|
|
244
|
+
<TextInput
|
|
245
|
+
value={draft_group.name}
|
|
246
|
+
style={{ margin:10, borderColor:draft_group.name?Colors.text.success:Colors.text.warning }}
|
|
247
|
+
placeholder='Give your group a name ...'
|
|
248
|
+
onChangeText={(text) => setState({ ...wiz_state, draft_group: { ...draft_group, name: text } })}
|
|
249
|
+
/>
|
|
250
|
+
<Text theme='h1' style={{ marginLeft:10 }}>Group Description</Text>
|
|
251
|
+
<TextInput
|
|
252
|
+
value={draft_group.description}
|
|
253
|
+
style={{ margin:10, borderColor:draft_group.description?Colors.text.success:Colors.text.warning }}
|
|
254
|
+
placeholder='Add a short description ...'
|
|
255
|
+
onChangeText={(text) => setState({ ...wiz_state, draft_group: { ...draft_group, description: text } })}
|
|
256
|
+
/>
|
|
257
|
+
<Text theme='h1' style={{ marginLeft:10 }}>Invite Code</Text>
|
|
258
|
+
<TextInput
|
|
259
|
+
value={draft_group.invite_code}
|
|
260
|
+
style={{ margin:10, borderColor:draft_group.invite_code?Colors.text.success:Colors.text.warning }}
|
|
261
|
+
placeholder='Add a unique code to find your group'
|
|
262
|
+
onChangeText={(text) => setState({ ...wiz_state, draft_group: { ...draft_group, invite_code: text } })}
|
|
263
|
+
/>
|
|
264
|
+
</View>
|
|
265
|
+
)
|
|
266
|
+
case 'image':
|
|
267
|
+
return (
|
|
268
|
+
<View style={{ padding:10, justifyContent:'center', alignItems:'center' }}>
|
|
269
|
+
<ImageUploader public_id={`${draft_group.group_id}_${Math.random()}`} onFinishUpload={(obj) => setState({ ...wiz_state, draft_group: { ...draft_group, group_image: { ...obj, url: obj.secure_url } } })}>
|
|
270
|
+
{draft_group.group_image?.url ?
|
|
271
|
+
<Image
|
|
272
|
+
source={{ uri: draft_group.group_image.url }}
|
|
273
|
+
style={{ height:wiz_size.width >600 ? 600 : wiz_size.width, width:wiz_size.width >600 ? 600 : wiz_size.width }}
|
|
274
|
+
resizeMode='contain'
|
|
275
|
+
/>
|
|
276
|
+
:
|
|
277
|
+
<Icons.ImageIcon size={150} color={Colors.text.h1} />
|
|
278
|
+
}
|
|
279
|
+
<Text style={{ marginTop:10 }} theme='action' textAlign='center' size={18}>{draft_group.group_image?.url ? 'CHANGE':'ADD'} PHOTO</Text>
|
|
280
|
+
</ImageUploader>
|
|
281
|
+
</View>
|
|
282
|
+
)
|
|
283
|
+
case 'invite':
|
|
284
|
+
return (
|
|
285
|
+
<View style={{ padding:10 }}>
|
|
286
|
+
<Button
|
|
287
|
+
title={group_players.length == 0 ? 'INVITE FRIENDS' : 'INVITE MORE'}
|
|
288
|
+
type='success'
|
|
289
|
+
onPress={() => onInvitePlayers()}
|
|
290
|
+
/>
|
|
291
|
+
<View style={{ margin:10, marginTop:40 }}>
|
|
292
|
+
<View style={{ flexDirection:'row', flexWrap:'wrap', justifyContent:'center' }}>
|
|
293
|
+
{group_players.filter(gp => gp.status != 'inactive').map((item, index) => {
|
|
294
|
+
return renderPlayers({ item, index })
|
|
295
|
+
})}
|
|
296
|
+
</View>
|
|
297
|
+
</View>
|
|
298
|
+
</View>
|
|
299
|
+
)
|
|
300
|
+
case 'success':
|
|
301
|
+
return (
|
|
302
|
+
<View>
|
|
303
|
+
<Image
|
|
304
|
+
source={{ uri:'https://res.cloudinary.com/hoabts6mc/image/upload/v1714410165/Welcome_banner_bqu6cc.webp' }}
|
|
305
|
+
style={{ alignSelf:'center', width:wiz_size.width > 500 ? 500 :wiz_size.width, height:wiz_size.width > 500 ? 500 :wiz_size.width, borderRadius:4 }}
|
|
306
|
+
resizeMode='cover'
|
|
307
|
+
/>
|
|
308
|
+
</View>
|
|
309
|
+
)
|
|
310
|
+
default: return <></>
|
|
311
|
+
}
|
|
312
|
+
default: return <></>
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return (
|
|
317
|
+
<View style={{ flex:1 }}>
|
|
318
|
+
<View style={{ flex:1 }} onLayout={(ev) => {
|
|
319
|
+
const { height, width } = ev.nativeEvent.layout;
|
|
320
|
+
setSize({ height, width })
|
|
321
|
+
}}>
|
|
322
|
+
<FlatList
|
|
323
|
+
data={sections}
|
|
324
|
+
key={'create_group_steps'}
|
|
325
|
+
keyExtractor={item => item}
|
|
326
|
+
renderItem={renderSections}
|
|
327
|
+
/>
|
|
328
|
+
</View>
|
|
329
|
+
{active_step.step_key == 'intro' ?
|
|
330
|
+
<View type='footer' style={{ flexDirection: 'row', alignItems:'center', padding:10, ...footer_style }}>
|
|
331
|
+
<Button
|
|
332
|
+
style={{ flex:1 }}
|
|
333
|
+
title='GET STARTED!'
|
|
334
|
+
type='success'
|
|
335
|
+
onPress={() => handleFinishStep(active_step)}
|
|
336
|
+
/>
|
|
337
|
+
</View>
|
|
338
|
+
:
|
|
339
|
+
<View type='footer' style={{ flexDirection: 'row', alignItems:'center', padding:10, ...footer_style }}>
|
|
340
|
+
<Button
|
|
341
|
+
disabled={loading || active_step?.num == 1 ? true : false}
|
|
342
|
+
float
|
|
343
|
+
onPress={() => {
|
|
344
|
+
let prev_step = wizard_steps.find(s => s.num == active_step?.num - 1)
|
|
345
|
+
if(!prev_step){ return }
|
|
346
|
+
setState({ ...wiz_state, active_step: prev_step })
|
|
347
|
+
}}
|
|
348
|
+
style={{ borderRadius:100, padding:0, height:50, width:50, justifyContent:'center', alignItems:'center', opacity: active_step?.num == 1 ? 0.5 : 1 }}>
|
|
349
|
+
<Icons.ChevronIcon direction='left' size={14} color={Colors.text.h1} />
|
|
350
|
+
</Button>
|
|
351
|
+
<View transparent style={{ flex:1 }}>
|
|
352
|
+
<Text theme='h1' textAlign='center'>Step {active_step.num} of {wizard_steps.length}</Text>
|
|
353
|
+
</View>
|
|
354
|
+
{active_step?.step_key == 'success' ?
|
|
355
|
+
<Button
|
|
356
|
+
type='success'
|
|
357
|
+
title='ACTIVATE'
|
|
358
|
+
onPress={() => handleFinishStep(active_step)}
|
|
359
|
+
/>
|
|
360
|
+
:
|
|
361
|
+
<Button
|
|
362
|
+
float
|
|
363
|
+
disabled={loading ? true : false}
|
|
364
|
+
loading={loading}
|
|
365
|
+
style={{ borderRadius:100, padding:0, height:50, width:50, justifyContent:'center', alignItems:'center', opacity: errors.length > 0 || loading ? 0.5: 1 }}
|
|
366
|
+
onPress={() => {
|
|
367
|
+
if(errors.length > 0){ return alert(errors.map(e => e)) }
|
|
368
|
+
handleFinishStep(active_step)
|
|
369
|
+
}}
|
|
370
|
+
>
|
|
371
|
+
<Icons.ChevronIcon direction='right' size={14} color={errors.length > 0 ? Colors.text.h1: Colors.text.success} />
|
|
372
|
+
</Button>
|
|
373
|
+
}
|
|
374
|
+
</View>
|
|
375
|
+
}
|
|
376
|
+
</View>
|
|
377
|
+
)
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export default CreateGroupWizard
|
|
@@ -4,13 +4,14 @@ import type { GroupPlayerProps, GroupProps, MyPlayerProps } from '../../types';
|
|
|
4
4
|
import { GroupApi } from '../api';
|
|
5
5
|
|
|
6
6
|
type GroupPlayerActionFormProps = {
|
|
7
|
-
me
|
|
7
|
+
me?:MyPlayerProps,
|
|
8
8
|
group:GroupProps,
|
|
9
9
|
group_player?:GroupPlayerProps,
|
|
10
|
+
onRequestAuthenticate: () => void,
|
|
10
11
|
onResponse:(gp:GroupPlayerProps) => void,
|
|
11
12
|
onClose:() => void
|
|
12
13
|
}
|
|
13
|
-
const GroupPlayerActionForm = ({ group, group_player, onResponse, onClose }:GroupPlayerActionFormProps) => {
|
|
14
|
+
const GroupPlayerActionForm = ({ me, group, group_player, onResponse, onRequestAuthenticate, onClose }:GroupPlayerActionFormProps) => {
|
|
14
15
|
const [ action_loading, setActionLoading ] = useState(false);
|
|
15
16
|
|
|
16
17
|
const handleAccept = async() => {
|
|
@@ -89,7 +90,7 @@ const GroupPlayerActionForm = ({ group, group_player, onResponse, onClose }:Grou
|
|
|
89
90
|
}
|
|
90
91
|
</View>
|
|
91
92
|
<View type='footer' style={{ flexDirection:'row', alignItems:'center', padding:5, borderBottomRightRadius:8, borderBottomLeftRadius:8 }}>
|
|
92
|
-
{group_player?.status == 'invited' ?
|
|
93
|
+
{me && group_player?.status == 'invited' ?
|
|
93
94
|
<Button
|
|
94
95
|
title='DECLINE'
|
|
95
96
|
type='error'
|
|
@@ -99,7 +100,7 @@ const GroupPlayerActionForm = ({ group, group_player, onResponse, onClose }:Grou
|
|
|
99
100
|
onPress={() => handleDecline()}
|
|
100
101
|
/>
|
|
101
102
|
:<></>}
|
|
102
|
-
{group_player?.status == 'invited' ?
|
|
103
|
+
{me && group_player?.status == 'invited' ?
|
|
103
104
|
<Button
|
|
104
105
|
title='ACCEPT'
|
|
105
106
|
type='success'
|
|
@@ -109,7 +110,7 @@ const GroupPlayerActionForm = ({ group, group_player, onResponse, onClose }:Grou
|
|
|
109
110
|
onPress={() => handleAccept()}
|
|
110
111
|
/>
|
|
111
112
|
:<></>}
|
|
112
|
-
{group_player?.status == 'active' ?
|
|
113
|
+
{me && group_player?.status == 'active' ?
|
|
113
114
|
<Button
|
|
114
115
|
title='LEAVE GROUP'
|
|
115
116
|
type='error'
|
|
@@ -119,7 +120,16 @@ const GroupPlayerActionForm = ({ group, group_player, onResponse, onClose }:Grou
|
|
|
119
120
|
onPress={() => handleLeave()}
|
|
120
121
|
/>
|
|
121
122
|
:<></>}
|
|
122
|
-
{!
|
|
123
|
+
{!me ?
|
|
124
|
+
<Button
|
|
125
|
+
title='SIGN IN / UP'
|
|
126
|
+
type='success'
|
|
127
|
+
loading={action_loading}
|
|
128
|
+
style={{ flex:1, opacity: action_loading ? 0.5:1, margin:5 }}
|
|
129
|
+
disabled={action_loading}
|
|
130
|
+
onPress={() => onRequestAuthenticate()}
|
|
131
|
+
/>
|
|
132
|
+
:!group_player || group_player.status == 'inactive' ?
|
|
123
133
|
<Button
|
|
124
134
|
title='JOIN GROUP'
|
|
125
135
|
type='success'
|
package/src/Group/index.tsx
CHANGED
|
@@ -25,6 +25,7 @@ type GroupComponentProps = {
|
|
|
25
25
|
onNudgePlayer:(p:PublicPlayerProps, gp:GroupPlayerProps) => void,
|
|
26
26
|
onSelectPlayer:(p:PublicPlayerProps) => void,
|
|
27
27
|
onSelectCompetition:(c:CompetitionProps) => void,
|
|
28
|
+
onRequestAuthenticate:() => void,
|
|
28
29
|
onSelectPollCampaign:(pc:PollCampaignProps) => void,
|
|
29
30
|
onSelectSquaresCompetition:(sq:SquaresCompetitionProps) => void,
|
|
30
31
|
onCreateEngagement?: (g:GroupProps) => void,
|
|
@@ -60,7 +61,7 @@ const member_stat_options:{ stat_key:string, label:string, multiplier:number, pr
|
|
|
60
61
|
{ stat_key: 'original_stake', label: 'Betting Volume', multiplier: 1, prefix: '$' }
|
|
61
62
|
]
|
|
62
63
|
|
|
63
|
-
const GroupComponent = ({ refresh_key, group_id, player, mode, onCreateEngagement, onShareGroup, onInvitePlayer, onSelectCompetition, onSelectChat, onSelectPlayer, onNudgePlayer, onSelectPollCampaign, onSelectSquaresCompetition } : GroupComponentProps) => {
|
|
64
|
+
const GroupComponent = ({ refresh_key, group_id, player, mode, onCreateEngagement, onRequestAuthenticate, onShareGroup, onInvitePlayer, onSelectCompetition, onSelectChat, onSelectPlayer, onNudgePlayer, onSelectPollCampaign, onSelectSquaresCompetition } : GroupComponentProps) => {
|
|
64
65
|
const Colors = useColors();
|
|
65
66
|
const leader_options:TimeOptionProps[] = [
|
|
66
67
|
{ to: moment().subtract(1, 'days').unix(), from: moment().unix(), option: '24_hours', label: '24 Hours' },
|
|
@@ -670,6 +671,7 @@ const GroupComponent = ({ refresh_key, group_id, player, mode, onCreateEngagemen
|
|
|
670
671
|
group={group}
|
|
671
672
|
group_player={my_group_player}
|
|
672
673
|
me={player}
|
|
674
|
+
onRequestAuthenticate={onRequestAuthenticate}
|
|
673
675
|
onResponse={(new_gp) => {
|
|
674
676
|
setGroupData({
|
|
675
677
|
...group_data,
|
package/src/index.tsx
CHANGED
|
@@ -58,7 +58,7 @@ import ClaritySmartEvents from './Clarity/SmartEvents';
|
|
|
58
58
|
import RankingsCard from './RankingsCard';
|
|
59
59
|
import GuideView from './Guide';
|
|
60
60
|
import GroupComponent from './Group';
|
|
61
|
-
|
|
61
|
+
import CreateGroupWizard from './Group/components/CreateGroupWizard';
|
|
62
62
|
export {
|
|
63
63
|
Authenticator,
|
|
64
64
|
Observer,
|
|
@@ -70,6 +70,7 @@ export {
|
|
|
70
70
|
ManageFilter,
|
|
71
71
|
Ticker,
|
|
72
72
|
Premium,
|
|
73
|
+
CreateGroupWizard,
|
|
73
74
|
LeaderboardCard,
|
|
74
75
|
GroupComponent,
|
|
75
76
|
LocationTracker,
|
package/src/types.d.ts
CHANGED
|
@@ -82,6 +82,13 @@ export interface TourStepProps {
|
|
|
82
82
|
priority?: number; // lower = higher priority
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
+
export interface CreateGroupStepProps {
|
|
86
|
+
num:number,
|
|
87
|
+
title:string,
|
|
88
|
+
step_key:string,
|
|
89
|
+
description: string
|
|
90
|
+
}
|
|
91
|
+
|
|
85
92
|
export interface ClarityProps {
|
|
86
93
|
consent: () => void;
|
|
87
94
|
identify: (
|