From 660b4231b6baebc770a5f32bc0ae0c09a192686d Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Wed, 6 Nov 2024 20:24:01 +0100 Subject: [PATCH 01/14] fix share base url --- .../Profile/Subcomponents/GroupSubHeaderView.tsx | 7 +++---- src/Components/Profile/Templates/OnepagerView.tsx | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx index 92bfc0bd..b3f919c9 100644 --- a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx +++ b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx @@ -1,13 +1,12 @@ -/* eslint-disable camelcase */ import { Item } from '../../../types' import SocialShareBar from './SocialShareBar' export const GroupSubHeaderView = ({ item, - share_base_url, + shareBaseUrl, }: { item: Item - share_base_url: string + shareBaseUrl: string }) => (
@@ -27,7 +26,7 @@ export const GroupSubHeaderView = ({ )}
- +
) diff --git a/src/Components/Profile/Templates/OnepagerView.tsx b/src/Components/Profile/Templates/OnepagerView.tsx index 6ca884c9..5de70e1c 100644 --- a/src/Components/Profile/Templates/OnepagerView.tsx +++ b/src/Components/Profile/Templates/OnepagerView.tsx @@ -8,7 +8,7 @@ export const OnepagerView = ({ item }: { item: Item }) => {
{item.user_created.first_name && } {/* Description Section */} From 7b2254f8f0a1e7494edd46ddf46c315df6f1a64e Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Wed, 6 Nov 2024 20:24:16 +0100 Subject: [PATCH 02/14] 3.0.11 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf3dde9e..fce28092 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.10", + "version": "3.0.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.10", + "version": "3.0.11", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index e606cb74..557e4402 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.10", + "version": "3.0.11", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/", From 8e2fc084dc21adef91700bedc9f213c8ee607ab8 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Wed, 6 Nov 2024 20:25:10 +0100 Subject: [PATCH 03/14] version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 557e4402..5e45aa96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.11", + "version": "3.0.12", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/", From e4f1ed4ccd34ada43b44bb1293291c1e61c648de Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Wed, 6 Nov 2024 20:25:15 +0100 Subject: [PATCH 04/14] 3.0.13 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fce28092..616037b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.11", + "version": "3.0.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.11", + "version": "3.0.13", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index 5e45aa96..af600f5a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.12", + "version": "3.0.13", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/", From f9c3902357a3712b871ddaa32419a4a711003944 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Wed, 6 Nov 2024 20:29:30 +0100 Subject: [PATCH 05/14] 3.0.14 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 616037b5..e1e8f264 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.13", + "version": "3.0.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.13", + "version": "3.0.14", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index af600f5a..0061dbd3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.13", + "version": "3.0.14", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/", From ba369e6d80d4158d262fa058bf400631a3e6ec28 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Wed, 6 Nov 2024 20:29:47 +0100 Subject: [PATCH 06/14] 3.0.15 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e1e8f264..c92ed57b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.14", + "version": "3.0.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.14", + "version": "3.0.15", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index 0061dbd3..9eade727 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.14", + "version": "3.0.15", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/", From f8f7f485a402ad07f097948a285080ef83a77c77 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Thu, 7 Nov 2024 08:07:13 +0100 Subject: [PATCH 07/14] slug share workaround --- src/Components/Map/Subcomponents/ItemFormPopup.tsx | 5 +++-- .../Profile/Subcomponents/GroupSubHeaderView.tsx | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Components/Map/Subcomponents/ItemFormPopup.tsx b/src/Components/Map/Subcomponents/ItemFormPopup.tsx index 45a95ebc..cdc9e498 100644 --- a/src/Components/Map/Subcomponents/ItemFormPopup.tsx +++ b/src/Components/Map/Subcomponents/ItemFormPopup.tsx @@ -105,8 +105,8 @@ export function ItemFormPopup(props: ItemFormPopupProps) { toast.error(error.toString()) } if (success) { - props.layer.onlyOnePerOwner && item && updateItem({ ...item, ...formItem }) - ;(!props.layer.onlyOnePerOwner || !item) && + if (props.layer.onlyOnePerOwner && item) updateItem({ ...item, ...formItem }) + if (!props.layer.onlyOnePerOwner || !item) { addItem({ ...formItem, name: formItem.name ? formItem.name : user?.first_name, @@ -116,6 +116,7 @@ export function ItemFormPopup(props: ItemFormPopupProps) { layer: props.layer, public_edit: !user, }) + } toast.success('New item created') resetFilterTags() } diff --git a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx index b3f919c9..5246fe03 100644 --- a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx +++ b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx @@ -26,7 +26,14 @@ export const GroupSubHeaderView = ({ )}
- +
) From 393ab6ef4c4450f2d37c8776370c665ec6ae181a Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Thu, 7 Nov 2024 08:07:28 +0100 Subject: [PATCH 08/14] 3.0.16 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c92ed57b..591d9b44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.15", + "version": "3.0.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.15", + "version": "3.0.16", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index 9eade727..c4714312 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.15", + "version": "3.0.16", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/", From 2bc5b95151f9f90ff96c99a0ce65c56a81f67f29 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Thu, 7 Nov 2024 08:16:32 +0100 Subject: [PATCH 09/14] added protocoll to share url --- src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx index 5246fe03..58e335d3 100644 --- a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx +++ b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx @@ -30,7 +30,7 @@ export const GroupSubHeaderView = ({ url={ shareBaseUrl && item.slug ? shareBaseUrl + item.slug - : window.location.host + '/item/' + item.id + : window.location.protocol + '//' + window.location.host + '/item/' + item.id } title={item.name} /> From 125538db200368939a3d6e097122c2a37e859053 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Thu, 7 Nov 2024 08:16:39 +0100 Subject: [PATCH 10/14] 3.0.17 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 591d9b44..2f9ba8db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.16", + "version": "3.0.17", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.16", + "version": "3.0.17", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index c4714312..a45662f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.16", + "version": "3.0.17", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/", From 1245d8f3b05360739b29c96ac3832effe1cc3fb4 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Fri, 8 Nov 2024 08:56:36 +0100 Subject: [PATCH 11/14] advanced share buttons and copy to clipboard --- .../Profile/Subcomponents/ContactInfoForm.tsx | 1 + .../Subcomponents/GroupSubHeaderView.tsx | 3 + .../Profile/Subcomponents/SocialShareBar.tsx | 58 +++++++++++++++++++ .../Subcomponents/SocialShareButton.tsx | 32 ++++++++-- 4 files changed, 89 insertions(+), 5 deletions(-) diff --git a/src/Components/Profile/Subcomponents/ContactInfoForm.tsx b/src/Components/Profile/Subcomponents/ContactInfoForm.tsx index 548c85eb..70e7b034 100644 --- a/src/Components/Profile/Subcomponents/ContactInfoForm.tsx +++ b/src/Components/Profile/Subcomponents/ContactInfoForm.tsx @@ -20,6 +20,7 @@ export const ContactInfoForm = ({ setState((prevState) => ({ diff --git a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx index 58e335d3..70a0a41f 100644 --- a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx +++ b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx @@ -4,9 +4,11 @@ import SocialShareBar from './SocialShareBar' export const GroupSubHeaderView = ({ item, shareBaseUrl, + platforms, }: { item: Item shareBaseUrl: string + platforms?: string[] }) => (
@@ -33,6 +35,7 @@ export const GroupSubHeaderView = ({ : window.location.protocol + '//' + window.location.host + '/item/' + item.id } title={item.name} + platforms={platforms} />
diff --git a/src/Components/Profile/Subcomponents/SocialShareBar.tsx b/src/Components/Profile/Subcomponents/SocialShareBar.tsx index f1f7656b..0fdb5070 100644 --- a/src/Components/Profile/Subcomponents/SocialShareBar.tsx +++ b/src/Components/Profile/Subcomponents/SocialShareBar.tsx @@ -1,3 +1,4 @@ +import { toast } from 'react-toastify' import SocialShareButton from './SocialShareButton' const SocialShareBar = ({ @@ -8,11 +9,68 @@ const SocialShareBar = ({ // eslint-disable-next-line react/prop-types platforms = ['facebook', 'twitter', 'linkedin', 'xing', 'email'], }) => { + const copyLink = () => { + navigator.clipboard + .writeText(url) + .then(() => { + toast.success('link copied to clipboard') + }) + .catch((error) => { + toast.error('Fehler beim Kopieren des Links: ', error) + }) + } return (
{platforms.map((platform) => ( ))} + {platforms.includes('email') && ( + copyLink()} + title='copy Link' + > + + + + + )} + {platforms.includes('clipboard') && ( +
copyLink()} + title='copy Link' + > + + + +
+ )}
) } diff --git a/src/Components/Profile/Subcomponents/SocialShareButton.tsx b/src/Components/Profile/Subcomponents/SocialShareButton.tsx index 8ccdedb4..bc294ab8 100644 --- a/src/Components/Profile/Subcomponents/SocialShareButton.tsx +++ b/src/Components/Profile/Subcomponents/SocialShareButton.tsx @@ -38,14 +38,35 @@ const platformConfigs = { ), bgColor: '#026466', }, - email: { - shareUrl: 'mailto:?subject={title}&body={url}', + whatsapp: { + shareUrl: 'https://api.whatsapp.com/send?text={title}%20{url}', icon: ( - - + + ), - bgColor: '#444444', + bgColor: '#25D366', + }, + telegram: { + shareUrl: 'https://t.me/share/url?url={url}&text={title}', + icon: ( + + + + ), + bgColor: '#0088cc', }, } @@ -72,6 +93,7 @@ const SocialShareButton = ({ platform, url, title }) => { color: 'white', backgroundColor: bgColor, }} + title={`share link ${platform === 'email' ? 'via email' : 'on ' + platform}`} > {React.cloneElement(icon, { className: 'tw-w-4 tw-h-4 tw-fill-current' })} From fbfa0d5d7f0e08a2d68d2efe0bde6423ff306416 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Fri, 8 Nov 2024 08:56:50 +0100 Subject: [PATCH 12/14] 3.0.18 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2f9ba8db..8ad741a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.17", + "version": "3.0.18", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.17", + "version": "3.0.18", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index a45662f4..4abcf14c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.17", + "version": "3.0.18", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/", From 7ddd125289fa5c760dd224af11da5eae62a263e1 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Fri, 8 Nov 2024 09:01:46 +0100 Subject: [PATCH 13/14] fix email hint --- src/Components/Profile/Subcomponents/SocialShareBar.tsx | 2 +- src/Components/Profile/Subcomponents/SocialShareButton.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Profile/Subcomponents/SocialShareBar.tsx b/src/Components/Profile/Subcomponents/SocialShareBar.tsx index 0fdb5070..5c246bd1 100644 --- a/src/Components/Profile/Subcomponents/SocialShareBar.tsx +++ b/src/Components/Profile/Subcomponents/SocialShareBar.tsx @@ -35,7 +35,7 @@ const SocialShareBar = ({ backgroundColor: '#444', }} onClick={() => copyLink()} - title='copy Link' + title='share link via email' > { color: 'white', backgroundColor: bgColor, }} - title={`share link ${platform === 'email' ? 'via email' : 'on ' + platform}`} + title={`share link on ${platform}`} > {React.cloneElement(icon, { className: 'tw-w-4 tw-h-4 tw-fill-current' })} From 6e3385ab2080dfffac9865a485f6039547fa2947 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Fri, 8 Nov 2024 09:01:55 +0100 Subject: [PATCH 14/14] 3.0.19 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8ad741a5..f2a27e78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.18", + "version": "3.0.19", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.18", + "version": "3.0.19", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index 4abcf14c..337b2066 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.18", + "version": "3.0.19", "description": "Reuseable React Components to build mapping apps for real life communities and networks", "repository": "https://github.com/utopia-os/utopia-ui", "homepage:": "https://utopia-os.org/",