diff --git a/.DS_Store b/.DS_Store index bc281f0e..206831e9 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/src/components/helpers/sharemodal/ShareModal.jsx b/src/components/helpers/sharemodal/ShareModal.jsx index df192a3b..a96fb73c 100644 --- a/src/components/helpers/sharemodal/ShareModal.jsx +++ b/src/components/helpers/sharemodal/ShareModal.jsx @@ -8,12 +8,12 @@ import { toast } from 'react-toastify'; import './sharemodal.scss'; -export default function ShareModal({ modalClose, data }) { +export default function ShareModal({ modalClose, data, type }) { const getMessage = (text) => variables.language.getMessage(variables.languagecode, text); const url = variables.constants.MARKETPLACE_URL + '/share/' + btoa(data.api_name); const copyLink = () => { - navigator.clipboard.writeText(url); + navigator.clipboard.writeText(data); toast('Link copied!'); }; @@ -33,7 +33,7 @@ export default function ShareModal({ modalClose, data }) { onClick={() => window .open( - `https://twitter.com/intent/tweet?text=Check out ${data.data.name} on @getmue marketplace: ${url}`, + `https://twitter.com/intent/tweet?text=Check out ${data.data.name} on @getmue marketplace: ${data}`, '_blank', ) .focus() @@ -45,7 +45,7 @@ export default function ShareModal({ modalClose, data }) { - ) : null} {this.state.currentTab !== 0 ? ( - ) : null} + ) : ( + + )} diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx index c983caef..435d187f 100644 --- a/src/components/widgets/background/PhotoInformation.jsx +++ b/src/components/widgets/background/PhotoInformation.jsx @@ -12,6 +12,7 @@ import { MdSource as Source, } from 'react-icons/md'; import Tooltip from '../../helpers/tooltip/Tooltip'; +import Modal from 'react-modal'; import ShareModal from '../../helpers/sharemodal/ShareModal'; //import Hotkeys from 'react-hot-keys'; import { toast } from 'react-toastify'; @@ -50,6 +51,7 @@ export default function PhotoInformation({ info, url, api }) { const [showExtraInfo, setshowExtraInfo] = useState(false); const [showOld, setShowOld] = useState(true); const [other, setOther] = useState(false); + const [shareModal, openShareModal] = useState(false); if (info.hidden === true || !info.credit) { return null; @@ -199,6 +201,19 @@ export default function PhotoInformation({ info, url, api }) { onMouseEnter={() => setOther(true)} onMouseLeave={() => setOther(false)} > + openShareModal(false)} + > + openShareModal(false)} + /> + {localStorage.getItem('widgetStyle') === 'legacy' && (
@@ -270,7 +285,7 @@ export default function PhotoInformation({ info, url, api }) { <>
- copyImage(info)} /> + openShareModal(true)} /> @@ -308,10 +323,12 @@ export default function PhotoInformation({ info, url, api }) { {width}x{height}
- {api ?
- - {api.charAt(0).toUpperCase() + api.slice(1)} -
: null} + {api ? ( +
+ + {api.charAt(0).toUpperCase() + api.slice(1)} +
+ ) : null}
) : null}