diff --git a/package-lock.json b/package-lock.json index cf3dde9e..f2a27e78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "utopia-ui", - "version": "3.0.10", + "version": "3.0.19", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "utopia-ui", - "version": "3.0.10", + "version": "3.0.19", "license": "GPL-3.0-only", "dependencies": { "@heroicons/react": "^2.0.17", diff --git a/package.json b/package.json index e606cb74..337b2066 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utopia-ui", - "version": "3.0.10", + "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/", 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/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 92bfc0bd..70a0a41f 100644 --- a/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx +++ b/src/Components/Profile/Subcomponents/GroupSubHeaderView.tsx @@ -1,13 +1,14 @@ -/* eslint-disable camelcase */ import { Item } from '../../../types' import SocialShareBar from './SocialShareBar' export const GroupSubHeaderView = ({ item, - share_base_url, + shareBaseUrl, + platforms, }: { item: Item - share_base_url: string + shareBaseUrl: string + platforms?: string[] }) => (
@@ -27,7 +28,15 @@ export const GroupSubHeaderView = ({ )}
- +
) diff --git a/src/Components/Profile/Subcomponents/SocialShareBar.tsx b/src/Components/Profile/Subcomponents/SocialShareBar.tsx index f1f7656b..5c246bd1 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='share link via email' + > + + + + + )} + {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..58b6aaa5 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 on ${platform}`} > {React.cloneElement(icon, { className: 'tw-w-4 tw-h-4 tw-fill-current' })} 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 */}