* Fix breadcrumb colors * HorizontalTabs * Team List Item WIP * Horizontal Tabs * Cards * Remove team list item WIP * Login Page * Add welcome back i118n * EventType page work * Update EventType Icons * WIP Availability * Horizontal Tab Work * Add build command for in root * Update build DIr/command * Add Edit Button + change buttons to v2 * Availablitiy page * Fix IPAD * Make mobile look a little nicer * WIP bookingshell * Remove list items from breaking build * Mian bulk of Booking Page. * Few updates to components * Fix chormatic feedback * Fix banner * Fix Empty Screen * Text area + embded window fixes * Semi fix avatar * Troubleshoot container + Active on count * Improve mobile * NITS * Fix padding on input * Fix icons * Starting to move event types settings to tabs * Begin migration to single page form * Single page tabs * Limits Page * Advanced tab * Add RHF to dependancies * Most of advanced tab * Solved RHF mismtach * Build fixes * RHF conditionals fixes * Improved legibility * Major refactor/organisation into optional V2 UI * Portal EditLocationModal * Fix dialoug form * Update imports * Auto Animate + custom inputs WIP * Custom Inputs * WIP Apps * Fixing stories imports * Stripe app * Remove duplicate dialog * Remove duplicate dialog * Fix embed URL * Fix app toggles + number of active apps * Fix container padding on disabledBorder prop * Removes strict * EventType Team page WIP * Fix embed * NIT * Add Darkmode gray color * V2 Shell WIP * Fix headings on shell V2 * Fix mobile layout with V2 shell * V2 create event type button * Checked Team Select * Hidden to happen on save - not on toggle * Team Attendee Select animation * Fix scheduling type and remove multi select label * Fix overflow on teams url * Even Type move order handles * Fix Embed TS errors * Fix TS errors * Fix Eslint errors * Fix TS errors for UI * Fix ESLINT error * added SidebarCard for promo to v2 and storybook (#3906) Co-authored-by: Julian Benegas <julianbenegas99@gmail.com> Co-authored-by: Alan <alannnc@gmail.com> Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com> * Tooltip Provider - Wrapper due to dep upgrade * public event type list darkmode * V2 Color changes to public booking * Remove unused component * Fix typecheck * Removed extra buttons on create ET dialog * ET edit page refactoring * Avoids form wrapping the whole Shell * Nitpicks Co-authored-by: Peer Richelsen <peeroke@gmail.com> Co-authored-by: zomars <zomars@me.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Julian Benegas <julianbenegas99@gmail.com> Co-authored-by: Alan <alannnc@gmail.com>
96 lines
3.8 KiB
TypeScript
96 lines
3.8 KiB
TypeScript
import React, { useState, useEffect } from "react";
|
|
|
|
import dayjs from "@calcom/dayjs";
|
|
import { WEBAPP_URL } from "@calcom/lib/constants";
|
|
import { inferQueryOutput, trpc } from "@calcom/trpc/react";
|
|
import Select from "@calcom/ui/form/Select";
|
|
import TimezoneSelect, { ITimezone } from "@calcom/ui/form/TimezoneSelect";
|
|
import { Avatar } from "@calcom/ui/v2";
|
|
import DatePicker from "@calcom/ui/v2/core/form/DatePicker";
|
|
|
|
import LicenseRequired from "../../common/components/LicenseRequired";
|
|
import TeamAvailabilityTimes from "./TeamAvailabilityTimes";
|
|
|
|
interface Props {
|
|
team?: inferQueryOutput<"viewer.teams.get">;
|
|
member?: inferQueryOutput<"viewer.teams.get">["members"][number];
|
|
}
|
|
|
|
export default function TeamAvailabilityModal(props: Props) {
|
|
const utils = trpc.useContext();
|
|
const [selectedDate, setSelectedDate] = useState(dayjs());
|
|
const [selectedTimeZone, setSelectedTimeZone] = useState<ITimezone>(
|
|
localStorage.getItem("timeOption.preferredTimeZone") || dayjs.tz.guess()
|
|
);
|
|
const [frequency, setFrequency] = useState<15 | 30 | 60>(30);
|
|
|
|
useEffect(() => {
|
|
utils.invalidateQueries(["viewer.teams.getMemberAvailability"]);
|
|
}, [utils, selectedTimeZone, selectedDate]);
|
|
|
|
return (
|
|
<LicenseRequired>
|
|
<div className="flex max-h-[500px] min-h-[500px] flex-row space-x-8 rtl:space-x-reverse">
|
|
<div className="min-w-64 w-64 space-y-5 p-5 pr-0">
|
|
<div className="flex">
|
|
<Avatar
|
|
size="sm"
|
|
imageSrc={WEBAPP_URL + "/" + props.member?.username + "/avatar.png"}
|
|
alt={props.member?.name || ""}
|
|
className="h-14 w-14 rounded-full"
|
|
/>
|
|
<div className="ml-3 inline-block pt-1">
|
|
<span className="text-lg font-bold text-neutral-700">{props.member?.name}</span>
|
|
<span className="-mt-1 block text-sm text-gray-400">{props.member?.email}</span>
|
|
</div>
|
|
</div>
|
|
<div className="flex flex-col">
|
|
<span className="font-bold text-gray-600">Date</span>
|
|
<DatePicker
|
|
date={selectedDate.toDate()}
|
|
onDatesChange={(newDate) => {
|
|
setSelectedDate(dayjs(newDate));
|
|
}}
|
|
/>
|
|
</div>
|
|
<div>
|
|
<span className="font-bold text-gray-600">Timezone</span>
|
|
<TimezoneSelect
|
|
id="timeZone"
|
|
value={selectedTimeZone}
|
|
onChange={(timezone) => setSelectedTimeZone(timezone.value)}
|
|
classNamePrefix="react-select"
|
|
className="react-select-container mt-1 block w-full rounded-sm border border-gray-300 text-sm focus:border-neutral-800 focus:ring-neutral-800"
|
|
/>
|
|
</div>
|
|
<div>
|
|
<span className="font-bold text-gray-600">Slot Length</span>
|
|
<Select
|
|
options={[
|
|
{ value: 15, label: "15 minutes" },
|
|
{ value: 30, label: "30 minutes" },
|
|
{ value: 60, label: "60 minutes" },
|
|
]}
|
|
isSearchable={false}
|
|
classNamePrefix="react-select"
|
|
className="react-select-container focus:ring-primary-500 focus:border-primary-500 block w-full min-w-0 flex-1 rounded-sm border border-gray-300 text-sm"
|
|
value={{ value: frequency, label: `${frequency} minutes` }}
|
|
onChange={(newFrequency) => setFrequency(newFrequency?.value ?? 30)}
|
|
/>
|
|
</div>
|
|
</div>
|
|
{props.team && props.member && (
|
|
<TeamAvailabilityTimes
|
|
className="overflow-scroll"
|
|
teamId={props.team.id}
|
|
memberId={props.member.id}
|
|
frequency={frequency}
|
|
selectedDate={selectedDate}
|
|
selectedTimeZone={selectedTimeZone}
|
|
/>
|
|
)}
|
|
</div>
|
|
</LicenseRequired>
|
|
);
|
|
}
|