removed unused imports
This commit is contained in:
parent
8340fce157
commit
a151dcfd01
2 changed files with 67 additions and 71 deletions
|
@ -16,8 +16,7 @@ import {
|
||||||
LinkIcon,
|
LinkIcon,
|
||||||
} from "@heroicons/react/solid";
|
} from "@heroicons/react/solid";
|
||||||
import Logo from "./Logo";
|
import Logo from "./Logo";
|
||||||
|
import classNames from "@lib/classNames";
|
||||||
|
|
||||||
|
|
||||||
export default function Shell(props) {
|
export default function Shell(props) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
|
@ -4,10 +4,10 @@ import { getSession, useSession } from "next-auth/client";
|
||||||
import Shell from "../../components/Shell";
|
import Shell from "../../components/Shell";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import {Fragment} from 'react';
|
import { Fragment } from "react";
|
||||||
import {Menu, Transition} from '@headlessui/react';
|
import { Menu, Transition } from "@headlessui/react";
|
||||||
import {DotsHorizontalIcon, ExternalLinkIcon, LinkIcon} from '@heroicons/react/solid';
|
import { DotsHorizontalIcon } from "@heroicons/react/solid";
|
||||||
|
import classNames from "@lib/classNames";
|
||||||
|
|
||||||
export default function Bookings({ bookings }) {
|
export default function Bookings({ bookings }) {
|
||||||
const [, loading] = useSession();
|
const [, loading] = useSession();
|
||||||
|
@ -104,76 +104,73 @@ export default function Bookings({ bookings }) {
|
||||||
<>
|
<>
|
||||||
<a
|
<a
|
||||||
href={window.location.href + "/../cancel/" + booking.uid}
|
href={window.location.href + "/../cancel/" + booking.uid}
|
||||||
className="text-xs sm:text-sm inline-flex items-center px-4 py-2 border-transparent font-medium rounded-sm shadow-sm text-neutral-700 bg-white hover:bg-neutral-100 border border-neutral-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black ml-2">
|
className="hidden text-xs sm:text-sm lg:inline-flex items-center px-4 py-2 border-transparent font-medium rounded-sm shadow-sm text-neutral-700 bg-white hover:bg-neutral-100 border border-neutral-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black ml-2">
|
||||||
Cancel
|
Cancel
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href={window.location.href + "/../reschedule/" + booking.uid}
|
href={window.location.href + "/../reschedule/" + booking.uid}
|
||||||
className="text-xs sm:text-sm inline-flex items-center px-4 py-2 border-transparent font-medium rounded-sm shadow-sm text-neutral-700 bg-white hover:bg-neutral-100 border border-neutral-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black ml-2">
|
className="hidden text-xs sm:text-sm lg:inline-flex items-center px-4 py-2 border-transparent font-medium rounded-sm shadow-sm text-neutral-700 bg-white hover:bg-neutral-100 border border-neutral-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black ml-2">
|
||||||
Reschedule
|
Reschedule
|
||||||
</a>
|
</a>
|
||||||
<Menu as="div" className="inline-block text-left">
|
<Menu as="div" className="inline-block lg:hidden text-left ">
|
||||||
{({ open }) => (
|
{({ open }) => (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<Menu.Button className="text-neutral-400 mt-1">
|
<Menu.Button className="text-neutral-400 mt-1">
|
||||||
<span className="sr-only">Open options</span>
|
<span className="sr-only">Open options</span>
|
||||||
<DotsHorizontalIcon className="h-5 w-5" aria-hidden="true" />
|
<DotsHorizontalIcon className="h-5 w-5" aria-hidden="true" />
|
||||||
</Menu.Button>
|
</Menu.Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Transition
|
<Transition
|
||||||
show={open}
|
show={open}
|
||||||
as={Fragment}
|
as={Fragment}
|
||||||
enter="transition ease-out duration-100"
|
enter="transition ease-out duration-100"
|
||||||
enterFrom="transform opacity-0 scale-95"
|
enterFrom="transform opacity-0 scale-95"
|
||||||
enterTo="transform opacity-100 scale-100"
|
enterTo="transform opacity-100 scale-100"
|
||||||
leave="transition ease-in duration-75"
|
leave="transition ease-in duration-75"
|
||||||
leaveFrom="transform opacity-100 scale-100"
|
leaveFrom="transform opacity-100 scale-100"
|
||||||
leaveTo="transform opacity-0 scale-95">
|
leaveTo="transform opacity-0 scale-95">
|
||||||
<Menu.Items
|
<Menu.Items
|
||||||
static
|
static
|
||||||
className="origin-top-right absolute right-0 mt-2 w-56 rounded-sm shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none divide-y divide-neutral-100">
|
className="origin-top-right absolute right-0 mt-2 w-56 rounded-sm shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none divide-y divide-neutral-100">
|
||||||
<div className="py-1">
|
<div className="py-1">
|
||||||
<Menu.Item>
|
<Menu.Item>
|
||||||
{({ active }) => (
|
{({ active }) => (
|
||||||
<a
|
<a
|
||||||
href={"/" + session.user.username + "/" + type.slug}
|
href={window.location.href + "/../cancel/" + booking.uid}
|
||||||
target="_blank"
|
className={classNames(
|
||||||
rel="noreferrer"
|
active
|
||||||
className={classNames(
|
? "bg-neutral-100 text-neutral-900"
|
||||||
active ? "bg-neutral-100 text-neutral-900" : "text-neutral-700",
|
: "text-neutral-700",
|
||||||
"group flex items-center px-4 py-2 text-sm font-medium"
|
"group flex items-center px-4 py-2 text-sm font-medium"
|
||||||
)}>
|
)}>
|
||||||
<ExternalLinkIcon
|
Cancel
|
||||||
className="mr-3 h-5 w-5 text-neutral-400 group-hover:text-neutral-500"
|
</a>
|
||||||
aria-hidden="true"
|
)}
|
||||||
/>
|
</Menu.Item>
|
||||||
Preview
|
<Menu.Item>
|
||||||
</a>
|
{({ active }) => (
|
||||||
)}
|
<a
|
||||||
</Menu.Item>
|
href={
|
||||||
<Menu.Item>
|
window.location.href + "/../reschedule/" + booking.uid
|
||||||
{({ active }) => (
|
}
|
||||||
<button
|
className={classNames(
|
||||||
className={classNames(
|
active
|
||||||
active ? "bg-neutral-100 text-neutral-900" : "text-neutral-700",
|
? "bg-neutral-100 text-neutral-900"
|
||||||
"group flex items-center px-4 py-2 text-sm w-full font-medium"
|
: "text-neutral-700",
|
||||||
)}>
|
"group flex items-center px-4 py-2 text-sm w-full font-medium"
|
||||||
<LinkIcon
|
)}>
|
||||||
className="mr-3 h-5 w-5 text-neutral-400 group-hover:text-neutral-500"
|
Reschedule
|
||||||
aria-hidden="true"
|
</a>
|
||||||
/>
|
)}
|
||||||
Copy link to event
|
</Menu.Item>
|
||||||
</button>
|
</div>
|
||||||
)}
|
</Menu.Items>
|
||||||
</Menu.Item>
|
</Transition>
|
||||||
</div>
|
</>
|
||||||
</Menu.Items>
|
)}
|
||||||
</Transition>
|
</Menu>
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Menu>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{!booking.confirmed && booking.rejected && (
|
{!booking.confirmed && booking.rejected && (
|
||||||
|
@ -229,8 +226,8 @@ export async function getServerSideProps(context) {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const bookings = b.reverse().map(booking=>{
|
const bookings = b.reverse().map((booking) => {
|
||||||
return ({...booking, startTime:booking.startTime.toISOString(), endTime:booking.endTime.toISOString(),})
|
return { ...booking, startTime: booking.startTime.toISOString(), endTime: booking.endTime.toISOString() };
|
||||||
});
|
});
|
||||||
|
|
||||||
return { props: { bookings } };
|
return { props: { bookings } };
|
||||||
|
|
Loading…
Reference in a new issue