From fda6074b14155b4a2717bdc456af425e371e84ad Mon Sep 17 00:00:00 2001 From: ajoalex-neoito Date: Thu, 2 Dec 2021 13:37:32 +0530 Subject: [PATCH] feat: event share #608 created event share component ui and functionality --- component/layout/EventDetails/BookEvent.jsx | 4 ++-- component/layout/EventDetails/EventSpotlight.jsx | 4 ++-- component/layout/EventDetails/ShareEvent.jsx | 4 ++-- package.json | 1 - pages/events/[event_id].js | 15 ++++++--------- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/component/layout/EventDetails/BookEvent.jsx b/component/layout/EventDetails/BookEvent.jsx index 6eed1c6d..26e214fb 100644 --- a/component/layout/EventDetails/BookEvent.jsx +++ b/component/layout/EventDetails/BookEvent.jsx @@ -2,7 +2,7 @@ import styles from "./BookEvent.module.scss"; import moment from "moment"; import Link from "next/link"; -export default function BookEvent({ data,showshare }) { +export default function BookEvent({ data,showShare }) { const { meta_title, description, event_time, location, registration_link } = data; return (
@@ -26,7 +26,7 @@ export default function BookEvent({ data,showshare }) { BOOK NOW - +
); } diff --git a/component/layout/EventDetails/EventSpotlight.jsx b/component/layout/EventDetails/EventSpotlight.jsx index e2ebfa8e..efde1c0b 100644 --- a/component/layout/EventDetails/EventSpotlight.jsx +++ b/component/layout/EventDetails/EventSpotlight.jsx @@ -2,7 +2,7 @@ import BookEvent from "./BookEvent"; import styles from "./EventSpotlight.module.scss"; import GuestDetails from "./GuestDetails"; -export default function EventSpotlight({ data, showwindow }) { +export default function EventSpotlight({ data, showWindow }) { const { banner_image, guest_name, @@ -17,7 +17,7 @@ export default function EventSpotlight({ data, showwindow }) {
{banner_image && Event Image}
- +
diff --git a/component/layout/EventDetails/ShareEvent.jsx b/component/layout/EventDetails/ShareEvent.jsx index cf6a4678..92e03182 100644 --- a/component/layout/EventDetails/ShareEvent.jsx +++ b/component/layout/EventDetails/ShareEvent.jsx @@ -10,7 +10,7 @@ import { import { FacebookIcon, TwitterIcon, LinkedinIcon, WhatsappIcon } from "react-share"; function ShareEvent({ hidewindow, location }) { const url = location; - const copytoclipboard = () => { + const copyToClipBoard = () => { navigator.clipboard.writeText(url); notify("Copied to clipboard", "success"); }; @@ -50,7 +50,7 @@ function ShareEvent({ hidewindow, location }) {
{ - setViewshare(true) - } + const [viewshare, setViewshare] = useState(false) + let pageUrl = window.location.href return ( <> @@ -132,8 +129,8 @@ export default function BlogListing({ event }) { - {viewshare && setViewshare(false)} />} - setViewshare(true)} data={event} /> + {viewshare && setViewshare(false)} />} + setViewshare(true)} data={event} />