removed unused code
This commit is contained in:
parent
b4a7a2bc27
commit
3119c35749
3 changed files with 34 additions and 36 deletions
|
@ -210,7 +210,7 @@ function UserDropdown({ session, small, bottom }: { session: any; small?: boolea
|
||||||
<span className="flex-1 flex flex-col min-w-0">
|
<span className="flex-1 flex flex-col min-w-0">
|
||||||
<span className="text-gray-900 text-sm font-medium truncate">{session.user.name}</span>
|
<span className="text-gray-900 text-sm font-medium truncate">{session.user.name}</span>
|
||||||
<span className="text-neutral-500 font-normal text-sm truncate">
|
<span className="text-neutral-500 font-normal text-sm truncate">
|
||||||
{session.user.username}
|
/{session.user.username}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -43,7 +43,7 @@ export default function Login({ csrfToken }) {
|
||||||
</div>
|
</div>
|
||||||
<div className="w-1/2 text-right">
|
<div className="w-1/2 text-right">
|
||||||
<Link href="/auth/forgot-password">
|
<Link href="/auth/forgot-password">
|
||||||
<a className="font-medium text-secondary-600 text-sm">Forgot?</a>
|
<a className="font-medium text-primary-600 text-sm">Forgot?</a>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,7 +7,7 @@ import Select, { OptionBase } from "react-select";
|
||||||
import prisma from "@lib/prisma";
|
import prisma from "@lib/prisma";
|
||||||
import { LocationType } from "@lib/location";
|
import { LocationType } from "@lib/location";
|
||||||
import Shell from "@components/Shell";
|
import Shell from "@components/Shell";
|
||||||
import { getSession, useSession } from "next-auth/client";
|
import { getSession } from "next-auth/client";
|
||||||
import { Scheduler } from "@components/ui/Scheduler";
|
import { Scheduler } from "@components/ui/Scheduler";
|
||||||
import { Disclosure } from "@headlessui/react";
|
import { Disclosure } from "@headlessui/react";
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@ import utc from "dayjs/plugin/utc";
|
||||||
import timezone from "dayjs/plugin/timezone";
|
import timezone from "dayjs/plugin/timezone";
|
||||||
import { Availability, EventType, User } from "@prisma/client";
|
import { Availability, EventType, User } from "@prisma/client";
|
||||||
import { validJson } from "@lib/jsonUtils";
|
import { validJson } from "@lib/jsonUtils";
|
||||||
import Text from "@components/ui/Text";
|
|
||||||
import { RadioGroup } from "@headlessui/react";
|
import { RadioGroup } from "@headlessui/react";
|
||||||
import classnames from "classnames";
|
import classnames from "classnames";
|
||||||
import throttle from "lodash.throttle";
|
import throttle from "lodash.throttle";
|
||||||
|
@ -96,13 +95,12 @@ const PERIOD_TYPES = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function EventTypePage({
|
export default function EventTypePage({
|
||||||
user,
|
user,
|
||||||
eventType,
|
eventType,
|
||||||
locationOptions,
|
locationOptions,
|
||||||
availability,
|
availability,
|
||||||
}: Props): JSX.Element {
|
}: Props): JSX.Element {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [session, loading] = useSession();
|
|
||||||
|
|
||||||
console.log(eventType);
|
console.log(eventType);
|
||||||
const inputOptions: OptionBase[] = [
|
const inputOptions: OptionBase[] = [
|
||||||
|
@ -391,18 +389,18 @@ export default function EventTypePage({
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
</Head>
|
</Head>
|
||||||
<Shell heading={"Event Type: " + eventType.title} subtitle={eventType.description}>
|
<Shell heading={"Event Type: " + eventType.title} subtitle={eventType.description}>
|
||||||
<div className="flex">
|
<div className="block sm:flex">
|
||||||
<div className="w-10/12 mr-2">
|
<div className="w-full sm:w-10/12 mr-2">
|
||||||
<div className="bg-white rounded-sm border border-neutral-200 p-8">
|
<div className="bg-white rounded-sm border border-neutral-200 p-8">
|
||||||
<form onSubmit={updateEventTypeHandler} className="space-y-4">
|
<form onSubmit={updateEventTypeHandler} className="space-y-4">
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label htmlFor="title" className="flex font-medium text-neutral-700 mt-1">
|
<label htmlFor="title" className="flex font-medium text-neutral-700 mt-1">
|
||||||
<PencilIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
<PencilIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
||||||
Title
|
Title
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<input
|
<input
|
||||||
ref={titleRef}
|
ref={titleRef}
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -416,13 +414,13 @@ export default function EventTypePage({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label htmlFor="slug" className="flex font-medium text-neutral-700 mt-1">
|
<label htmlFor="slug" className="flex font-medium text-neutral-700 mt-1">
|
||||||
<LinkIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
<LinkIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
||||||
URL
|
URL
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<div className="flex rounded-sm shadow-sm">
|
<div className="flex rounded-sm shadow-sm">
|
||||||
<span className="inline-flex items-center px-3 rounded-l-sm border border-r-0 border-gray-300 bg-gray-50 text-gray-500 sm:text-sm">
|
<span className="inline-flex items-center px-3 rounded-l-sm border border-r-0 border-gray-300 bg-gray-50 text-gray-500 sm:text-sm">
|
||||||
{typeof location !== "undefined" ? location.hostname : ""}/{user.username}/
|
{typeof location !== "undefined" ? location.hostname : ""}/{user.username}/
|
||||||
|
@ -440,13 +438,13 @@ export default function EventTypePage({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label htmlFor="location" className="flex font-medium text-neutral-700 mt-1">
|
<label htmlFor="location" className="flex font-medium text-neutral-700 mt-1">
|
||||||
<LocationMarkerIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
<LocationMarkerIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
||||||
Location
|
Location
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
{locations.length === 0 && (
|
{locations.length === 0 && (
|
||||||
<div className="mt-1 mb-2">
|
<div className="mt-1 mb-2">
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
|
@ -569,13 +567,13 @@ export default function EventTypePage({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label htmlFor="length" className="flex font-medium text-neutral-700 mt-1">
|
<label htmlFor="length" className="flex font-medium text-neutral-700 mt-1">
|
||||||
<ClockIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
<ClockIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
||||||
Duration
|
Duration
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<div className="mt-1 relative rounded-sm shadow-sm">
|
<div className="mt-1 relative rounded-sm shadow-sm">
|
||||||
<input
|
<input
|
||||||
ref={lengthRef}
|
ref={lengthRef}
|
||||||
|
@ -596,13 +594,13 @@ export default function EventTypePage({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label htmlFor="description" className="flex font-medium text-neutral-700 mt-1">
|
<label htmlFor="description" className="flex font-medium text-neutral-700 mt-1">
|
||||||
<DocumentIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
<DocumentIcon className="w-4 h-4 mr-2 mt-1 text-neutral-500" />
|
||||||
Description
|
Description
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<textarea
|
<textarea
|
||||||
ref={descriptionRef}
|
ref={descriptionRef}
|
||||||
name="description"
|
name="description"
|
||||||
|
@ -623,12 +621,12 @@ export default function EventTypePage({
|
||||||
</Disclosure.Button>
|
</Disclosure.Button>
|
||||||
<Disclosure.Panel className="space-y-4">
|
<Disclosure.Panel className="space-y-4">
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label htmlFor="eventName" className="flex font-medium text-neutral-700 mt-2">
|
<label htmlFor="eventName" className="flex font-medium text-neutral-700 mt-2">
|
||||||
Event name
|
Event name
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<div className="mt-1 relative rounded-sm shadow-sm">
|
<div className="mt-1 relative rounded-sm shadow-sm">
|
||||||
<input
|
<input
|
||||||
ref={eventNameRef}
|
ref={eventNameRef}
|
||||||
|
@ -643,14 +641,14 @@ export default function EventTypePage({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label
|
<label
|
||||||
htmlFor="additionalFields"
|
htmlFor="additionalFields"
|
||||||
className="flex font-medium text-neutral-700 mt-2">
|
className="flex font-medium text-neutral-700 mt-2">
|
||||||
Additional inputs
|
Additional inputs
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<ul className="w-96 mt-1">
|
<ul className="w-96 mt-1">
|
||||||
{customInputs.map((customInput) => (
|
{customInputs.map((customInput) => (
|
||||||
<li key={customInput.label} className="bg-secondary-50 mb-2 p-2 border">
|
<li key={customInput.label} className="bg-secondary-50 mb-2 p-2 border">
|
||||||
|
@ -697,12 +695,12 @@ export default function EventTypePage({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label htmlFor="hidden" className="flex font-medium text-neutral-700">
|
<label htmlFor="hidden" className="flex font-medium text-neutral-700">
|
||||||
Hide event type
|
Hide event type
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<div className="relative flex items-start">
|
<div className="relative flex items-start">
|
||||||
<div className="flex items-center h-5">
|
<div className="flex items-center h-5">
|
||||||
<input
|
<input
|
||||||
|
@ -724,14 +722,14 @@ export default function EventTypePage({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label
|
<label
|
||||||
htmlFor="requiresConfirmation"
|
htmlFor="requiresConfirmation"
|
||||||
className="flex font-medium text-neutral-700">
|
className="flex font-medium text-neutral-700">
|
||||||
Opt-in booking
|
Opt-in booking
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<div className="relative flex items-start">
|
<div className="relative flex items-start">
|
||||||
<div className="flex items-center h-5">
|
<div className="flex items-center h-5">
|
||||||
<input
|
<input
|
||||||
|
@ -753,14 +751,14 @@ export default function EventTypePage({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label
|
<label
|
||||||
htmlFor="inviteesCanSchedule"
|
htmlFor="inviteesCanSchedule"
|
||||||
className="flex font-medium text-neutral-700 mt-2">
|
className="flex font-medium text-neutral-700 mt-2">
|
||||||
Invitees can schedule
|
Invitees can schedule
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<RadioGroup value={periodType} onChange={setPeriodType}>
|
<RadioGroup value={periodType} onChange={setPeriodType}>
|
||||||
<RadioGroup.Label className="sr-only">Date Range</RadioGroup.Label>
|
<RadioGroup.Label className="sr-only">Date Range</RadioGroup.Label>
|
||||||
<div>
|
<div>
|
||||||
|
@ -852,12 +850,12 @@ export default function EventTypePage({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex">
|
<div className="flex">
|
||||||
<div className="w-1/4">
|
<div className="min-w-32">
|
||||||
<label htmlFor="availability" className="flex font-medium text-neutral-700 mt-2">
|
<label htmlFor="availability" className="flex font-medium text-neutral-700 mt-2">
|
||||||
Availability
|
Availability
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-3/4">
|
<div className="w-full">
|
||||||
<Scheduler
|
<Scheduler
|
||||||
setAvailability={setEnteredAvailability}
|
setAvailability={setEnteredAvailability}
|
||||||
setTimeZone={setSelectedTimeZone}
|
setTimeZone={setSelectedTimeZone}
|
||||||
|
@ -885,7 +883,7 @@ export default function EventTypePage({
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-2/12 ml-2 px-4">
|
<div className="w-full sm:w-2/12 ml-2 px-4 mt-8 sm:mt-0 min-w-32">
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<a
|
<a
|
||||||
href={"/" + user.username + "/" + eventType.slug}
|
href={"/" + user.username + "/" + eventType.slug}
|
||||||
|
@ -904,7 +902,7 @@ export default function EventTypePage({
|
||||||
type="button"
|
type="button"
|
||||||
className="flex text-md font-medium text-neutral-700">
|
className="flex text-md font-medium text-neutral-700">
|
||||||
<LinkIcon className="w-4 h-4 mt-1 mr-2 text-neutral-500" />
|
<LinkIcon className="w-4 h-4 mt-1 mr-2 text-neutral-500" />
|
||||||
Copy link to event
|
Copy link
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={deleteEventTypeHandler}
|
onClick={deleteEventTypeHandler}
|
||||||
|
|
Loading…
Reference in a new issue