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.
Files changed (30) hide show
  1. package/lib/commonjs/Components/Icons.js +58 -0
  2. package/lib/commonjs/Components/Icons.js.map +1 -1
  3. package/lib/commonjs/Share/index.js +533 -459
  4. package/lib/commonjs/Share/index.js.map +1 -1
  5. package/lib/commonjs/Squares/components/SquareOfferCard.js +1 -1
  6. package/lib/commonjs/Squares/components/SquareOfferCard.js.map +1 -1
  7. package/lib/module/Components/Icons.js +58 -0
  8. package/lib/module/Components/Icons.js.map +1 -1
  9. package/lib/module/Share/index.js +534 -460
  10. package/lib/module/Share/index.js.map +1 -1
  11. package/lib/module/Squares/components/SquareOfferCard.js +1 -1
  12. package/lib/module/Squares/components/SquareOfferCard.js.map +1 -1
  13. package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
  14. package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
  15. package/lib/typescript/lib/commonjs/Share/index.d.ts +2 -3
  16. package/lib/typescript/lib/commonjs/Share/index.d.ts.map +1 -1
  17. package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
  18. package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
  19. package/lib/typescript/lib/module/Components/Spring.d.ts +87 -86
  20. package/lib/typescript/lib/module/Components/Spring.d.ts.map +1 -1
  21. package/lib/typescript/lib/module/Share/index.d.ts +2 -3
  22. package/lib/typescript/lib/module/Share/index.d.ts.map +1 -1
  23. package/lib/typescript/src/Components/Icons.d.ts +1 -0
  24. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  25. package/lib/typescript/src/Share/index.d.ts +6 -2
  26. package/lib/typescript/src/Share/index.d.ts.map +1 -1
  27. package/package.json +1 -2
  28. package/src/Components/Icons.tsx +18 -0
  29. package/src/Share/index.tsx +250 -228
  30. package/src/Squares/components/SquareOfferCard.tsx +1 -1
@@ -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,
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { FlatList, ActivityIndicator, ScrollView, Platform } from 'react-native';
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 ShareWidget = ({ generated_link_id, title, body, redirect_url, maxWidth, maxHeight, generator, allow_edit, player_id, link_type, link_sub_type, type_id, embed, onCancel, onShare }:ShareWidgetProps) => {
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<{ player:PublicPlayerProps, number:string, sms_result:string } | undefined> => {
122
- if(!Contacts.is_available){ return undefined }
123
- if(!Contacts.permission){ return undefined }
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 undefined
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 undefined } // Sorry we failed
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
- const { result } = await SMS.sendSMSAsync(response.number, `${title} ${url}`, {})
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={{ padding:5 }}>
144
+ <View transparent style={{ paddingRight:5 }}>
146
145
  {data.item.getIcon()}
147
146
  </View>
148
147
  )
149
148
  }
150
149
 
151
- const link_is_changed = JSON.stringify(draft_generated_link) != JSON.stringify(generated_link)
152
- const needs_verification = link_is_changed && !visible_id_valid
153
- return (
154
- <View style={{ ...view_styles.section, minWidth:250, maxWidth, maxHeight }}>
155
- <View type='header' style={{ flexDirection:'row', alignItems:'center', padding:10 }}>
156
- <View style={{ flex:1 }}>
157
- <Text theme='h1'>Share Modal</Text>
158
- <Text style={{ marginTop:3 }} theme='description'>{title}</Text>
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
- <View style={{ padding:10 }}>
182
- <View style={{ ...view_styles.body_row }}>
183
- <View style={{ flex:1 }}>
184
- <Text theme='h2'>Short Link</Text>
185
- <View style={{ flexDirection:'row', alignItems:'center' }}>
186
- <Text style={{ marginTop:3 }} theme='description'>https://share.mybe.app/id/</Text>
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.visible_id}
189
- style={{ ...view_styles.input, flex:1, maxWidth:150 }}
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, visible_id: text },
194
- visible_id_valid: false
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={{ ...view_styles.body_row }}>
202
- <View style={{ flex:1 }}>
203
- <Text theme='h1'>Link Destination</Text>
204
- <TextInput
205
- value={draft_generated_link.redirect_url}
206
- multiline={true}
207
- style={{
208
- ...view_styles.input,
209
- marginTop:4,
210
- flex:1,
211
- height: Math.max(link_height, 35) }}
212
- onContentSizeChange={(ev) => {
213
- setLinkHeight(ev.nativeEvent.contentSize.height)
214
- }}
215
- onChangeText={(text) => {
216
- let new_params = ShareHelpers.extractQueryParams(text);
217
- setLinkStatus({
218
- ...link_status,
219
- draft_generated_link: { ...draft_generated_link, redirect_url: text },
220
- query_params: new_params
221
- })
222
- }}
223
- />
224
- </View>
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
- <View style={{ ...view_styles.section_footer }}>
228
- <Button
229
- title='Cancel'
230
- type='error'
231
- onPress={() => setLinkStatus({ ...link_status, editing: false, draft_generated_link: generated_link })}
232
- />
233
- <View style={{ flex:1 }}/>
234
- {needs_verification ?
235
- <Button
236
- title='Check Link Availability'
237
- style={{ opacity:update_loading?0.5:1 }}
238
- loading={update_loading}
239
- type='info'
240
- onPress={async() => {
241
- setLinkStatus({ ...link_status, update_loading: true })
242
- const is_available = await ShareApi.isGeneratedLinkAvailable(draft_generated_link);
243
- if(!is_available){
244
- setLinkStatus({ ...link_status, update_loading: false })
245
- return alert('Sorry! This link is not available. Please change the visible id portion of the link and try again')
246
- }
247
- setLinkStatus({
248
- ...link_status,
249
- update_loading:false,
250
- visible_id_valid: true
251
- })
252
- }}
253
- />
254
- :
255
- <Button
256
- title='Save'
257
- style={{ opacity:link_is_changed && !update_loading?1:0.5 }}
258
- disabled={!link_is_changed}
259
- loading={update_loading}
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={{ flexDirection:'row', alignItems:'center' }}>
285
- {native_share_allowed ?
286
- <Button style={{ flex:1, flexDirection:'row' }} onPress={async() => {
287
- const share_event = await ShareApi.share(title, body, link_status.url, generated_link.generated_link_id);
288
- if(onShare && share_event){ onShare(share_event) }
289
- }}>
290
- <View float style={{ flexDirection:'row', alignItems:'center', padding:3, paddingRight:10, borderWidth:1, borderRadius:22 }}>
291
- <View style={{ height:36, width:36, marginRight:10, borderRadius:100, justifyContent:'center', alignItems:'center' }}>
292
- <Icons.ShareIcon size={14} color={Colors.text.h1} />
293
- </View>
294
- <FlatList
295
- horizontal
296
- data={native_share_options}
297
- keyExtractor={(item) => item.name}
298
- renderItem={renderNativeOptions}
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
- <View style={{ paddingTop:0, }}>
311
- <View style={{ ...view_styles.body_row }}>
312
- <Text selectable size={16} color={Colors.text.h1} weight='regular'>Copy link</Text>
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
- <View type='row' style={{ padding:10 }}>
315
- {url ?
316
- <Button style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:4 }} onPress={() => Clipboard.setStringAsync(url)}>
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
- <Text style={{ marginLeft:5, flex:1 }} theme='description'>{url}</Text>
322
- {allow_edit ?
323
- <Button style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:4 }} onPress={() => setLinkStatus({ ...link_status, editing: true })}>
324
- <Icons.EditIcon size={18} color={Colors.text.h1} />
325
- </Button>
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
- </View>
330
- }
331
- </View>
332
- : active_tab == 'embed' && embed?.embed_code ?
333
- <View style={{ ...view_styles.section_body, paddingTop:0 }}>
334
- <View style={{ ...view_styles.body_row }}>
335
- <View 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>
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
- <View style={{ padding:10 }}>
341
- <Text selectable size={14} theme='description'>{embed.embed_code}</Text>
342
- <View style={{ ...view_styles.body_row }}>
343
- <Button style={{ flexDirection:'row', alignItems:'center', padding:10, borderRadius:4 }}
344
- onPress={() => Clipboard.setStringAsync(embed.embed_code)}>
345
- <Icons.LinkIcon size={18} color={Colors.text.h1} />
346
- <Text style={{ marginLeft:4 }} size={12} color={Colors.text.h1} textAlign='left'>Copy</Text>
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
- </View>
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
- />
368
- </View>
397
+ )
398
+ default: return <></>
399
+ }
400
+ }
369
401
 
370
- :<></>}
371
- </View>
372
- :<></>}
373
- {active_tab == 'embed' ?
374
- <Button style={{ ...view_styles.section_footer }} onPress={() => setActiveTab('link')}>
375
- <View style={{ flex:1, marginRight:10 }}>
376
- <Text theme='h1'>Share Link Options</Text>
377
- <Text style={{ marginTop:3 }} theme='description'>Customize the link and share</Text>
378
- </View>
379
- <View style={{ height:30, width:30, borderRadius:100, justifyContent:'center', alignItems:'center' }}>
380
- <Icons.LinkIcon color={Colors.text.h1} size={18}/>
381
- </View>
382
- </Button>
383
- : active_tab == 'link' && embed?.embed_code ?
384
- <Button style={{ ...view_styles.section_footer }} onPress={() => setActiveTab('embed')}>
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+': '??''}{square.square_score_x}, {away_abbr+': '??''}{square.square_score_y}</Text>
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>