Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing Photopicker #104

Open
wants to merge 316 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
316 commits
Select commit Hold shift + click to select a range
5ab26fd
Possible fix for CookieYes being blocked, relevant to https://github.…
edwh Jul 18, 2024
39aec61
Possible fix for CookieYes being blocked, relevant to https://github.…
edwh Jul 18, 2024
03dea18
Possible fix for CookieYes being blocked, relevant to https://github.…
edwh Jul 18, 2024
30c9f28
Try ResizeObserver polyfill for Uppy.
edwh Jul 18, 2024
0b1014e
Merge pull request #102 from Freegle/uppy
edwh Jul 18, 2024
0241de0
Image zoom looks skew-whiff.
edwh Jul 18, 2024
df3c5ae
Title tag wrong.
edwh Jul 18, 2024
3628245
Chat image upload broken
edwh Jul 18, 2024
88362fa
ChitChat story image too large.
edwh Jul 18, 2024
807dee5
Images on message page are blurry.
edwh Jul 18, 2024
1b64823
Not showing images on story
edwh Jul 18, 2024
963a488
Not showing images on story
edwh Jul 18, 2024
0aa4ce6
Not showing images on story
edwh Jul 18, 2024
bfad189
Align image in chat modal.
edwh Jul 18, 2024
f309151
Fix sentry check logic.
edwh Jul 18, 2024
794061f
Handle broken images better.
edwh Jul 19, 2024
58112fc
Profile photo appears not to upload
edwh Jul 19, 2024
40adf1c
Red splodge on heatmap
edwh Jul 19, 2024
11b51da
Minor perf fix for ChitChat
edwh Jul 19, 2024
dd10e38
Problems with some minor photo uploads.
edwh Jul 19, 2024
a002632
Change Hide to Cancel on volop/event add modal.
edwh Jul 19, 2024
458251d
Remove code to wait for CMP complete before allowing modals
edwh Jul 20, 2024
ea73a34
Disable Sentry until Cookie Banner processed.
edwh Jul 20, 2024
c6ac9c1
Disable Sentry until Cookie Banner processed.
edwh Jul 20, 2024
cca221a
Revert "Disable Sentry until Cookie Banner processed."
edwh Jul 20, 2024
f900866
Revert "Disable Sentry until Cookie Banner processed."
edwh Jul 20, 2024
e65f59a
Revert "Remove code to wait for CMP complete before allowing modals"
edwh Jul 20, 2024
a8c4348
Revert "Revert "Disable Sentry until Cookie Banner processed.""
edwh Jul 20, 2024
0ff0b8f
Revert "Revert "Remove code to wait for CMP complete before allowing …
edwh Jul 20, 2024
317cf15
Revert "Revert "Disable Sentry until Cookie Banner processed.""
edwh Jul 20, 2024
233a733
Revert "Revert "Revert "Disable Sentry until Cookie Banner processed."""
edwh Jul 20, 2024
04a1ce5
Revert "Revert "Revert "Remove code to wait for CMP complete before a…
edwh Jul 20, 2024
0cccde8
Revert "Revert "Revert "Disable Sentry until Cookie Banner processed."""
edwh Jul 20, 2024
83a410b
Fix props issue
edwh Jul 20, 2024
3144ade
Remove floating vue module which may be interfering with CookieYes cl…
edwh Jul 20, 2024
ba25c93
Remove code to wait for CMP complete before allowing modals
edwh Jul 20, 2024
e7ab2e9
Disable Sentry until Cookie Banner processed.
edwh Jul 20, 2024
34dfb6b
Disable Sentry until Cookie Banner processed.
edwh Jul 20, 2024
ae5d95d
Revert "Disable Sentry until Cookie Banner processed."
edwh Jul 20, 2024
4257b19
Revert "Disable Sentry until Cookie Banner processed."
edwh Jul 20, 2024
508b75a
LoginModal no-close-on-backdrop may be blocking clicks on the CookieY…
edwh Jul 20, 2024
2eed1d0
Disable Sentry until Cookie Banner processed.
edwh Jul 20, 2024
b979609
Disable Sentry until Cookie Banner processed.
edwh Jul 20, 2024
59873bc
Revert "LoginModal no-close-on-backdrop may be blocking clicks on the…
edwh Jul 20, 2024
eff04ac
Try no-trap for login / cookie issue
edwh Jul 20, 2024
d9eb564
Try teleportDisabled for login / cookie issue.
edwh Jul 20, 2024
caafd5d
Revert "Try teleportDisabled for login / cookie issue."
edwh Jul 20, 2024
9f2486a
Revert "Try no-trap for login / cookie issue"
edwh Jul 20, 2024
857bad5
Upgrade bootstrap-vue-next
edwh Jul 21, 2024
0c34872
Number left badge has font colour wrong.
edwh Jul 21, 2024
eccead8
Upgrade bootstrap-vue-next so that noTrap is available, as possible f…
edwh Jul 21, 2024
4c37270
Reminder to use 127.0.0.1 not localhost when testing.
edwh Jul 21, 2024
c2ccf5f
In Chat photo upload, open Uppy immediately when you click the upload…
edwh Jul 21, 2024
010b39e
Handle Uppy close better in Chat.
edwh Jul 21, 2024
6ea2279
Remove debug
edwh Jul 21, 2024
427d9ff
Photo uploader not correctly restricting to one/many photos.
edwh Jul 21, 2024
60e00b4
Change camera to only allow photos, not videos.
edwh Jul 21, 2024
b86683a
Change camera facing mode.
edwh Jul 21, 2024
e74fe2b
Change camera facing mode.
edwh Jul 21, 2024
74a57a6
Change camera facing mode.
edwh Jul 21, 2024
582a372
Improve Uppy mobile dashboard layout.
edwh Jul 21, 2024
f5c9249
Change camera facing mode.
edwh Jul 21, 2024
21f9980
Change camera facing mode.
edwh Jul 21, 2024
9ae0bdc
Improve Uppy mobile dashboard layout.
edwh Jul 21, 2024
2ed3eb0
Opening messages on photo is causing confusion
edwh Jul 21, 2024
f3b89b9
Remove more checking on CookieYes loading now that the click problem …
edwh Jul 21, 2024
584e70f
Rotate buttons are rotating in wrong direction.
edwh Jul 21, 2024
1f58fd9
Once open image on mobile, can't get back to reply.
edwh Jul 21, 2024
87bd696
In Chat photo upload, open Uppy immediately when you click the upload…
edwh Jul 21, 2024
75f3d92
Add GTM tracking for ad optimisation.
edwh Jul 21, 2024
ccf8c47
Sentry problem.
edwh Jul 21, 2024
c4109a4
Improve error on sign up.
edwh Jul 22, 2024
56839cb
Button to take photo can be hidden on mobile
edwh Jul 22, 2024
4f816ca
Build errors if GTM_ID not configured in environment
edwh Jul 22, 2024
9970b05
On ChitChat, show to mods who hid an item.
edwh Jul 23, 2024
5ba7950
Try asking people who are microvolunteers to invite.
edwh Jul 23, 2024
e445399
Try asking people who are microvolunteers to invite.
edwh Jul 23, 2024
718fde8
Sentry error
edwh Jul 23, 2024
339d753
Microvolunteering debug left on and asking too often
edwh Jul 23, 2024
67eec8e
Tweaks to image zoom
edwh Jul 24, 2024
6ffe4f5
Tweaks to image zoom
edwh Jul 24, 2024
dc35743
Image carousel buttons not positioning correctly in modal.
edwh Jul 24, 2024
ee08756
Sentry error
edwh Jul 24, 2024
7b50575
Change opacity on image buttons.
edwh Jul 24, 2024
a57b750
Shorten wording in sidebars.
edwh Jul 24, 2024
8ea894c
When typing in chitchat on mobile, the bottom navbar can slide in and…
edwh Jul 24, 2024
e6b69b1
Fix carousel previous button
edwh Jul 25, 2024
6f95081
Use fade for photo carousel, because the slide goes the wrong way.
edwh Jul 25, 2024
32f517a
ContactPicker is rarely available. Change how invitations work.
edwh Jul 25, 2024
54b9051
Try showing the camera chooser when uploading.
edwh Jul 25, 2024
26eb868
Remove debug text.
edwh Jul 25, 2024
fb90d7d
Layout of message modal close circle.
edwh Jul 25, 2024
8c5a908
Layout of message modal close circle.
edwh Jul 25, 2024
50fa61c
More image zoom issues.
edwh Jul 25, 2024
099b1a0
Fix microvolunteering invite
edwh Jul 26, 2024
45904e3
ChitChat broken by hiddenby.
edwh Jul 29, 2024
0df889c
Merge remote-tracking branch 'origin/production' into production
edwh Jul 29, 2024
f3f87c1
Encourage references on donations.
edwh Jul 29, 2024
c18f878
Sentry error in photo rotate.
edwh Jul 29, 2024
506f6d0
Merge remote-tracking branch 'origin/production' into production
edwh Jul 29, 2024
f59f356
More work on microvolunteering invites.
edwh Jul 29, 2024
6aadf23
Update ads.txt for AdSense
edwh Jul 29, 2024
8701bc1
Remove invalid variable.
edwh Jul 29, 2024
e4993a1
First pass National Reuse Day page.
edwh Jul 30, 2024
55ac75c
First pass National Reuse Day page.
edwh Jul 30, 2024
dcb1fea
Change NRD image.
edwh Jul 31, 2024
cc0687e
Change NRD image.
edwh Jul 31, 2024
8490fce
Can't upload photos in chat
edwh Jul 31, 2024
fe46d4e
Sentry problem - crash in chat photo upload.
edwh Aug 1, 2024
c395093
Add zoom buttons for larger image
edwh Aug 1, 2024
7a8d6d8
Photo upload problem where popup won't close.
edwh Aug 1, 2024
6c22931
Photo upload problem where popup won't close.
edwh Aug 1, 2024
7382d4f
Allow drag and drop on photo uploader.
edwh Aug 1, 2024
6ae4153
Message store should use object rather than array as sparse.
edwh Aug 3, 2024
e3f3143
* Ask whether things can be delivered, and show if you say yes.
edwh Aug 3, 2024
c0a987b
New user handling not working properly - not seeing password etc afte…
edwh Aug 3, 2024
3d368c3
Changes to zoom on image.
edwh Aug 4, 2024
d196629
Sentry error.
edwh Aug 4, 2024
e878756
Asking for delivery after posting WANTED
edwh Aug 4, 2024
d929220
Photo improvements.
edwh Aug 4, 2024
c20fcd6
Handle postcode searches on landing page better - new Photon release …
edwh Aug 5, 2024
6f1265c
Add image for Ecosend mail footer.
edwh Aug 6, 2024
b21d25a
Add polyfill for Object.hasOwn, required by Safari 14.
edwh Aug 7, 2024
c75c3a7
Ask if there is a deadline for a post.
edwh Aug 7, 2024
e6707ee
Sentry error
edwh Aug 7, 2024
b64c006
Improve event/volop summary on ChitChat for mobile.
edwh Aug 8, 2024
ce7cda8
Improve event/volop summary on ChitChat for mobile.
edwh Aug 8, 2024
80391b7
Fix warning
edwh Aug 8, 2024
2180bbc
Say when the system hid a chitchat post/reply
edwh Aug 8, 2024
0c08d88
Allow image zoom on My Posts.
edwh Aug 8, 2024
652b81e
Tweak ChitChat display for community events created by system
edwh Aug 10, 2024
faf740e
Tweak modal display for community events created by system
edwh Aug 10, 2024
e8a9608
Event images not showing up on ChitChat.
edwh Aug 10, 2024
a602f54
Show counts for events/volops on desktop navbar
edwh Aug 10, 2024
68529f2
Sentry error.
edwh Aug 10, 2024
e99c1a0
Record when we have seen events/volops
edwh Aug 10, 2024
bff9577
Long search on My Posts needs to wrap
edwh Aug 11, 2024
7919b0c
Merge branch 'refs/heads/production' into develop
edwh Aug 12, 2024
8b0d6f5
WIP AdSense
edwh Aug 12, 2024
97a7167
WIP AdSense
edwh Aug 12, 2024
0d8863a
WIP AdSense
edwh Aug 12, 2024
5ebce35
WIP AdSense
edwh Aug 12, 2024
f9422b7
WIP AdSense
edwh Aug 12, 2024
67ca1de
WIP AdSense
edwh Aug 13, 2024
dc2f519
Don't do site update check except on production branch.
edwh Aug 13, 2024
7b4a525
Choose better pageUrl for AdSense.
edwh Aug 13, 2024
a2efe35
WIP AdSense
edwh Aug 13, 2024
9ed9206
Sentry error.
edwh Aug 13, 2024
e2a8098
ChitChat noticeboard photo not shown correctly.
edwh Aug 13, 2024
0203b41
Warn if setting deadline of the same day
edwh Aug 14, 2024
e2db9a1
Fix warning.
edwh Aug 14, 2024
66bf681
Ad fettling.
edwh Aug 14, 2024
b23d996
Remove unnecessary padding.
edwh Aug 14, 2024
44136e6
Refactor Google Ads and Prebid Ads into separate components.
edwh Aug 14, 2024
e432658
Rework ads to be responsive
edwh Aug 14, 2024
13a8586
Rework ads to be responsive
edwh Aug 14, 2024
bb08f6e
Too many ad refreshes?
edwh Aug 14, 2024
d6a098c
Make a bit more room in chat for small mobile screens.
edwh Aug 14, 2024
d8acbcf
Make a bit more room in chat for small mobile screens.
edwh Aug 15, 2024
b8dfd3b
Remove more Uploadcare code.
edwh Aug 15, 2024
9c2fcec
Remove more Uploadcare code.
edwh Aug 15, 2024
0fe4171
Tweak ad for message modal.
edwh Aug 16, 2024
ef913b2
Rework browse on mobile to show two posts side by side
edwh Aug 16, 2024
ac5d74d
Rework browse on mobile to show two posts side by side
edwh Aug 16, 2024
60ad068
Rework browse on mobile to show two posts side by side
edwh Aug 16, 2024
b27a18b
Code tidy.
edwh Aug 16, 2024
bfec7eb
More on two column layout
edwh Aug 16, 2024
47f9b24
More on two column layout
edwh Aug 16, 2024
f8d1273
Restore some message info on desktop view.
edwh Aug 17, 2024
b67b426
Ad space should collapse in message modal if no ad rendered.
edwh Aug 17, 2024
5f0cd56
Setting wrong env variable.
edwh Aug 17, 2024
47199d9
Better UX on deadline ask.
edwh Aug 17, 2024
f5a911f
Reduce Chris crankiness.
edwh Aug 17, 2024
89e925c
Time out ad render
edwh Aug 17, 2024
1ace8f7
Fix warning.
edwh Aug 17, 2024
c00b94a
More fettling of photos
edwh Aug 17, 2024
cf0e645
More ad fettling.
edwh Aug 17, 2024
2b643bb
Once you've replied to a post, show others from the same user
edwh Aug 19, 2024
1f111d5
Mobile landing page layout messed up by recent message display changes
edwh Aug 19, 2024
f12d0a1
Possible fix for ad overlapping buttons on chat.
edwh Aug 19, 2024
0396bf4
Revert "Possible fix for ad overlapping buttons on chat."
edwh Aug 19, 2024
4e51ed9
Possible fix for ad overlapping buttons on chat.
edwh Aug 19, 2024
719990b
Improve mobile browse layout some more
edwh Aug 20, 2024
28af05a
Suppress "Something went wrong" when unloading the page - happens dur…
edwh Aug 20, 2024
6a3cb7e
Introduce Reminder type into chat for collection reminders.
edwh Aug 20, 2024
102d92e
Introduce Reminder type into chat for collection reminders.
edwh Aug 20, 2024
56529b8
Remove mention of drag/drop in Uppy.
edwh Aug 21, 2024
18e2480
More fiddling with two-column browse layout
edwh Aug 22, 2024
c72360b
Allow ads to be turned off via server config.
edwh Aug 22, 2024
0442705
WIP Rework ads some more. Add a call-to-action to turn off ads by do…
edwh Aug 22, 2024
25442c4
Rework ads some more, sort out sidebars.
edwh Aug 23, 2024
be34af6
Rework ads some more, sort out sidebars.
edwh Aug 23, 2024
c5f49ce
Possible issue with v-bind, mapState, reactivity
edwh Aug 23, 2024
deae121
Tweak wording, fix ad thermometer
edwh Aug 23, 2024
4f1e7fc
Tweak wording
edwh Aug 23, 2024
48add35
Make hate ads message more prominent
edwh Aug 23, 2024
2faab7d
Fix warning.
edwh Aug 23, 2024
83b5a18
Fix warning
edwh Aug 23, 2024
9c39092
Encourage ad blocker folk to donate.
edwh Aug 23, 2024
8c60cf5
Switch to ad period of 24 hours - more donations happen in the evening.
edwh Aug 23, 2024
09e03e0
Switch to ad period of 24 hours - more donations happen in the evening.
edwh Aug 23, 2024
501fbf7
Donation button fix
edwh Aug 23, 2024
fba09dc
Tweak adsoff wording.
edwh Aug 23, 2024
2e5f87d
Tweak adsoff wording.
edwh Aug 23, 2024
a99ee12
Track clicks on adsoff page
edwh Aug 24, 2024
0a8617f
Try "donate and we'll turn ads off for a month"
edwh Aug 24, 2024
b5e753d
Add charity number to promotional material
edwh Aug 24, 2024
f5c3162
Try "donate and we'll turn ads off for a month"
edwh Aug 24, 2024
42fe678
Tweak adsoff wording.
edwh Aug 24, 2024
e0b6d30
Update privacy policy.
edwh Aug 24, 2024
6e14b09
Add test page for Google Pay
edwh Aug 24, 2024
7c146ff
Not disabling ads for recent donors
edwh Aug 24, 2024
ba20eac
Add test page for Google Pay
edwh Aug 24, 2024
2afda25
Tweak adsoff wording.
edwh Aug 24, 2024
ed1a883
Add test page for Google Pay
edwh Aug 24, 2024
bf6452d
Fix ad blocker message on mobile.
edwh Aug 24, 2024
fd9ace5
Fix warning.
edwh Aug 24, 2024
ab7206a
Improve address suggestion in chat, speed up typing in chat area.
edwh Aug 24, 2024
0294dc9
Improve address suggestion in chat, speed up typing in chat area.
edwh Aug 24, 2024
1cad502
Improve address suggestion in chat, speed up typing in chat area.
edwh Aug 24, 2024
70f2158
Improve address suggestion in chat, speed up typing in chat area.
edwh Aug 24, 2024
2c116ee
Landing page on mobile has OFFER/WANTED label misplaced.
edwh Aug 24, 2024
081313e
Improve address suggestion in chat, speed up typing in chat area.
edwh Aug 25, 2024
0af36e7
Add test page for Google Pay
edwh Aug 25, 2024
1b8f396
Add test page for Google Pay
edwh Aug 25, 2024
a2ba66f
Add test page for Google Pay
edwh Aug 25, 2024
dd69d71
Add charity number to promotional material
edwh Aug 25, 2024
d3eafb4
Suppress a couple of leaflet Sentry errors
edwh Aug 25, 2024
05840ea
Suppress a couple of leaflet Sentry errors
edwh Aug 25, 2024
9eb3e1a
If an item is promised to someone who didn't specifically reply to th…
edwh Aug 25, 2024
472a05c
If there is no photo, then in the mobile view show some of the descri…
edwh Aug 25, 2024
9ca17d0
Add A5x2 poster in English
edwh Aug 25, 2024
dff75bd
Sentry error in removing attachment.
edwh Aug 26, 2024
ad77d79
Keep sticky ad alive over page transitions.
edwh Aug 27, 2024
55bfa1f
Possible fix for characters disappearing.
edwh Aug 27, 2024
47a1918
Nit for dear Wanda.
edwh Aug 28, 2024
18eb443
Fixes for very small mobile screens.
edwh Aug 28, 2024
935c768
Google Pay
edwh Aug 28, 2024
7d2863d
Google Pay
edwh Aug 28, 2024
7a899fc
Google Pay
edwh Aug 28, 2024
5f50e25
Google Pay
edwh Aug 29, 2024
1698793
Possible fix for characters disappearing.
edwh Aug 29, 2024
a9b0631
Add extra diagnostics for upload issues.
edwh Aug 30, 2024
f41c769
Add extra diagnostics for upload issues.
edwh Aug 30, 2024
d95110b
Add extra diagnostics for upload issues.
edwh Aug 30, 2024
2c0ffb3
Photo picker testing.
edwh Aug 30, 2024
62a366c
Allow edit of deadline, show deadline when post not available.
edwh Sep 1, 2024
312efe6
Send on enter missing letters for quick typers.
edwh Sep 3, 2024
314299d
Can't scroll to the bottom of ChitChat.
edwh Sep 3, 2024
4c41b8f
Image size overflows in two-column layout
edwh Sep 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ContactPicker is rarely available. Change how invitations work.
  • Loading branch information
edwh committed Jul 25, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 32f517a5c1afc242c6eb7e883d5bfa1110763209
216 changes: 76 additions & 140 deletions components/InviteSomeone.vue
Original file line number Diff line number Diff line change
@@ -1,101 +1,79 @@
<template>
<div>
<div v-if="!contactsAvailable" class="layout">
<div>
<b-button variant="primary" size="lg" @click="getContacts">
Invite your friends!
</b-button>
</div>
<div class="d-flex flex-column justify-content-center">
<p class="small m-0">
It'll ask for access to your contacts. <strong>Don't worry</strong> -
this doesn't mean we can access all of them! You choose which ones to
invite. We don't pass this information to our servers, we don't store
it, and we can't access it in future. You're in control.
</p>
</div>
</div>
<div v-else>
<label for="invitation" class="font-weight-bold">
Personalise your invitation message:
</label>
<b-form-textarea
id="invitation"
v-model="invitation"
maxlength="160"
rows="3"
size="lg"
placeholder="Tell your friends why they should get freegling!"
class="mt-2 mb-2 border border-primary"
/>
<div v-if="phones.length">
<component :is="headingLevel" class="mt-2">
Invite by WhatsApp
</component>
<ExternalLink
v-for="phone in phones"
:key="'phone-' + phone.phone"
:href="
'whatsapp://send?phone=' +
phone.phone +
'&text=' +
encodeURIComponent(invitation)
"
@click="chosen"
<b-form-textarea
id="invitation"
v-model="invitation"
maxlength="160"
rows="3"
size="lg"
placeholder="Tell your friends why they should get freegling!"
class="mt-2 mb-2 border border-primary"
/>
<b-list-group :key="'messageshare-' + bump" horizontal class="flex-wrap">
<b-list-group-item>
<ShareNetwork
network="facebook"
:url="url"
:title="title"
:description="invitation"
hashtags="freegle,free,reuse"
@open="chosen"
>
<b-button variant="primary" class="mb-1 mr-1">
<v-icon :icon="['fab', 'whatsapp']" /> {{ phone.name }}
<span class="small"
><span class="small">{{ phone.phone }}</span></span
>
<b-button variant="secondary" class="mt-1 facebook">
<v-icon :icon="['fab', 'facebook']" /> Facebook
</b-button>
</ExternalLink>
<component :is="headingLevel" class="mt-2">
Invite by text (SMS)
</component>
<ExternalLink
v-for="phone in phones"
:key="'sms-' + phone.phone"
:href="
'sms://' + phone.phone + ';?&body=' + encodeURIComponent(invitation)
"
@click="chosen"
</ShareNetwork>
</b-list-group-item>
<b-list-group-item>
<ShareNetwork
network="twitter"
:url="url"
:title="title"
:description="invitation"
hashtags="freegle,free,reuse"
@open="chosen"
>
<b-button variant="primary" class="mb-1 mr-1">
<v-icon icon="sms" /> {{ phone.name }}
<span class="small"
><span class="small">{{ phone.phone }}</span></span
>
<b-button variant="secondary" class="mt-1 twitter">
<v-icon :icon="['fab', 'twitter']" /> Twitter
</b-button>
</ExternalLink>
</div>
<div v-if="emails.length">
<component :is="headingLevel" class="mt-2"> Invite by email </component>
<ExternalLink
v-for="email in emails"
:key="'email-' + email"
:href="
'mailto:' +
email.email +
'?subject=Have you tried Freegle%3F&body=' +
encodeURIComponent(invitation)
"
class="mb-1 mr-1"
@click="chosen"
</ShareNetwork>
</b-list-group-item>
<b-list-group-item>
<ShareNetwork
network="whatsapp"
:url="url"
:title="title"
:description="invitation"
hashtags="freegle,free,reuse"
@open="chosen"
>
<b-button variant="primary">
<v-icon icon="envelope" /> {{ email.email }}
<b-button variant="secondary" class="mt-1 whatsapp">
<v-icon :icon="['fab', 'whatsapp']" /> Whatsapp
</b-button>
</ExternalLink>
</div>
</div>
</ShareNetwork>
</b-list-group-item>
<b-list-group-item>
<ShareNetwork
network="email"
url=""
:title="title"
:description="invitation"
hashtags="freegle,free,reuse"
@open="chosen"
>
<b-button variant="secondary" class="mt-1 gmail">
<v-icon icon="envelope" /> Email
</b-button>
</ShareNetwork>
</b-list-group-item>
</b-list-group>
</div>
</template>
<script>
import ExternalLink from './ExternalLink'
import VueSocialSharing from 'vue-social-sharing'
import { useNuxtApp } from '#imports'

export default {
components: { ExternalLink },
props: {
headingLevel: {
type: String,
@@ -108,67 +86,25 @@ export default {
default: true,
},
},
setup() {
// We install this plugin here rather than from the plugins folder to reduce page load side in the mainline
// case.
const nuxtApp = useNuxtApp()
nuxtApp.vueApp.use(VueSocialSharing)

const runtimeConfig = useRuntimeConfig()

return {
url: runtimeConfig.public.USER_SITE,
}
},
data() {
return {
contacts: null,
invitation:
"Hi - I'm using Freegle to give and get things for free. Check it out at https://www.ilovefreegle.org",
title: 'Have you heard about Freegle?',
}
},
computed: {
contactsAvailable() {
return this.contacts?.length
},
emails() {
const ret = []

if (this.contacts) {
this.contacts.forEach((c) => {
if (c.email) {
c.email.forEach((e) => {
ret.push({
name: c.name ? c.name[0] : null,
email: e,
})
})
}
})
}

return ret
},
phones() {
const ret = []

if (this.contacts) {
this.contacts.forEach((c) => {
if (c.tel) {
c.tel.forEach((e) => {
// Fix up the formatting a bit, particular for IOS which is picky.
let phoneno = e.replace(/\s+/g, '')

if (phoneno.length > 1) {
if (phoneno.charAt(0) === '0' && phoneno.charAt(1) !== '0') {
// Convert to UK prefix.
phoneno = '+44' + phoneno.substring(1)
}
}

// Ignore dups.
if (!ret.find((p) => p.phone === phoneno)) {
ret.push({
name: c.name ? c.name[0] : null,
phone: phoneno,
})
}
})
}
})
}

return ret
},
},
mounted() {
this.$api.bandit.shown({
uid: 'Invite',
5 changes: 4 additions & 1 deletion components/MicroVolunteeringInvite.vue
Original file line number Diff line number Diff line change
@@ -9,7 +9,10 @@
A personal recommendation is worth a thousand online ads - and anyway, we
can't afford a thousand online ads!
</p>
<p>Could you help spread the word?</p>
<p>
Could you help spread the word? Personalise your message and send it using
the buttons below.
</p>
<InviteSomeone class="mt-2" :trust-pilot="false" @invited="invited" />
</div>
</template>
21 changes: 9 additions & 12 deletions pages/promote.vue
Original file line number Diff line number Diff line change
@@ -7,7 +7,15 @@
Wouldn't the world be better if more people freegled more often? You can
help!
</p>
<div v-if="contactPicker">
<div>
<p>
Freegle spreads by <strong>word of mouth</strong>. Maybe you've got
friends, family or work colleagues who've never heard of us, and who
could help themseves or others by freegling?
</p>
<p>
Personalise your message and send it to them using the buttons below.
</p>
<InviteSomeone />
<hr />
<h2 class="header--size2">Other ways to help</h2>
@@ -250,17 +258,6 @@ export default {
showPosterModal: false,
}
},
computed: {
contactPicker() {
if (process.server) {
return false
} else {
const ret =
'contacts' in window.navigator && 'ContactsManager' in window
return ret
}
},
},
methods: {
added() {
this.showPosterModal = true