be-components 1.4.9 → 1.5.0
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/api/index.js +15 -0
- package/lib/commonjs/Competition/api/index.js.map +1 -1
- package/lib/commonjs/Competition/components/CompetitionSeasonCard.js +1 -1
- package/lib/commonjs/Competition/components/CompetitionSeasonCard.js.map +1 -1
- package/lib/commonjs/Competition/components/SeasonCard.js +61 -0
- package/lib/commonjs/Competition/components/SeasonCard.js.map +1 -0
- package/lib/commonjs/Competition/index.js +23 -3
- package/lib/commonjs/Competition/index.js.map +1 -1
- package/lib/commonjs/CompetitionManager/api/index.js +3 -5
- package/lib/commonjs/CompetitionManager/api/index.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js +1 -61
- package/lib/commonjs/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js +6 -1
- package/lib/commonjs/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js +4 -0
- package/lib/commonjs/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
- package/lib/commonjs/CompetitionManager/components/CreateCompetitionForm.js +37 -3
- package/lib/commonjs/CompetitionManager/components/CreateCompetitionForm.js.map +1 -1
- package/lib/commonjs/CompetitionSeason/api/index.js +134 -0
- package/lib/commonjs/CompetitionSeason/api/index.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/CompetitionsSection.js +127 -0
- package/lib/commonjs/CompetitionSeason/components/CompetitionsSection.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/EnterSeasonPrompt.js +253 -0
- package/lib/commonjs/CompetitionSeason/components/EnterSeasonPrompt.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonHeader.js +126 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonHeader.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonLeaderboard.js +324 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonLeaderboard.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonSettingsSection.js +175 -0
- package/lib/commonjs/CompetitionSeason/components/SeasonSettingsSection.js.map +1 -0
- package/lib/commonjs/CompetitionSeason/index.js +278 -0
- package/lib/commonjs/CompetitionSeason/index.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/api/index.js +182 -0
- package/lib/commonjs/CompetitionSeasonManager/api/index.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CompetitionSelector.js +2 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CompetitionSelector.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CompetitionsForm.js +153 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CompetitionsForm.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CreateSeasonForm.js +388 -0
- package/lib/commonjs/CompetitionSeasonManager/components/CreateSeasonForm.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonHeader.js +108 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonHeader.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonInfoForm.js +242 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonInfoForm.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonSettingsForm.js +352 -0
- package/lib/commonjs/CompetitionSeasonManager/components/SeasonSettingsForm.js.map +1 -0
- package/lib/commonjs/CompetitionSeasonManager/index.js +190 -0
- package/lib/commonjs/CompetitionSeasonManager/index.js.map +1 -0
- package/lib/commonjs/Components/Switch.js +3 -0
- package/lib/commonjs/Components/Switch.js.map +1 -1
- package/lib/commonjs/Engage/index.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Competition/api/index.js +15 -0
- package/lib/module/Competition/api/index.js.map +1 -1
- package/lib/module/Competition/components/CompetitionSeasonCard.js +1 -1
- package/lib/module/Competition/components/CompetitionSeasonCard.js.map +1 -1
- package/lib/module/Competition/components/SeasonCard.js +54 -0
- package/lib/module/Competition/components/SeasonCard.js.map +1 -0
- package/lib/module/Competition/index.js +23 -3
- package/lib/module/Competition/index.js.map +1 -1
- package/lib/module/CompetitionManager/api/index.js +3 -5
- package/lib/module/CompetitionManager/api/index.js.map +1 -1
- package/lib/module/CompetitionManager/components/CompetitionInfoForm.js +1 -63
- package/lib/module/CompetitionManager/components/CompetitionInfoForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js +6 -1
- package/lib/module/CompetitionManager/components/CompetitionSettingsForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/ContestSettingsForm.js +4 -0
- package/lib/module/CompetitionManager/components/ContestSettingsForm.js.map +1 -1
- package/lib/module/CompetitionManager/components/CreateCompetitionForm.js +37 -3
- package/lib/module/CompetitionManager/components/CreateCompetitionForm.js.map +1 -1
- package/lib/module/CompetitionSeason/api/index.js +128 -0
- package/lib/module/CompetitionSeason/api/index.js.map +1 -0
- package/lib/module/CompetitionSeason/components/CompetitionsSection.js +118 -0
- package/lib/module/CompetitionSeason/components/CompetitionsSection.js.map +1 -0
- package/lib/module/CompetitionSeason/components/EnterSeasonPrompt.js +244 -0
- package/lib/module/CompetitionSeason/components/EnterSeasonPrompt.js.map +1 -0
- package/lib/module/CompetitionSeason/components/SeasonHeader.js +119 -0
- package/lib/module/CompetitionSeason/components/SeasonHeader.js.map +1 -0
- package/lib/module/CompetitionSeason/components/SeasonLeaderboard.js +315 -0
- package/lib/module/CompetitionSeason/components/SeasonLeaderboard.js.map +1 -0
- package/lib/module/CompetitionSeason/components/SeasonSettingsSection.js +166 -0
- package/lib/module/CompetitionSeason/components/SeasonSettingsSection.js.map +1 -0
- package/lib/module/CompetitionSeason/index.js +269 -0
- package/lib/module/CompetitionSeason/index.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/api/index.js +176 -0
- package/lib/module/CompetitionSeasonManager/api/index.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/CompetitionSelector.js +2 -0
- package/lib/module/CompetitionSeasonManager/components/CompetitionSelector.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/CompetitionsForm.js +144 -0
- package/lib/module/CompetitionSeasonManager/components/CompetitionsForm.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/CreateSeasonForm.js +379 -0
- package/lib/module/CompetitionSeasonManager/components/CreateSeasonForm.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonHeader.js +101 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonHeader.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonInfoForm.js +233 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonInfoForm.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonSettingsForm.js +343 -0
- package/lib/module/CompetitionSeasonManager/components/SeasonSettingsForm.js.map +1 -0
- package/lib/module/CompetitionSeasonManager/index.js +181 -0
- package/lib/module/CompetitionSeasonManager/index.js.map +1 -0
- package/lib/module/Components/Switch.js +3 -0
- package/lib/module/Components/Switch.js.map +1 -1
- package/lib/module/Engage/index.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/Competition/api/index.d.ts +1 -0
- package/lib/typescript/src/Competition/api/index.d.ts.map +1 -1
- package/lib/typescript/src/Competition/components/SeasonCard.d.ts +10 -0
- package/lib/typescript/src/Competition/components/SeasonCard.d.ts.map +1 -0
- package/lib/typescript/src/Competition/index.d.ts +3 -2
- package/lib/typescript/src/Competition/index.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/api/index.d.ts +1 -1
- package/lib/typescript/src/CompetitionManager/api/index.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionInfoForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CompetitionSettingsForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/ContestSettingsForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionManager/components/CreateCompetitionForm.d.ts +3 -2
- package/lib/typescript/src/CompetitionManager/components/CreateCompetitionForm.d.ts.map +1 -1
- package/lib/typescript/src/CompetitionSeason/api/index.d.ts +41 -0
- package/lib/typescript/src/CompetitionSeason/api/index.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/CompetitionsSection.d.ts +14 -0
- package/lib/typescript/src/CompetitionSeason/components/CompetitionsSection.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/EnterSeasonPrompt.d.ts +16 -0
- package/lib/typescript/src/CompetitionSeason/components/EnterSeasonPrompt.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonHeader.d.ts +15 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonHeader.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonLeaderboard.d.ts +18 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonLeaderboard.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonSettingsSection.d.ts +12 -0
- package/lib/typescript/src/CompetitionSeason/components/SeasonSettingsSection.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeason/index.d.ts +12 -0
- package/lib/typescript/src/CompetitionSeason/index.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/api/index.d.ts +31 -0
- package/lib/typescript/src/CompetitionSeasonManager/api/index.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionSelector.d.ts +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionSelector.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionsForm.d.ts +12 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CompetitionsForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CreateSeasonForm.d.ts +11 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/CreateSeasonForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonHeader.d.ts +13 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonHeader.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonInfoForm.d.ts +11 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonInfoForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonSettingsForm.d.ts +12 -0
- package/lib/typescript/src/CompetitionSeasonManager/components/SeasonSettingsForm.d.ts.map +1 -0
- package/lib/typescript/src/CompetitionSeasonManager/index.d.ts +8 -0
- package/lib/typescript/src/CompetitionSeasonManager/index.d.ts.map +1 -0
- package/lib/typescript/src/Components/Switch.d.ts +2 -1
- package/lib/typescript/src/Components/Switch.d.ts.map +1 -1
- package/lib/typescript/src/Engage/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Competition/api/index.ts +15 -0
- package/src/Competition/components/CompetitionSeasonCard.tsx +1 -1
- package/src/Competition/components/SeasonCard.tsx +46 -0
- package/src/Competition/index.tsx +45 -27
- package/src/CompetitionManager/api/index.ts +2 -5
- package/src/CompetitionManager/components/CompetitionInfoForm.tsx +2 -64
- package/src/CompetitionManager/components/CompetitionSettingsForm.tsx +10 -3
- package/src/CompetitionManager/components/ContestSettingsForm.tsx +8 -2
- package/src/CompetitionManager/components/CreateCompetitionForm.tsx +20 -4
- package/src/CompetitionSeason/api/index.ts +111 -0
- package/src/CompetitionSeason/components/CompetitionsSection.tsx +99 -0
- package/src/CompetitionSeason/components/EnterSeasonPrompt.tsx +135 -0
- package/src/CompetitionSeason/components/SeasonHeader.tsx +81 -0
- package/src/CompetitionSeason/components/SeasonLeaderboard.tsx +205 -0
- package/src/CompetitionSeason/components/SeasonSettingsSection.tsx +92 -0
- package/src/CompetitionSeason/index.tsx +244 -0
- package/src/CompetitionSeasonManager/api/index.ts +127 -0
- package/src/CompetitionSeasonManager/components/CompetitionSelector.tsx +2 -0
- package/src/CompetitionSeasonManager/components/CompetitionsForm.tsx +113 -0
- package/src/CompetitionSeasonManager/components/CreateSeasonForm.tsx +238 -0
- package/src/CompetitionSeasonManager/components/SeasonHeader.tsx +75 -0
- package/src/CompetitionSeasonManager/components/SeasonInfoForm.tsx +124 -0
- package/src/CompetitionSeasonManager/components/SeasonSettingsForm.tsx +185 -0
- package/src/CompetitionSeasonManager/index.tsx +151 -0
- package/src/Components/Switch.tsx +8 -3
- package/src/Engage/index.tsx +1 -0
- package/src/index.tsx +4 -1
- package/src/types.d.ts +48 -5
- package/lib/commonjs/Competition/components/ManageSeasonForm.js +0 -605
- package/lib/commonjs/Competition/components/ManageSeasonForm.js.map +0 -1
- package/lib/commonjs/Competition/components/SeasonInfoModal.js +0 -400
- package/lib/commonjs/Competition/components/SeasonInfoModal.js.map +0 -1
- package/lib/module/Competition/components/ManageSeasonForm.js +0 -596
- package/lib/module/Competition/components/ManageSeasonForm.js.map +0 -1
- package/lib/module/Competition/components/SeasonInfoModal.js +0 -391
- package/lib/module/Competition/components/SeasonInfoModal.js.map +0 -1
- package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts +0 -10
- package/lib/typescript/src/Competition/components/ManageSeasonForm.d.ts.map +0 -1
- package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts +0 -14
- package/lib/typescript/src/Competition/components/SeasonInfoModal.d.ts.map +0 -1
- package/src/Competition/components/ManageSeasonForm.tsx +0 -271
- package/src/Competition/components/SeasonInfoModal.tsx +0 -212
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { TouchableOpacity, View, FlatList } from 'react-native';
|
|
3
|
+
import { view_styles } from '../../constants/styles';
|
|
4
|
+
import type { CompetitionProps, CompetitionResultTypeProps, CompetitionSeasonProps, CompetitionTypeProps } from '../../types';
|
|
5
|
+
import CompetitionCard from '../../Engage/components/CompetitionCard';
|
|
6
|
+
import { Button, Icons, Text } from '../../Components';
|
|
7
|
+
import Colors from '../../constants/colors';
|
|
8
|
+
import moment from 'moment-mini';
|
|
9
|
+
|
|
10
|
+
type CompetitionsFormProps = {
|
|
11
|
+
competition_season:CompetitionSeasonProps,
|
|
12
|
+
competitions:CompetitionProps[],
|
|
13
|
+
competition_types:CompetitionTypeProps[],
|
|
14
|
+
competition_result_types:CompetitionResultTypeProps[],
|
|
15
|
+
onAddCompetition:() => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const CompetitionsForm = ({ competition_season, competitions, competition_result_types, competition_types, onAddCompetition }:CompetitionsFormProps) => {
|
|
19
|
+
const [ expanded, setExpanded ] = useState(true);
|
|
20
|
+
const [ active_tab, setActiveTab ] = useState('active');
|
|
21
|
+
|
|
22
|
+
let filtered_comptitions = [ ...competitions ]
|
|
23
|
+
if(active_tab == 'active'){ filtered_comptitions = filtered_comptitions.filter(c => c.status != 'closed') }
|
|
24
|
+
else { filtered_comptitions = filtered_comptitions.filter(c => c.status == 'closed') }
|
|
25
|
+
|
|
26
|
+
const renderCompetitions = (data:{item:CompetitionProps, index:number}) => {
|
|
27
|
+
const competition_type = competition_types.find(ct => ct.competition_type_id == data.item.competition_type_id)
|
|
28
|
+
const competition_result_type = competition_result_types.find(crt => crt.competition_result_type_id == data.item.competition_result_type_id);
|
|
29
|
+
if(!competition_type || !competition_result_type){ return <></> }
|
|
30
|
+
return (
|
|
31
|
+
<View style={{ margin:4 }}>
|
|
32
|
+
<CompetitionCard
|
|
33
|
+
competition={data.item}
|
|
34
|
+
competition_result_type={competition_result_type}
|
|
35
|
+
competition_type={competition_type}
|
|
36
|
+
onCompetitionSelect={(comp) => console.log(comp)}
|
|
37
|
+
/>
|
|
38
|
+
</View>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<View style={{ ...view_styles.section }}>
|
|
44
|
+
<TouchableOpacity style={{ ...view_styles.section_header }} onPress={() => setExpanded(!expanded)}>
|
|
45
|
+
<View style={{ flex:1 }}>
|
|
46
|
+
<Text theme='header'>Competitions</Text>
|
|
47
|
+
<Text style={{ marginTop:3 }} theme='body'>Below are the competitions that are included in this season</Text>
|
|
48
|
+
</View>
|
|
49
|
+
<Icons.ChevronIcon direction={expanded ? 'up' : 'down'} size={8} color={Colors.brand.midnight} />
|
|
50
|
+
</TouchableOpacity>
|
|
51
|
+
{expanded ?
|
|
52
|
+
<View style={{ ...view_styles.section_body, padding:0 }}>
|
|
53
|
+
<View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100 }}>
|
|
54
|
+
<View style={{ flex:1 }}>
|
|
55
|
+
<Text theme='header_2'>{active_tab == 'active' ? 'Active Competitions' : 'Closed Competitions'}</Text>
|
|
56
|
+
</View>
|
|
57
|
+
<Button
|
|
58
|
+
title='ADD'
|
|
59
|
+
style={{ opacity: competition_season.following_season_id ? 0.5: 1 }}
|
|
60
|
+
title_color={Colors.shades.white}
|
|
61
|
+
backgroundColor={Colors.utility.success}
|
|
62
|
+
onPress={() => {
|
|
63
|
+
if(competition_season.following_season_id){ return alert('Competitions are created based on the template season and cannot be customized') }
|
|
64
|
+
onAddCompetition()
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
</View>
|
|
68
|
+
<View style={{ ...view_styles.body_row, padding:0, margin:10, backgroundColor:Colors.shades.white, borderRadius:22, borderWidth:4, borderColor:Colors.shades.shade100}}>
|
|
69
|
+
<Button
|
|
70
|
+
title='ACTIVE'
|
|
71
|
+
title_color={active_tab == 'active' ? Colors.shades.white : Colors.brand.midnight}
|
|
72
|
+
title_weight={active_tab == 'active' ? 'bold' : 'regular'}
|
|
73
|
+
padding={15}
|
|
74
|
+
title_size={12}
|
|
75
|
+
style={{flex:1}}
|
|
76
|
+
borderRadiusOverride={{
|
|
77
|
+
borderTopLeftRadius: 22,
|
|
78
|
+
borderBottomLeftRadius:22,
|
|
79
|
+
borderTopRightRadius:0,
|
|
80
|
+
borderBottomRightRadius:0
|
|
81
|
+
}}
|
|
82
|
+
backgroundColor={active_tab == 'active' ? Colors.brand.midnight : Colors.shades.white}
|
|
83
|
+
onPress={() => setActiveTab('active')}
|
|
84
|
+
/>
|
|
85
|
+
<Button
|
|
86
|
+
title='CLOSED'
|
|
87
|
+
title_size={12}
|
|
88
|
+
title_color={active_tab == 'closed' ? Colors.shades.white : Colors.brand.midnight}
|
|
89
|
+
title_weight={active_tab == 'closed' ? 'bold' : 'regular'}
|
|
90
|
+
padding={15}
|
|
91
|
+
style={{flex:1}}
|
|
92
|
+
borderRadiusOverride={{
|
|
93
|
+
borderTopLeftRadius: 0,
|
|
94
|
+
borderBottomLeftRadius:0,
|
|
95
|
+
borderTopRightRadius:22,
|
|
96
|
+
borderBottomRightRadius:22
|
|
97
|
+
}}
|
|
98
|
+
backgroundColor={active_tab == 'closed' ? Colors.brand.midnight : Colors.shades.white}
|
|
99
|
+
onPress={() => setActiveTab('closed')}
|
|
100
|
+
/>
|
|
101
|
+
</View>
|
|
102
|
+
<FlatList
|
|
103
|
+
data={filtered_comptitions.sort((a,b) => moment(b.scheduled_datetime).unix() - moment(a.scheduled_datetime).unix())}
|
|
104
|
+
renderItem={renderCompetitions}
|
|
105
|
+
keyExtractor={(item) => item.competition_id.toString()}
|
|
106
|
+
/>
|
|
107
|
+
</View>
|
|
108
|
+
:<></>}
|
|
109
|
+
</View>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export default CompetitionsForm
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { View, ScrollView, TouchableOpacity, Image, FlatList } from "react-native";
|
|
3
|
+
import { view_styles } from '../../constants/styles';
|
|
4
|
+
import { Button, Icons, Text, TextInput } from '../../Components';
|
|
5
|
+
import type { CompanyProps, CompetitionSeasonProps } from '../../types';
|
|
6
|
+
import { ManageSeasonApi, ManageSeasonHelpers } from '../api';
|
|
7
|
+
import Colors from '../../constants/colors';
|
|
8
|
+
|
|
9
|
+
type CreateSeasonFormProps = {
|
|
10
|
+
width:number,
|
|
11
|
+
max_height?:number,
|
|
12
|
+
onCreateSeason:(cs:CompetitionSeasonProps) => void,
|
|
13
|
+
onClose:() => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const CreateSeasonForm = ({ width, max_height, onCreateSeason, onClose }:CreateSeasonFormProps) => {
|
|
17
|
+
const [ action_loading, setActionLoading ] = useState(false);
|
|
18
|
+
const [ draft_season, setDraftSeason ] = useState<CompetitionSeasonProps>(ManageSeasonHelpers.getPendingSeason());
|
|
19
|
+
const [ show_companies, setShowCompanies ] = useState(false);
|
|
20
|
+
const [ show_templates, setShowTemplates ] = useState(false);
|
|
21
|
+
|
|
22
|
+
const [ form_data, setFormData ] = useState<{
|
|
23
|
+
templates:CompetitionSeasonProps[],
|
|
24
|
+
companies:CompanyProps[]
|
|
25
|
+
}>({
|
|
26
|
+
templates: [],
|
|
27
|
+
companies: []
|
|
28
|
+
});
|
|
29
|
+
const { templates, companies } = form_data;
|
|
30
|
+
|
|
31
|
+
const selected_company = companies.find(c => c.company_id == draft_season.company_id);
|
|
32
|
+
const selected_template = templates.find(cs => cs.competition_season_id == draft_season.following_season_id)
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
ManageSeasonApi.setEnvironment();
|
|
36
|
+
getFormData()
|
|
37
|
+
},[])
|
|
38
|
+
|
|
39
|
+
const getFormData = async() => {
|
|
40
|
+
const temps = await ManageSeasonApi.getSeasonTemplates();
|
|
41
|
+
const company_resp = await ManageSeasonApi.getMyCompanies();
|
|
42
|
+
setFormData({
|
|
43
|
+
...form_data,
|
|
44
|
+
companies: company_resp.companies,
|
|
45
|
+
templates:temps
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const handleCreate = async(season:CompetitionSeasonProps) => {
|
|
50
|
+
setActionLoading(true);
|
|
51
|
+
const new_season = await ManageSeasonApi.createSeason(season);
|
|
52
|
+
console.log(new_season)
|
|
53
|
+
onCreateSeason(new_season);
|
|
54
|
+
setActionLoading(false);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const renderCompanies = (data: { item:CompanyProps, index:number }) => {
|
|
58
|
+
return (
|
|
59
|
+
<TouchableOpacity style={{ ...view_styles.body_row, padding:10 }} onPress={() => {
|
|
60
|
+
setDraftSeason({ ...draft_season, company_id: data.item.company_id })
|
|
61
|
+
setShowCompanies(false)
|
|
62
|
+
}}>
|
|
63
|
+
<Image
|
|
64
|
+
source={{ uri: data.item.company_image?.url }}
|
|
65
|
+
style={{ height:50, width:50, borderRadius:4 }}
|
|
66
|
+
resizeMode="cover"
|
|
67
|
+
/>
|
|
68
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
69
|
+
<Text theme="header_2">{data.item.company_name}</Text>
|
|
70
|
+
<Text style={{ marginTop:3 }} theme="body">{data.item.company_description}</Text>
|
|
71
|
+
</View>
|
|
72
|
+
</TouchableOpacity>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
const renderTemplates = (data: { item:CompetitionSeasonProps, index:number }) => {
|
|
78
|
+
return (
|
|
79
|
+
<TouchableOpacity style={{ ...view_styles.body_row, padding:10 }} onPress={() => {
|
|
80
|
+
setDraftSeason({ ...draft_season, following_season_id: data.item.competition_season_id })
|
|
81
|
+
setShowTemplates(false)
|
|
82
|
+
}}>
|
|
83
|
+
<Image
|
|
84
|
+
source={{ uri: data.item.image?.url }}
|
|
85
|
+
style={{ height:50, width:50, borderRadius:4 }}
|
|
86
|
+
resizeMode="cover"
|
|
87
|
+
/>
|
|
88
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
89
|
+
<Text theme="header_2">{data.item.season_name}</Text>
|
|
90
|
+
<Text style={{ marginTop:3 }} theme="body">{data.item.season_description}</Text>
|
|
91
|
+
</View>
|
|
92
|
+
</TouchableOpacity>
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
if(!draft_season){ return <></> }
|
|
99
|
+
|
|
100
|
+
const errors = ManageSeasonHelpers.isSeasonValid(draft_season);
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<View style={{ ...view_styles.section, width, maxHeight:max_height ?? 700, }}>
|
|
104
|
+
<View style={{ ...view_styles.section_header }}>
|
|
105
|
+
<View style={{ flex:1 }}>
|
|
106
|
+
<Text theme='header'>Create New Season</Text>
|
|
107
|
+
</View>
|
|
108
|
+
</View>
|
|
109
|
+
<ScrollView style={{ ...view_styles.section_body, flex:1 }}>
|
|
110
|
+
<View style={{ ...view_styles.body_row, flexWrap:'wrap', maxWidth:width }}>
|
|
111
|
+
<View style={{ margin:5 }}>
|
|
112
|
+
<Text theme='header_2'>Season Name</Text>
|
|
113
|
+
<Text style={{ marginTop:3 }} theme='body'>Give your season a memorable name.</Text>
|
|
114
|
+
</View>
|
|
115
|
+
<TextInput
|
|
116
|
+
style={{ ...view_styles.input, flex:1, margin:5 }}
|
|
117
|
+
value={draft_season?.season_name}
|
|
118
|
+
placeholder='Season Name'
|
|
119
|
+
placeholderTextColor={Colors.brand.slate}
|
|
120
|
+
onChangeText={(text) => setDraftSeason({ ...draft_season, season_name: text })}
|
|
121
|
+
/>
|
|
122
|
+
</View>
|
|
123
|
+
{companies.length > 0 ?
|
|
124
|
+
<View style={{ padding:10 }}>
|
|
125
|
+
<View style={{ flex:1, margin:5, minWidth:200 }}>
|
|
126
|
+
<Text theme="header">Company</Text>
|
|
127
|
+
<Text style={{ marginTop:3 }} theme="body">Is this competition associated with one of your companies / brands?</Text>
|
|
128
|
+
</View>
|
|
129
|
+
<View style={{ padding:10, borderRadius:4, borderWidth:1, borderColor:Colors.shades.shade600, backgroundColor:Colors.shades.white }}>
|
|
130
|
+
<TouchableOpacity style={{ flexDirection:'row', alignItems:'center' }} onPress={() => setShowCompanies(!show_companies)}>
|
|
131
|
+
{selected_company ?
|
|
132
|
+
<View style={{ flex:1, flexDirection:'row' }}>
|
|
133
|
+
<Image
|
|
134
|
+
source={{ uri: selected_company.company_image?.url }}
|
|
135
|
+
style={{ height:50, width:50, borderRadius:4 }}
|
|
136
|
+
resizeMode="cover"
|
|
137
|
+
/>
|
|
138
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
139
|
+
<Text theme="header_2">{selected_company.company_name}</Text>
|
|
140
|
+
<Text style={{ marginTop:3 }} theme="body">{selected_company.company_description}</Text>
|
|
141
|
+
</View>
|
|
142
|
+
</View>
|
|
143
|
+
:
|
|
144
|
+
<View style={{ flex:1 }}>
|
|
145
|
+
<Text theme="header_2">View Companies</Text>
|
|
146
|
+
</View>
|
|
147
|
+
}
|
|
148
|
+
<Icons.ChevronIcon direction={show_companies ? 'up' : 'down'} size={8} color={Colors.brand.midnight}/>
|
|
149
|
+
</TouchableOpacity>
|
|
150
|
+
{show_companies ?
|
|
151
|
+
<View>
|
|
152
|
+
<TouchableOpacity style={{ padding:10, borderBottomWidth:1, borderColor:Colors.shades.shade600 }} onPress={() => {
|
|
153
|
+
setDraftSeason({ ...draft_season, company_id:undefined })
|
|
154
|
+
setShowCompanies(false);
|
|
155
|
+
}}>
|
|
156
|
+
<Text theme="header_2">NO COMPANY</Text>
|
|
157
|
+
</TouchableOpacity>
|
|
158
|
+
<FlatList
|
|
159
|
+
data={companies}
|
|
160
|
+
renderItem={renderCompanies}
|
|
161
|
+
keyExtractor={(item) => item.company_id.toString()}
|
|
162
|
+
/>
|
|
163
|
+
</View>
|
|
164
|
+
:<></>}
|
|
165
|
+
</View>
|
|
166
|
+
</View>
|
|
167
|
+
:<></>}
|
|
168
|
+
{templates.length > 0 ?
|
|
169
|
+
<View style={{ padding:10 }}>
|
|
170
|
+
<View style={{ flex:1, margin:5, minWidth:200 }}>
|
|
171
|
+
<Text theme="header">Create From Template</Text>
|
|
172
|
+
<Text style={{ marginTop:3 }} theme="body">Optionally you can select a template to auto create this competition from</Text>
|
|
173
|
+
</View>
|
|
174
|
+
<View style={{ padding:10, borderRadius:4, borderWidth:1, borderColor:Colors.shades.shade600, backgroundColor:Colors.shades.white }}>
|
|
175
|
+
<TouchableOpacity style={{ flexDirection:'row', alignItems:'center' }} onPress={() => setShowTemplates(!show_templates)}>
|
|
176
|
+
{selected_template ?
|
|
177
|
+
<View style={{ flex:1, flexDirection:'row' }}>
|
|
178
|
+
<Image
|
|
179
|
+
source={{ uri: selected_template.image?.url }}
|
|
180
|
+
style={{ height:50, width:50, borderRadius:4 }}
|
|
181
|
+
resizeMode="cover"
|
|
182
|
+
/>
|
|
183
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
184
|
+
<Text theme="header_2">{selected_template.season_name}</Text>
|
|
185
|
+
<Text style={{ marginTop:3 }} theme="body">{selected_template.season_description}</Text>
|
|
186
|
+
</View>
|
|
187
|
+
</View>
|
|
188
|
+
:
|
|
189
|
+
<View style={{ flex:1 }}>
|
|
190
|
+
<Text theme="header_2">View Templates</Text>
|
|
191
|
+
</View>
|
|
192
|
+
}
|
|
193
|
+
<Icons.ChevronIcon direction={show_templates ? 'up' : 'down'} size={8} color={Colors.brand.midnight}/>
|
|
194
|
+
</TouchableOpacity>
|
|
195
|
+
{show_templates ?
|
|
196
|
+
<View>
|
|
197
|
+
<TouchableOpacity style={{ padding:10, borderBottomWidth:1, borderColor:Colors.shades.shade600 }} onPress={() => {
|
|
198
|
+
setDraftSeason({ ...draft_season, following_season_id:undefined })
|
|
199
|
+
setShowTemplates(false);
|
|
200
|
+
}}>
|
|
201
|
+
<Text theme="header_2">NO TEMPLATE</Text>
|
|
202
|
+
</TouchableOpacity>
|
|
203
|
+
<FlatList
|
|
204
|
+
data={templates}
|
|
205
|
+
renderItem={renderTemplates}
|
|
206
|
+
keyExtractor={(item) => item.competition_season_id.toString()}
|
|
207
|
+
/>
|
|
208
|
+
</View>
|
|
209
|
+
:<></>}
|
|
210
|
+
</View>
|
|
211
|
+
</View>
|
|
212
|
+
:<></>}
|
|
213
|
+
</ScrollView>
|
|
214
|
+
<View style={{ ...view_styles.section_footer }}>
|
|
215
|
+
<Button
|
|
216
|
+
title="CLOSE"
|
|
217
|
+
title_color={Colors.shades.white}
|
|
218
|
+
style={{ flex:1, marginRight:8 }}
|
|
219
|
+
padding={15}
|
|
220
|
+
backgroundColor={Colors.utility.error}
|
|
221
|
+
onPress={() => onClose()}
|
|
222
|
+
/>
|
|
223
|
+
<Button
|
|
224
|
+
title="CREATE SEASON"
|
|
225
|
+
title_color={Colors.shades.white}
|
|
226
|
+
loading={action_loading}
|
|
227
|
+
backgroundColor={Colors.utility.success}
|
|
228
|
+
padding={15}
|
|
229
|
+
style={{ flex:2, opacity: !action_loading && errors.length == 0 ? 1 : 0.5 }}
|
|
230
|
+
disabled={errors.length > 0 || action_loading ? true : false}
|
|
231
|
+
onPress={() => handleCreate(draft_season)}
|
|
232
|
+
/>
|
|
233
|
+
</View>
|
|
234
|
+
</View>
|
|
235
|
+
)
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export default CreateSeasonForm
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Image } from 'react-native';
|
|
3
|
+
import type { CompetitionSeasonProps } from '../../types';
|
|
4
|
+
import { Button, Text } from '../../Components';
|
|
5
|
+
import Colors from '../../constants/colors';
|
|
6
|
+
import { view_styles } from '../../constants/styles';
|
|
7
|
+
|
|
8
|
+
type CompetitionHeaderProps = {
|
|
9
|
+
width:number,
|
|
10
|
+
action_loading:boolean,
|
|
11
|
+
competition_season:CompetitionSeasonProps,
|
|
12
|
+
season_valid:boolean,
|
|
13
|
+
onDelete:() => void,
|
|
14
|
+
onActivate: () => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const SeasonHeader = ({ width, action_loading, competition_season, season_valid, onDelete, onActivate }:CompetitionHeaderProps) => {
|
|
18
|
+
|
|
19
|
+
const handleActivate = () => {
|
|
20
|
+
if(!season_valid){
|
|
21
|
+
return alert(`Please complete all the required sections before activating`)
|
|
22
|
+
}
|
|
23
|
+
onActivate()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<View style={{ backgroundColor:Colors.shades.white, flexGrow:1, minWidth:330, maxWidth:width }}>
|
|
28
|
+
<View nativeID="competition_header" style={{ flexDirection:'row', alignItems:'center', padding:20, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
29
|
+
<View>
|
|
30
|
+
<Image
|
|
31
|
+
source={{ uri: competition_season.image?.url ?? 'https://res.cloudinary.com/hoabts6mc/image/upload/v1649737862/be_logo_jte2ux.webp' }}
|
|
32
|
+
style={{ height:50, width:50, borderRadius:4 }}
|
|
33
|
+
resizeMode="cover"
|
|
34
|
+
/>
|
|
35
|
+
</View>
|
|
36
|
+
<View style={{ flex:1, marginLeft:10 }}>
|
|
37
|
+
<Text theme='header'>{competition_season.season_name}</Text>
|
|
38
|
+
<Text style={{ marginTop:4 }} theme='header_2>'>{competition_season.season_description}</Text>
|
|
39
|
+
</View>
|
|
40
|
+
{competition_season.status == 'pending'?
|
|
41
|
+
<Button
|
|
42
|
+
title={'ACTIVATE'}
|
|
43
|
+
style={{ opacity:season_valid ? 1: 0.5 }}
|
|
44
|
+
loading={action_loading}
|
|
45
|
+
title_color={Colors.shades.white}
|
|
46
|
+
backgroundColor={Colors.utility.success}
|
|
47
|
+
onPress={() => handleActivate()}
|
|
48
|
+
/>
|
|
49
|
+
:<></>}
|
|
50
|
+
</View>
|
|
51
|
+
{competition_season.status == 'pending' ?
|
|
52
|
+
<View style={{ ...view_styles.section_header, backgroundColor:Colors.shades.shade100 }}>
|
|
53
|
+
<View style={{ flex:1 }}>
|
|
54
|
+
<Text theme='header'>SEASON IS PENDING</Text>
|
|
55
|
+
<Text style={{ marginTop:3 }} theme='body'>Complete each section and press 'ACTIVATE'.</Text>
|
|
56
|
+
</View>
|
|
57
|
+
<Button
|
|
58
|
+
title='DELETE'
|
|
59
|
+
style={{ opacity:!action_loading? 1: 0.5 }}
|
|
60
|
+
loading={action_loading}
|
|
61
|
+
title_color={Colors.shades.white}
|
|
62
|
+
backgroundColor={Colors.utility.error}
|
|
63
|
+
onPress={async() => {
|
|
64
|
+
const confirmed = await confirm(`Are you sure you would like to delete this competition? This cannot be undone.`)
|
|
65
|
+
if(!confirmed){ return }
|
|
66
|
+
onDelete();
|
|
67
|
+
}}
|
|
68
|
+
/>
|
|
69
|
+
</View>
|
|
70
|
+
:<></>}
|
|
71
|
+
</View>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default SeasonHeader
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { TouchableOpacity, View, Image } from 'react-native';
|
|
3
|
+
import { view_styles } from '../../constants/styles';
|
|
4
|
+
import { Button, Icons, Switch, Text, TextInput } from '../../Components';
|
|
5
|
+
import Colors from '../../constants/colors';
|
|
6
|
+
import ImageUploader from '../../Components/ImageUploader';
|
|
7
|
+
import type { CompetitionSeasonProps, MyPlayerProps } from '../../types';
|
|
8
|
+
import { ManageSeasonHelpers } from '../api';
|
|
9
|
+
|
|
10
|
+
type SeasonInfoFormProps = {
|
|
11
|
+
width:number,
|
|
12
|
+
player?:MyPlayerProps,
|
|
13
|
+
competition_season:CompetitionSeasonProps,
|
|
14
|
+
onSeasonUpdate: (cs:CompetitionSeasonProps) => void
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const SeasonInfoForm = ({ competition_season, player, width, onSeasonUpdate }:SeasonInfoFormProps) => {
|
|
18
|
+
const [ expanded, setExpanded ] = useState(false);
|
|
19
|
+
const [ draft_season, setDraftSeason ] = useState<CompetitionSeasonProps>();
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
setDraftSeason(competition_season)
|
|
23
|
+
},[competition_season])
|
|
24
|
+
|
|
25
|
+
if(!draft_season){ return <></> }
|
|
26
|
+
|
|
27
|
+
const is_changed = ManageSeasonHelpers.isInfoChanged(competition_season, draft_season);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<View style={{ ...view_styles.section }}>
|
|
31
|
+
<TouchableOpacity style={{ ...view_styles.section_header }} onPress={() => setExpanded(!expanded)}>
|
|
32
|
+
<View style={{ flex:1 }}>
|
|
33
|
+
<Text theme='header'>Season Info</Text>
|
|
34
|
+
<Text style={{ marginTop:3 }}>Update high level information for this competition season</Text>
|
|
35
|
+
</View>
|
|
36
|
+
{is_changed ?
|
|
37
|
+
<Button
|
|
38
|
+
title='SAVE'
|
|
39
|
+
padding={10}
|
|
40
|
+
title_color={Colors.shades.white}
|
|
41
|
+
backgroundColor={Colors.utility.success}
|
|
42
|
+
onPress={() => onSeasonUpdate(draft_season)}
|
|
43
|
+
/>
|
|
44
|
+
:
|
|
45
|
+
<Icons.ChevronIcon direction={expanded ? 'up' : 'down'} color={Colors.brand.midnight} size={8} />
|
|
46
|
+
}
|
|
47
|
+
</TouchableOpacity>
|
|
48
|
+
{expanded ?
|
|
49
|
+
<View style={{ ...view_styles.section_body }}>
|
|
50
|
+
<View nativeID="competition_image" style={{ ...view_styles.body_row, flexWrap:'wrap', maxWidth:width, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
51
|
+
<View style={{ flex:1, margin:5, minWidth:200 }}>
|
|
52
|
+
<Text theme='header_2'>Competition Image</Text>
|
|
53
|
+
<Text style={{ marginTop:3 }} theme='body'>Give this competition an image so it is recognizable to those trying to join.</Text>
|
|
54
|
+
</View>
|
|
55
|
+
<ImageUploader
|
|
56
|
+
public_id={`season_image_${draft_season.competition_season_id}_${Math.random()}`}
|
|
57
|
+
onFinishUpload={obj => onSeasonUpdate({ ...draft_season, image: { ...obj, url:obj.secure_url } })}
|
|
58
|
+
>
|
|
59
|
+
<Image
|
|
60
|
+
source={{ uri: draft_season.image?.url }}
|
|
61
|
+
style={{ height: 50, width:50, borderRadius:4 }}
|
|
62
|
+
resizeMode='cover'
|
|
63
|
+
/>
|
|
64
|
+
<Text size={12} color={Colors.brand.electric} textAlign='center'>CHANGE</Text>
|
|
65
|
+
</ImageUploader>
|
|
66
|
+
</View>
|
|
67
|
+
<View nativeID="competition_name" style={{ ...view_styles.body_row, flexWrap:'wrap', maxWidth:width, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
68
|
+
<View style={{ flex:1, margin:5, minWidth:200 }}>
|
|
69
|
+
<Text theme='header_2'>Competition Name</Text>
|
|
70
|
+
<Text style={{ marginTop:3 }} theme='body'>Give the competition a memorable name that aligns with the type and payout.</Text>
|
|
71
|
+
</View>
|
|
72
|
+
<TextInput
|
|
73
|
+
style={{ ...view_styles.input, flexGrow:1, margin:5 }}
|
|
74
|
+
onChangeText={(text) => setDraftSeason({ ...draft_season, season_name:text })}
|
|
75
|
+
value={draft_season.season_name}
|
|
76
|
+
placeholder="Competition Name"
|
|
77
|
+
placeholderTextColor={Colors.brand.slate}
|
|
78
|
+
/>
|
|
79
|
+
</View>
|
|
80
|
+
|
|
81
|
+
<View nativeID="competition_description" style={{ ...view_styles.body_row, flexWrap:'wrap', maxWidth:width, marginTop:10, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
82
|
+
<View style={{ flex:1, margin:5, minWidth:200 }}>
|
|
83
|
+
<Text theme='header_2'>Competition Description</Text>
|
|
84
|
+
<Text style={{ marginTop:3 }} theme='body'>Give the competition a memorable description that would entice users to participate.</Text>
|
|
85
|
+
</View>
|
|
86
|
+
<TextInput
|
|
87
|
+
style={{ ...view_styles.input, flexGrow:1, margin:5 }}
|
|
88
|
+
onChangeText={(text) => setDraftSeason({ ...draft_season, season_description:text })}
|
|
89
|
+
value={draft_season.season_description}
|
|
90
|
+
placeholder="Pick 5 games ATS from NFL Week 6 matchups"
|
|
91
|
+
placeholderTextColor={Colors.brand.slate}
|
|
92
|
+
/>
|
|
93
|
+
</View>
|
|
94
|
+
{player?.role == 'admin' ?
|
|
95
|
+
<View nativeID="invite_only" style={{ ...view_styles.body_row, flexWrap:'wrap', marginTop:10, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
96
|
+
<View style={{ flex:1, margin:5, marginRight:15 }}>
|
|
97
|
+
<Text theme='header_2'>Make Template</Text>
|
|
98
|
+
<Text style={{ marginTop:3 }} theme='body'>Can this season be selected by others to replicate? Any competition created in this competition will be extrapolated to others.</Text>
|
|
99
|
+
</View>
|
|
100
|
+
<Switch
|
|
101
|
+
value={draft_season.template ?? false}
|
|
102
|
+
switch_type="on_off"
|
|
103
|
+
onChange={(value) => onSeasonUpdate({ ...draft_season, template: value })}
|
|
104
|
+
/>
|
|
105
|
+
</View>
|
|
106
|
+
:<></>}
|
|
107
|
+
<View nativeID="invite_only" style={{ ...view_styles.body_row, flexWrap:'wrap', marginTop:10, borderBottomWidth:1, borderColor:Colors.shades.shade600 }}>
|
|
108
|
+
<View style={{ flex:1, margin:5, marginRight:15 }}>
|
|
109
|
+
<Text theme='header_2'>Make Private</Text>
|
|
110
|
+
<Text style={{ marginTop:3 }} theme='body'>Only access this competition using an invite code.</Text>
|
|
111
|
+
</View>
|
|
112
|
+
<Switch
|
|
113
|
+
value={draft_season.invite_only}
|
|
114
|
+
switch_type="on_off"
|
|
115
|
+
onChange={(value) => onSeasonUpdate({ ...draft_season, invite_only: value })}
|
|
116
|
+
/>
|
|
117
|
+
</View>
|
|
118
|
+
</View>
|
|
119
|
+
:<></>}
|
|
120
|
+
</View>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export default SeasonInfoForm
|