Skip to content

Commit

Permalink
fix: event location update error fixed #677
Browse files Browse the repository at this point in the history
fixed evenet location update issue
  • Loading branch information
jasurobo committed Dec 8, 2021
1 parent daff531 commit 6588323
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 44 deletions.
76 changes: 38 additions & 38 deletions component/admin/AdminEventList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,48 @@ import React, { useEffect } from "react";
import moment from "moment";
import notify from "../../lib/notify";
import Image from "next/image";
import EventService from '../../services/EventService'
import EventService from "../../services/EventService";
import MyBlogStyles from "../../styles/MyBlogs.module.css";
import { useRouter } from "next/router";
import Link from "next/link";
function AdminEventList({events, refresh}) {
const router = useRouter()
async function deletevents(eventid){
try{
const data = await EventService.deleteEvent(eventid)
function AdminEventList({ events, refresh }) {
const router = useRouter();
async function deletevents(eventid) {
try {
const data = await EventService.deleteEvent(eventid);
notify(data.message);
refresh()
}
catch(err){
refresh();
} catch (err) {
notify(err?.response?.data?.message ?? err?.message, "error");
}
}
}
const editevent = (id) => {
router.push({
pathname:'events/create-event',
query:{
"id":id
pathname: "events/create-event",
query: {
"id": id
}
})
}
return (
});
};
return (
<div>
<div className="w-full mt-4 bg-white py-5 rounded border shadow-sm overflow-y-auto height_list">
{events &&
events.map((obj, index) => {
return (
<div key={index} className={`flex justify-between items-center py-4 px-4 ${MyBlogStyles.oddBg}`}>
<div
key={index}
className={`flex justify-between items-center py-4 px-4 ${MyBlogStyles.oddBg}`}
>
<div>
<div className="text-gray-900 text-xl hover:text-purple-600 font-semibold ">
<Link
href={
`/events/${obj.id}`
}
>
{obj.title}
</Link>
<Link href={`/events/${obj.id}`}>{obj.title}</Link>
</div>
<div className='flex items-center pt-1 justify-center text-xs '>
<div className={`text-gray-400 `}>{moment(obj.event_time).format("LL")} - </div>
<div className={`text-blue-500`}>{obj.guest_name}</div>
<div className="flex items-center pt-1 text-xs ">
<div className={`text-gray-400 `}>
{moment(obj.event_time).format("LL")} -{" "}
</div>
<div className={`text-blue-500`}>{obj.guest_name}</div>
</div>
</div>
<div className="flex ">
Expand All @@ -60,28 +58,30 @@ function AdminEventList({events, refresh}) {
</span>
</div>
)} */}
<div onClick={()=> deletevents(obj.id)}
<div
onClick={() => deletevents(obj.id)}
className={`flex items-center w-28 justify-center hover:opacity-50 duration-500 cursor-pointer rounded-full h-8 mr-3
${MyBlogStyles.dangerBg}`}
>
<span className={`capitalize ${MyBlogStyles.dangerText}`}>
Delete
</span>
</div>
<div onClick={()=>editevent(obj.id)}
<div
onClick={() => editevent(obj.id)}
className={`flex items-center px-4 justify-center rounded-full h-8 cursor-pointer hover:opacity-50 duration-500 ${MyBlogStyles.linkBg}`}
>
<div className="mr-1 mt-1 rounded-full"></div>
<div className="mr-1 mt-1 rounded-full">
<Image
src="/images/edit.svg"
alt="edit"
width={15}
height={15}
layout="fixed"
margin={0}
/>
</div>
<Image
src="/images/edit.svg"
alt="edit"
width={15}
height={15}
layout="fixed"
margin={0}
/>
</div>
<span className={`capitalize ${MyBlogStyles.linkText}`}>
Edit
</span>
Expand Down
4 changes: 2 additions & 2 deletions component/layout/EventDetails/BookEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import moment from "moment";
import Link from "next/link";

export default function BookEvent({ data,showShare }) {
const { meta_title, description, event_time, location, registration_link } = data;
const { title, description, event_time, location, registration_link } = data;
return (
<div className={styles.Book_Wrap}>
<p className={styles.Book_Title}>Date and Time</p>
Expand All @@ -13,7 +13,7 @@ export default function BookEvent({ data,showShare }) {
</span>
<span className="time">{moment(event_time).format("LT")}</span>
</div>
<Link href={`https://www.google.com/calendar/render?action=TEMPLATE&text=${meta_title}&dates=${event_time}&details=For+details,+Visit+this+link+:+${registration_link}&location=${location}&sf=true&output=xml`}>
<Link href={`https://www.google.com/calendar/render?action=TEMPLATE&text=${title}&dates=${event_time}&details=For+details,+Visit+this+link+:+${registration_link}&location=${location}&sf=true&output=xml`}>
<a target="_blank" className={styles.calender} rel="nofollow">
<span className={styles.icon}>
+
Expand Down
4 changes: 2 additions & 2 deletions component/layout/EventDetails/ShareEvent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
WhatsappShareButton
} from "react-share";
import { FacebookIcon, TwitterIcon, LinkedinIcon, WhatsappIcon } from "react-share";
function ShareEvent({ hidewindow, location }) {
function ShareEvent({ hideWindow, location }) {
const url = location;
const copyToClipBoard = () => {
navigator.clipboard.writeText(url);
Expand All @@ -19,7 +19,7 @@ function ShareEvent({ hidewindow, location }) {
<div className={styles.card}>
<div className={styles.topbar}>
<div>Share</div>
<div onClick={hidewindow} className={styles.close}>
<div onClick={hideWindow} className={styles.close}>
<svg
width="16"
height="16"
Expand Down
1 change: 0 additions & 1 deletion component/layout/EventLayouts/EventFeatured.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import moment from "moment";
import EventDate from "./EventDate";

export default function EventFeatured({ event }) {
console.log(event, 'javascript')
return (
event && (
<section className={styles.section}>
Expand Down
1 change: 1 addition & 0 deletions pages/admin/events/create-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ const CreateEvent = ({referer}) => {
guest_designation: eventDetails.tagLine,
guest_image: eventDetails.organizerImage,
title: eventDetails.eventName,
location: eventDetails.eventLocation,
registration_link: eventDetails.eventLink,
banner_image: eventDetails.eventImage,
description: eventDetails.eventDescription,
Expand Down
2 changes: 1 addition & 1 deletion pages/events/[event_id].js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default function BlogListing({ event }) {
</Head>
<SiteHeader />
{viewShare && (
<ShareEvent location={pageUrl} hidewindow={() => setViewShare(false)} />
<ShareEvent location={pageUrl} hideWindow={() => setViewShare(false)} />
)}
<EventSpotlight showWindow={() => setViewShare(true)} data={event} />
<Detail event={event} />
Expand Down

0 comments on commit 6588323

Please sign in to comment.