be-components 3.4.6 → 3.4.7
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/Components/Icons.js +58 -0
- package/lib/commonjs/Components/Icons.js.map +1 -1
- package/lib/commonjs/Share/index.js +533 -459
- package/lib/commonjs/Share/index.js.map +1 -1
- package/lib/commonjs/Squares/components/SquareOfferCard.js +1 -1
- package/lib/commonjs/Squares/components/SquareOfferCard.js.map +1 -1
- package/lib/module/Components/Icons.js +58 -0
- package/lib/module/Components/Icons.js.map +1 -1
- package/lib/module/Share/index.js +534 -460
- package/lib/module/Share/index.js.map +1 -1
- package/lib/module/Squares/components/SquareOfferCard.js +1 -1
- package/lib/module/Squares/components/SquareOfferCard.js.map +1 -1
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/Share/index.d.ts +2 -3
- package/lib/typescript/lib/commonjs/Share/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
- package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/lib/module/Components/Spring.d.ts +87 -86
- package/lib/typescript/lib/module/Components/Spring.d.ts.map +1 -1
- package/lib/typescript/lib/module/Share/index.d.ts +2 -3
- package/lib/typescript/lib/module/Share/index.d.ts.map +1 -1
- package/lib/typescript/src/Components/Icons.d.ts +1 -0
- package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
- package/lib/typescript/src/Share/index.d.ts +6 -2
- package/lib/typescript/src/Share/index.d.ts.map +1 -1
- package/package.json +1 -2
- package/src/Components/Icons.tsx +18 -0
- package/src/Share/index.tsx +250 -228
- package/src/Squares/components/SquareOfferCard.tsx +1 -1
package/src/Components/Icons.tsx
CHANGED
|
@@ -40,6 +40,23 @@ const RefreshIcon = ({ color, size }:IconProps) => {
|
|
|
40
40
|
)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
const ContactsIcon = ({color, size}:IconProps) => {
|
|
44
|
+
return (
|
|
45
|
+
<Svg width={`${size??24}px`} height={`${size??24}px`} viewBox="0 0 28 28">
|
|
46
|
+
<G id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
47
|
+
<G id="contacts-svgrepo-com" transform="translate(2.000000, 2.000000)" stroke={color??Colors.brand.midnight} stroke-width="3">
|
|
48
|
+
<Path d="M2.66666667,5.33333333 L2.66666667,2.66666667 C2.66666667,1.19390667 3.86057333,0 5.33333333,0 L13.3333333,0 L21.3333333,0 C22.8061333,0 24,1.19390667 24,2.66666667 L24,5.33333333 L24,18.6666667 L24,21.3333333 C24,22.8061333 22.8061333,24 21.3333333,24 L13.3333333,24 L5.33333333,24 C3.86057333,24 2.66666667,22.8061333 2.66666667,21.3333333 L2.66666667,18.6666667 L2.66666667,5.33333333 Z" id="Path" stroke-linecap="round" stroke-linejoin="round"></Path>
|
|
49
|
+
<Path d="M17.3333333,12 C17.3333333,14.2092 15.5425333,16 13.3333333,16 C11.1241333,16 9.33333333,14.2092 9.33333333,12 C9.33333333,9.7908 11.1241333,8 13.3333333,8 C15.5425333,8 17.3333333,9.7908 17.3333333,12 Z" id="Path"></Path>
|
|
50
|
+
<Path d="M8,24 C8.56728,20.9237333 10.0266667,20 13.3333333,20 C16.64,20 18.0993333,20.8566667 18.6666667,23.9329333" id="Path" stroke-linecap="round"></Path>
|
|
51
|
+
<Line x1="0" y1="5.33333333" x2="2.66666667" y2="5.33333333" id="Path" stroke-linecap="round" stroke-linejoin="round"></Line>
|
|
52
|
+
<Line x1="0" y1="18.6666667" x2="2.66666667" y2="18.6666667" id="Path" stroke-linecap="round" stroke-linejoin="round"></Line>
|
|
53
|
+
<Line x1="0" y1="12" x2="2.66666667" y2="12" id="Path" stroke-linecap="round" stroke-linejoin="round"></Line>
|
|
54
|
+
</G>
|
|
55
|
+
</G>
|
|
56
|
+
</Svg>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
43
60
|
const SearchIcon = ({ color, size }: IconProps) => {
|
|
44
61
|
const icon_size = size ?? 19
|
|
45
62
|
return (
|
|
@@ -1425,6 +1442,7 @@ export default {
|
|
|
1425
1442
|
IBTFLowIcon,
|
|
1426
1443
|
WithdrawIcon,
|
|
1427
1444
|
DepositIcon,
|
|
1445
|
+
ContactsIcon,
|
|
1428
1446
|
BankInstantIcon,
|
|
1429
1447
|
FacebookIcon,
|
|
1430
1448
|
CreditCardIcon,
|
package/src/Share/index.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { FlatList, ActivityIndicator,
|
|
2
|
+
import { FlatList, ActivityIndicator, Platform } from 'react-native';
|
|
3
3
|
import * as Clipboard from 'expo-clipboard';
|
|
4
4
|
import { view_styles } from '../constants/styles';
|
|
5
5
|
import { Icons } from '../Components';
|
|
@@ -9,7 +9,6 @@ import EmbedPreview from './components/EmbedPreview';
|
|
|
9
9
|
import { useColors } from '../constants/useColors';
|
|
10
10
|
import { Button, Text, TextInput, View } from '../Components/Themed';
|
|
11
11
|
import { useContacts } from '../SocialComponents/Contacts/useContacts';
|
|
12
|
-
import * as SMS from 'expo-sms';
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
|
|
@@ -31,12 +30,15 @@ type ShareWidgetProps = {
|
|
|
31
30
|
},
|
|
32
31
|
onCancel:() => void,
|
|
33
32
|
onShare?:(be_event:BEEventProps) => void,
|
|
33
|
+
onSelectContact:(data:{ player:PublicPlayerProps,number:string }) => void,
|
|
34
34
|
allow_edit?:boolean,
|
|
35
35
|
maxWidth?:number
|
|
36
36
|
maxHeight?:number
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const share_sections = ['header','view_link','edit_link','embed','footer']
|
|
40
|
+
|
|
41
|
+
const ShareWidget = ({ generated_link_id, title, body, redirect_url, generator, allow_edit, player_id, link_type, link_sub_type, type_id, embed, onCancel, onShare, onSelectContact }:ShareWidgetProps) => {
|
|
40
42
|
const Colors = useColors();
|
|
41
43
|
const Contacts = useContacts({});
|
|
42
44
|
const [ preview_embed, setPreviewEmbed ] = useState(false);
|
|
@@ -63,7 +65,7 @@ const ShareWidget = ({ generated_link_id, title, body, redirect_url, maxWidth, m
|
|
|
63
65
|
const { loading, editing, generated_link, draft_generated_link, url, visible_id_valid, update_loading, native_share_allowed } = link_status;
|
|
64
66
|
|
|
65
67
|
const native_share_options = [
|
|
66
|
-
{ name: 'twitter', getIcon: () => <Icons.TwitterXIcon size={18}
|
|
68
|
+
{ name: 'twitter', getIcon: () => <View style={{ backgroundColor:Colors.text.white, padding:2, borderRadius:2 }}><Icons.TwitterXIcon size={18}/></View> },
|
|
67
69
|
{ name: 'instagram', getIcon: () => <Icons.InstagramIcon size={18}/> },
|
|
68
70
|
{ name: 'facebook', getIcon:() => <Icons.FacebookIcon size={18} /> },
|
|
69
71
|
{ name: 'more', getIcon:() => <Icons.MoreIcon size={18} color={Colors.text.h1} /> }
|
|
@@ -118,280 +120,300 @@ const ShareWidget = ({ generated_link_id, title, body, redirect_url, maxWidth, m
|
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
const handleSelectContact = async():Promise<
|
|
122
|
-
if(!Contacts.is_available){ return
|
|
123
|
-
if(!Contacts.permission){ return
|
|
123
|
+
const handleSelectContact = async():Promise<void> => {
|
|
124
|
+
if(!Contacts.is_available){ return }
|
|
125
|
+
if(!Contacts.permission){ return }
|
|
124
126
|
if(!Contacts.permission.granted){
|
|
125
127
|
if(Contacts.permission.canAskAgain){
|
|
126
128
|
Contacts.requestPermissions();
|
|
127
|
-
return
|
|
129
|
+
return
|
|
128
130
|
}
|
|
129
131
|
return //We dont have access!!
|
|
130
132
|
}
|
|
131
133
|
|
|
132
134
|
//Ok! Contacts is granted. Lets select a user
|
|
133
135
|
const response = await Contacts.getContact();
|
|
134
|
-
if(!response){ return
|
|
135
|
-
let avail = await SMS.isAvailableAsync()
|
|
136
|
-
if(!avail){ return undefined }
|
|
136
|
+
if(!response){ return } // Sorry we failed
|
|
137
137
|
const { player, number } = response;
|
|
138
|
-
|
|
139
|
-
return { player, number, sms_result: result }
|
|
138
|
+
onSelectContact({ player, number })
|
|
140
139
|
}
|
|
141
140
|
|
|
142
141
|
|
|
143
142
|
const renderNativeOptions = (data:{ item:any, index:number }) => {
|
|
144
143
|
return (
|
|
145
|
-
<View style={{
|
|
144
|
+
<View transparent style={{ paddingRight:5 }}>
|
|
146
145
|
{data.item.getIcon()}
|
|
147
146
|
</View>
|
|
148
147
|
)
|
|
149
148
|
}
|
|
150
149
|
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
</View>
|
|
160
|
-
<Button
|
|
161
|
-
title='X'
|
|
162
|
-
type='close'
|
|
163
|
-
onPress={() => onCancel()}
|
|
164
|
-
/>
|
|
165
|
-
</View>
|
|
166
|
-
<ScrollView>
|
|
167
|
-
{loading || !generated_link ?
|
|
168
|
-
<View>
|
|
169
|
-
<ActivityIndicator style={{ padding:20, alignSelf:'center' }} color={Colors.text.h1} size={'large'} />
|
|
170
|
-
</View>
|
|
171
|
-
: active_tab == 'link' ?
|
|
172
|
-
<View>
|
|
173
|
-
{editing && draft_generated_link ?
|
|
174
|
-
<View style={{ ...view_styles.section_body }}>
|
|
175
|
-
<View style={{ ...view_styles.body_row }}>
|
|
176
|
-
<View style={{ flex:1 }}>
|
|
177
|
-
<Text size={16} theme='description' weight='regular'>Edit This Link</Text>
|
|
178
|
-
<Text style={{ marginTop:3 }} theme='description'>Edit the visible Id and query parameters below</Text>
|
|
179
|
-
</View>
|
|
150
|
+
const renderSections = (data:{item:string, index:number}) => {
|
|
151
|
+
switch(data.item){
|
|
152
|
+
case 'header':
|
|
153
|
+
return (
|
|
154
|
+
<View type='header' style={{ flexDirection:'row', alignItems:'center', padding:20, borderTopRightRadius:40, borderTopLeftRadius:40 }}>
|
|
155
|
+
<View transparent style={{ flex:1 }}>
|
|
156
|
+
<Text theme='h1'>Share Modal</Text>
|
|
157
|
+
<Text style={{ marginTop:3 }} theme='description'>{title}</Text>
|
|
180
158
|
</View>
|
|
181
|
-
<
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
159
|
+
<Button
|
|
160
|
+
title='X'
|
|
161
|
+
type='close'
|
|
162
|
+
style={{ padding:10 }}
|
|
163
|
+
onPress={() => onCancel()}
|
|
164
|
+
/>
|
|
165
|
+
</View>
|
|
166
|
+
)
|
|
167
|
+
case 'edit_link':
|
|
168
|
+
if(!editing || !draft_generated_link){ return <></> }
|
|
169
|
+
return (
|
|
170
|
+
<View transparent>
|
|
171
|
+
<View transparent type='row' style={{ padding:20 }}>
|
|
172
|
+
<View transparent style={{ flex:1 }}>
|
|
173
|
+
<Text size={16} theme='description' weight='regular'>Edit This Link</Text>
|
|
174
|
+
<Text style={{ marginTop:3 }} theme='description'>Edit the visible Id and query parameters below</Text>
|
|
175
|
+
</View>
|
|
176
|
+
</View>
|
|
177
|
+
<View transparent style={{ padding:10 }}>
|
|
178
|
+
<View transparent type='row' style={{ padding:10 }}>
|
|
179
|
+
<View transparent style={{ flex:1 }}>
|
|
180
|
+
<Text theme='h2'>Short Link</Text>
|
|
181
|
+
<View transparent style={{ flexDirection:'row', alignItems:'center' }}>
|
|
182
|
+
<Text style={{ marginTop:3 }} theme='description'>https://share.mybe.app/id/</Text>
|
|
183
|
+
<TextInput
|
|
184
|
+
value={draft_generated_link.visible_id}
|
|
185
|
+
style={{ flex:1, maxWidth:150 }}
|
|
186
|
+
onChangeText={(text) => {
|
|
187
|
+
setLinkStatus({
|
|
188
|
+
...link_status,
|
|
189
|
+
draft_generated_link: { ...draft_generated_link, visible_id: text },
|
|
190
|
+
visible_id_valid: false
|
|
191
|
+
})
|
|
192
|
+
}}
|
|
193
|
+
/>
|
|
194
|
+
</View>
|
|
195
|
+
</View>
|
|
196
|
+
</View>
|
|
197
|
+
<View transparent type='row' style={{ padding:10 }}>
|
|
198
|
+
<View transparent style={{ flex:1 }}>
|
|
199
|
+
<Text theme='h1'>Link Destination</Text>
|
|
187
200
|
<TextInput
|
|
188
|
-
value={draft_generated_link.
|
|
189
|
-
|
|
201
|
+
value={draft_generated_link.redirect_url}
|
|
202
|
+
multiline={true}
|
|
203
|
+
style={{
|
|
204
|
+
marginTop:4,
|
|
205
|
+
flex:1,
|
|
206
|
+
height: Math.max(link_height, 35) }}
|
|
207
|
+
onContentSizeChange={(ev) => {
|
|
208
|
+
setLinkHeight(ev.nativeEvent.contentSize.height)
|
|
209
|
+
}}
|
|
190
210
|
onChangeText={(text) => {
|
|
211
|
+
let new_params = ShareHelpers.extractQueryParams(text);
|
|
191
212
|
setLinkStatus({
|
|
192
213
|
...link_status,
|
|
193
|
-
draft_generated_link: { ...draft_generated_link,
|
|
194
|
-
|
|
214
|
+
draft_generated_link: { ...draft_generated_link, redirect_url: text },
|
|
215
|
+
query_params: new_params
|
|
195
216
|
})
|
|
196
217
|
}}
|
|
197
218
|
/>
|
|
198
219
|
</View>
|
|
199
220
|
</View>
|
|
200
221
|
</View>
|
|
201
|
-
<View style={{
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
<View type='footer' style={{ padding:10 }}>
|
|
223
|
+
<Button
|
|
224
|
+
title='Cancel'
|
|
225
|
+
type='error'
|
|
226
|
+
style={{ marginBottom:10 }}
|
|
227
|
+
onPress={() => setLinkStatus({ ...link_status, editing: false, draft_generated_link: generated_link })}
|
|
228
|
+
/>
|
|
229
|
+
<View transparent style={{ flex:1 }}/>
|
|
230
|
+
{needs_verification ?
|
|
231
|
+
<Button
|
|
232
|
+
float
|
|
233
|
+
title='Check Link Availability'
|
|
234
|
+
style={{ opacity:update_loading?0.5:1 }}
|
|
235
|
+
loading={update_loading}
|
|
236
|
+
type='info'
|
|
237
|
+
onPress={async() => {
|
|
238
|
+
setLinkStatus({ ...link_status, update_loading: true })
|
|
239
|
+
const is_available = await ShareApi.isGeneratedLinkAvailable(draft_generated_link);
|
|
240
|
+
if(!is_available){
|
|
241
|
+
setLinkStatus({ ...link_status, update_loading: false })
|
|
242
|
+
return alert('Sorry! This link is not available. Please change the visible id portion of the link and try again')
|
|
243
|
+
}
|
|
244
|
+
setLinkStatus({
|
|
245
|
+
...link_status,
|
|
246
|
+
update_loading:false,
|
|
247
|
+
visible_id_valid: true
|
|
248
|
+
})
|
|
249
|
+
}}
|
|
250
|
+
/>
|
|
251
|
+
:
|
|
252
|
+
<Button
|
|
253
|
+
title='Save'
|
|
254
|
+
style={{ opacity:link_is_changed && !update_loading?1:0.5 }}
|
|
255
|
+
disabled={!link_is_changed}
|
|
256
|
+
loading={update_loading}
|
|
257
|
+
type='success'
|
|
258
|
+
onPress={async() => {
|
|
259
|
+
setLinkStatus({ ...link_status, update_loading: true });
|
|
260
|
+
const new_link = await ShareApi.updateGeneratedLink(draft_generated_link);
|
|
261
|
+
if(!new_link?.generated_link){ return alert('Unable to update link') }
|
|
262
|
+
setLinkStatus({
|
|
263
|
+
...link_status,
|
|
264
|
+
update_loading: false,
|
|
265
|
+
editing: false,
|
|
266
|
+
generated_link: new_link?.generated_link,
|
|
267
|
+
draft_generated_link: new_link?.generated_link,
|
|
268
|
+
url: new_link?.url
|
|
269
|
+
});
|
|
270
|
+
}}
|
|
271
|
+
/>
|
|
272
|
+
}
|
|
225
273
|
</View>
|
|
226
274
|
</View>
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
<View style={{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
style={{
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
type='success'
|
|
261
|
-
onPress={async() => {
|
|
262
|
-
setLinkStatus({ ...link_status, update_loading: true });
|
|
263
|
-
const new_link = await ShareApi.updateGeneratedLink(draft_generated_link);
|
|
264
|
-
if(!new_link?.generated_link){ return alert('Unable to update link') }
|
|
265
|
-
setLinkStatus({
|
|
266
|
-
...link_status,
|
|
267
|
-
update_loading: false,
|
|
268
|
-
editing: false,
|
|
269
|
-
generated_link: new_link?.generated_link,
|
|
270
|
-
draft_generated_link: new_link?.generated_link,
|
|
271
|
-
url: new_link?.url
|
|
272
|
-
});
|
|
273
|
-
}}
|
|
274
|
-
/>
|
|
275
|
-
}
|
|
276
|
-
</View>
|
|
277
|
-
</View>
|
|
278
|
-
:
|
|
279
|
-
<View style={{ ...view_styles.section_body }}>
|
|
280
|
-
<View style={{ paddingBottom:0 }}>
|
|
281
|
-
<View style={{ ...view_styles.body_row }}>
|
|
282
|
-
<Text size={16} color={Colors.text.h1} weight='regular'>Share this link via</Text>
|
|
275
|
+
)
|
|
276
|
+
case 'view_link':
|
|
277
|
+
if(!generated_link || active_tab != 'link'){ return <></> }
|
|
278
|
+
if(editing){ return <></> }
|
|
279
|
+
return (
|
|
280
|
+
<View style={{ ...view_styles.section_body }}>
|
|
281
|
+
<View style={{ paddingBottom:0 }}>
|
|
282
|
+
<View style={{ ...view_styles.body_row }}>
|
|
283
|
+
<Text size={16} color={Colors.text.h1} weight='regular'>Share this link via</Text>
|
|
284
|
+
</View>
|
|
285
|
+
<View style={{ flexDirection:'row', alignItems:'center', marginBottom:10 }}>
|
|
286
|
+
{native_share_allowed ?
|
|
287
|
+
<Button float style={{ flex:1, flexDirection:'row', alignItems:'center', padding:10, marginRight:5 }} onPress={async() => {
|
|
288
|
+
const share_event = await ShareApi.share(title, body, link_status.url, generated_link.generated_link_id);
|
|
289
|
+
if(onShare && share_event){ onShare(share_event) }
|
|
290
|
+
}}> <View style={{ marginRight:10 }}>
|
|
291
|
+
<Icons.ShareIcon size={19} color={Colors.text.h1} />
|
|
292
|
+
</View>
|
|
293
|
+
<FlatList
|
|
294
|
+
horizontal
|
|
295
|
+
data={native_share_options}
|
|
296
|
+
keyExtractor={(item) => item.name}
|
|
297
|
+
renderItem={renderNativeOptions}
|
|
298
|
+
/>
|
|
299
|
+
</Button>
|
|
300
|
+
:<></>}
|
|
301
|
+
{Platform.OS != 'web' && Contacts.is_available ?
|
|
302
|
+
<Button float style={{ flex:1, flexDirection:'row', alignItems:'center', padding:10, marginLeft:5 }} onPress={() => handleSelectContact()}>
|
|
303
|
+
<Icons.ContactsIcon size={24} color={Colors.text.h1} />
|
|
304
|
+
<Text style={{ marginLeft:5 }} theme='h2'>Select Contact</Text>
|
|
305
|
+
</Button>
|
|
306
|
+
:<></>}
|
|
307
|
+
</View>
|
|
283
308
|
</View>
|
|
284
|
-
<View style={{
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
<
|
|
293
|
-
</
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
309
|
+
<View style={{ paddingTop:0, }}>
|
|
310
|
+
<View style={{ ...view_styles.body_row }}>
|
|
311
|
+
<Text selectable size={16} color={Colors.text.h1} weight='regular'>Copy link</Text>
|
|
312
|
+
</View>
|
|
313
|
+
<View type='row' style={{ padding:10 }}>
|
|
314
|
+
{url ?
|
|
315
|
+
<Button style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:4 }} onPress={() => Clipboard.setStringAsync(url)}>
|
|
316
|
+
<Icons.LinkIcon size={18} color={Colors.text.h1} />
|
|
317
|
+
<Text style={{ marginLeft:4 }} size={12} color={Colors.text.h1} textAlign='left'>Copy</Text>
|
|
318
|
+
</Button>
|
|
319
|
+
:<></>}
|
|
320
|
+
<Text style={{ marginLeft:5, flex:1 }} theme='description'>{url}</Text>
|
|
321
|
+
{allow_edit ?
|
|
322
|
+
<Button style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:4 }} onPress={() => setLinkStatus({ ...link_status, editing: true })}>
|
|
323
|
+
<Icons.EditIcon size={18} color={Colors.text.h1} />
|
|
324
|
+
</Button>
|
|
325
|
+
:<></>}
|
|
300
326
|
</View>
|
|
301
|
-
</Button>
|
|
302
|
-
:<></>}
|
|
303
|
-
{Platform.OS != 'web' && Contacts.is_available ?
|
|
304
|
-
<Button onPress={() => handleSelectContact()}>
|
|
305
|
-
<Text>Contacts!</Text>
|
|
306
|
-
</Button>
|
|
307
|
-
:<></>}
|
|
308
327
|
</View>
|
|
309
328
|
</View>
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
329
|
+
)
|
|
330
|
+
case 'view_embed':
|
|
331
|
+
if(!embed){ return <></> }
|
|
332
|
+
return (
|
|
333
|
+
<View>
|
|
334
|
+
<View transparent type='row' style={{ padding:10 }}>
|
|
335
|
+
<View transparent style={{ flex:1 }}>
|
|
336
|
+
<Text size={16} theme='description'>Embed this in your website</Text>
|
|
337
|
+
<Text style={{ marginTop:3 }} theme='light'>Copy and past the code snippet below into the 'body' tag</Text>
|
|
313
338
|
</View>
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
339
|
+
</View>
|
|
340
|
+
<View transparent style={{ padding:10 }}>
|
|
341
|
+
<Text selectable size={14} theme='description'>{embed.embed_code}</Text>
|
|
342
|
+
<View type='row' transparent style={{ padding:5 }}>
|
|
343
|
+
<Button style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:4 }}
|
|
344
|
+
onPress={() => Clipboard.setStringAsync(embed.embed_code)}>
|
|
317
345
|
<Icons.LinkIcon size={18} color={Colors.text.h1} />
|
|
318
346
|
<Text style={{ marginLeft:4 }} size={12} color={Colors.text.h1} textAlign='left'>Copy</Text>
|
|
319
347
|
</Button>
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
348
|
+
<View transparent style={{ flex:1 }} />
|
|
349
|
+
{embed.widget_element && embed.script_source && embed.div_id && Platform.OS == 'web' ?
|
|
350
|
+
<Button
|
|
351
|
+
title={preview_embed ? 'Hide Preview' : 'Show Preview'}
|
|
352
|
+
title_color={Colors.text.white}
|
|
353
|
+
disabled={Platform.OS != 'web' ? true : false}
|
|
354
|
+
backgroundColor={preview_embed ? Colors.text.error : Colors.text.action}
|
|
355
|
+
onPress={() => setPreviewEmbed(!preview_embed)}
|
|
356
|
+
/>
|
|
326
357
|
:<></>}
|
|
327
358
|
</View>
|
|
328
359
|
</View>
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
<Text style={{ marginTop:3 }} theme='light'>Copy and past the code snippet below into the 'body' tag</Text>
|
|
360
|
+
|
|
361
|
+
{preview_embed && embed.widget_element && embed.script_source && embed.div_id ?
|
|
362
|
+
<View style={{ borderWidth:1, borderRadius:4 }}>
|
|
363
|
+
<EmbedPreview
|
|
364
|
+
script_source={embed.script_source}
|
|
365
|
+
widget_element={embed.widget_element}
|
|
366
|
+
div_id={embed.div_id}
|
|
367
|
+
/>
|
|
338
368
|
</View>
|
|
369
|
+
:<></>}
|
|
339
370
|
</View>
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
<
|
|
371
|
+
)
|
|
372
|
+
case 'footer':
|
|
373
|
+
return (
|
|
374
|
+
<View type='footer'>
|
|
375
|
+
{active_tab == 'embed' ?
|
|
376
|
+
<Button transparent style={{ flexDirection:'row', alignItems:'center' }} onPress={() => setActiveTab('link')}>
|
|
377
|
+
<View transparent style={{ flex:1, marginRight:10 }}>
|
|
378
|
+
<Text theme='h1'>Share Link Options</Text>
|
|
379
|
+
<Text style={{ marginTop:3 }} theme='description'>Customize the link and share</Text>
|
|
380
|
+
</View>
|
|
381
|
+
<View transparent style={{ height:30, width:30, borderRadius:100, justifyContent:'center', alignItems:'center' }}>
|
|
382
|
+
<Icons.LinkIcon color={Colors.text.h1} size={18}/>
|
|
383
|
+
</View>
|
|
384
|
+
</Button>
|
|
385
|
+
: active_tab == 'link' && embed?.embed_code ?
|
|
386
|
+
<Button transparent style={{ flexDirection:'row', alignItems:'center' }} onPress={() => setActiveTab('embed')}>
|
|
387
|
+
<View transparent style={{ flex:1, marginRight:10 }}>
|
|
388
|
+
<Text theme='h1'>Available For Embed</Text>
|
|
389
|
+
<Text style={{ marginTop:3 }} theme='description'>Copy code snippet and paste into the html of your website</Text>
|
|
390
|
+
</View>
|
|
391
|
+
<View transparent style={{ height:30, width:30, borderRadius:100, justifyContent:'center', alignItems:'center' }}>
|
|
392
|
+
<Icons.EmbedIcon color={Colors.text.h1} size={18}/>
|
|
393
|
+
</View>
|
|
347
394
|
</Button>
|
|
348
|
-
<View style={{ flex:1 }} />
|
|
349
|
-
{embed.widget_element && embed.script_source && embed.div_id && Platform.OS == 'web' ?
|
|
350
|
-
<Button
|
|
351
|
-
title={preview_embed ? 'Hide Preview' : 'Show Preview'}
|
|
352
|
-
title_color={Colors.text.white}
|
|
353
|
-
disabled={Platform.OS != 'web' ? true : false}
|
|
354
|
-
backgroundColor={preview_embed ? Colors.text.error : Colors.text.action}
|
|
355
|
-
onPress={() => setPreviewEmbed(!preview_embed)}
|
|
356
|
-
/>
|
|
357
395
|
:<></>}
|
|
358
396
|
</View>
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
<EmbedPreview
|
|
364
|
-
script_source={embed.script_source}
|
|
365
|
-
widget_element={embed.widget_element}
|
|
366
|
-
div_id={embed.div_id}
|
|
367
|
-
/>
|
|
368
|
-
</View>
|
|
397
|
+
)
|
|
398
|
+
default: return <></>
|
|
399
|
+
}
|
|
400
|
+
}
|
|
369
401
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
<View style={{ flex:1, marginRight:10 }}>
|
|
386
|
-
<Text theme='h1'>Available For Embed</Text>
|
|
387
|
-
<Text style={{ marginTop:3 }} theme='description'>Copy code snippet and paste into the html of your website</Text>
|
|
388
|
-
</View>
|
|
389
|
-
<View style={{ height:30, width:30, borderRadius:100, justifyContent:'center', alignItems:'center' }}>
|
|
390
|
-
<Icons.EmbedIcon color={Colors.text.h1} size={18}/>
|
|
391
|
-
</View>
|
|
392
|
-
</Button>
|
|
393
|
-
:<></>}
|
|
394
|
-
</ScrollView>
|
|
402
|
+
const link_is_changed = JSON.stringify(draft_generated_link) != JSON.stringify(generated_link)
|
|
403
|
+
const needs_verification = link_is_changed && !visible_id_valid
|
|
404
|
+
return (
|
|
405
|
+
<View float style={{ borderTopRightRadius:40, borderTopLeftRadius:40 }}>
|
|
406
|
+
<FlatList
|
|
407
|
+
data={share_sections}
|
|
408
|
+
renderItem={renderSections}
|
|
409
|
+
keyExtractor={(item) => item}
|
|
410
|
+
key={'share_section_list'}
|
|
411
|
+
/>
|
|
412
|
+
{loading ?
|
|
413
|
+
<View type='blur' style={{ position:'absolute', top:0, left:0, right:0, bottom:0, alignItems:'center', padding:20 }}>
|
|
414
|
+
<ActivityIndicator color={Colors.text.h1} size={'large'} />
|
|
415
|
+
</View>
|
|
416
|
+
:<></>}
|
|
395
417
|
</View>
|
|
396
418
|
)
|
|
397
419
|
}
|
|
@@ -47,7 +47,7 @@ const SquareOfferCard = ({ player_id, square, player_square, square_offer, away_
|
|
|
47
47
|
<View style={view_styles.section_body}>
|
|
48
48
|
<View style={view_styles.body_row}>
|
|
49
49
|
<Text style={{ flex:1 }} theme='body'>Square</Text>
|
|
50
|
-
<Text theme='header_2'>{home_abbr
|
|
50
|
+
<Text theme='header_2'>{home_abbr??''}: {square.square_score_x}, {away_abbr??''}: {square.square_score_y}</Text>
|
|
51
51
|
</View>
|
|
52
52
|
<View style={view_styles.body_row}>
|
|
53
53
|
<Text style={{ flex:1 }} theme='body'>Purchased For</Text>
|