Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const getTabs = (
slug?: string;
name?: string;
logoUrl?: string | null;
fullDomain?: string | null;
} | null
) => {
const tabs: VerticalTabItemProps[] = [
Expand Down
8 changes: 0 additions & 8 deletions apps/web/app/SpeculationRules.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import Script from "next/script";

export function SpeculationRules({
prefetchPathsOnHover = [],
prerenderPathsOnHover = [],
}: {
prefetchPathsOnHover?: string[];
prerenderPathsOnHover?: string[];
}) {
const speculationRules = {
prefetch: [
{
urls: prefetchPathsOnHover,
eagerness: "moderate",
},
],
prerender: [
{
urls: prerenderPathsOnHover,
Expand Down
6 changes: 0 additions & 6 deletions apps/web/components/booking/AcceptBookingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ interface AcceptBookingButtonProps {
isRecurring?: boolean;
isTabRecurring?: boolean;
isTabUnconfirmed?: boolean;
size?: "sm" | "base" | "lg";
color?: "primary" | "secondary" | "minimal" | "destructive";
className?: string;
}

Expand All @@ -22,8 +20,6 @@ export function AcceptBookingButton({
isRecurring = false,
isTabRecurring = false,
isTabUnconfirmed = false,
size = "base",
color = "primary",
className,
}: AcceptBookingButtonProps) {
const { t } = useLocale();
Expand All @@ -38,8 +34,6 @@ export function AcceptBookingButton({

return (
<Button
color={color}
size={size}
className={className}
onClick={() => bookingConfirm({ bookingId, confirmed: true, recurringEventId })}
disabled={isPending}
Expand Down
6 changes: 0 additions & 6 deletions apps/web/components/booking/RejectBookingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ interface RejectBookingButtonProps {
isRecurring?: boolean;
isTabRecurring?: boolean;
isTabUnconfirmed?: boolean;
size?: "sm" | "base" | "lg";
color?: "primary" | "secondary" | "minimal" | "destructive";
className?: string;
}

Expand All @@ -23,8 +21,6 @@ export function RejectBookingButton({
isRecurring = false,
isTabRecurring = false,
isTabUnconfirmed = false,
size = "base",
color = "secondary",
className,
}: RejectBookingButtonProps) {
const { t } = useLocale();
Expand All @@ -48,8 +44,6 @@ export function RejectBookingButton({
/>

<Button
color={color}
size={size}
className={className}
onClick={handleReject}
disabled={isPending}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import {

interface BookingActionsDropdownProps {
booking: BookingItemProps;
size?: "xs" | "sm" | "base" | "lg";
className?: string;
/**
* Whether to use a portal for the dropdown menu.
Expand All @@ -62,7 +61,6 @@ interface BookingActionsDropdownProps {

export function BookingActionsDropdown({
booking,
size = "base",
className,
usePortal = true,
context,
Expand Down Expand Up @@ -545,7 +543,6 @@ export function BookingActionsDropdown({
<Button
type="button"
color="secondary"
size={size}
StartIcon="ellipsis"
className={classNames("px-2", className)}
// Prevent click from bubbling to parent row/container click handlers
Expand Down
3 changes: 0 additions & 3 deletions apps/web/components/dialog/CancelBookingDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ interface ICancelBookingDialog {
isHost: boolean;
internalNotePresets?: { id: number; name: string; cancellationReason: string | null }[];
eventTypeMetadata?: Record<string, unknown> | null;
requiresCancellationReason?: CancellationReasonRequirement | null;
}

export const CancelBookingDialog = (props: ICancelBookingDialog) => {
Expand All @@ -69,7 +68,6 @@ export const CancelBookingDialog = (props: ICancelBookingDialog) => {
isHost,
internalNotePresets = [],
eventTypeMetadata,
requiresCancellationReason,
} = props;

const utils = trpc.useUtils();
Expand Down Expand Up @@ -116,7 +114,6 @@ export const CancelBookingDialog = (props: ICancelBookingDialog) => {
isHost={isHost}
internalNotePresets={internalNotePresets}
eventTypeMetadata={eventTypeMetadata}
requiresCancellationReason={requiresCancellationReason}
showErrorAsToast={true}
onCanceled={handleCanceled}
/>
Expand Down
36 changes: 0 additions & 36 deletions apps/web/components/dialog/EditLocationDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,11 @@ interface ISetLocationDialog {
newLocation: string;
credentialId: number | null;
}) => Promise<void>;
selection?: LocationOption;
booking: {
location: string | null;
};
defaultValues?: LocationObject[];
setShowLocationModal: React.Dispatch<React.SetStateAction<boolean>>;
isOpenDialog: boolean;
setSelectedLocation?: (param: LocationOption | undefined) => void;
setEditingLocationType?: (param: string) => void;
teamId?: number;
}

Expand Down Expand Up @@ -82,28 +78,14 @@ const LocationInput = (props: {
export const EditLocationDialog = (props: ISetLocationDialog) => {
const {
saveLocation,
selection,
booking,
setShowLocationModal,
isOpenDialog,
defaultValues,
setSelectedLocation,
setEditingLocationType,
teamId,
} = props;
const { t } = useLocale();
const locationsQuery = trpc.viewer.apps.locationOptions.useQuery({ teamId });

useEffect(() => {
if (selection) {
locationFormMethods.setValue("locationType", selection?.value);
if (selection?.address) {
locationFormMethods.setValue("locationAddress", selection?.address);
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [selection]);

const locationFormSchema = z.object({
locationType: z.string(),
phone: z.string().optional().nullable(),
Expand Down Expand Up @@ -170,16 +152,6 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {

const eventLocationType = getLocationByType(selectedLocation);

const defaultLocation = defaultValues?.find(
(location: { type: EventLocationType["type"]; address?: string }) => {
if (location.type === LocationType.InPerson) {
return location.type === eventLocationType?.type && location.address === selectedAddrValue;
} else {
return location.type === eventLocationType?.type;
}
}
);

/**
* Depending on the location type that is selected, we show different input types or no input at all.
*/
Expand All @@ -202,9 +174,6 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
id="locationInput"
placeholder={t(eventLocationType.organizerInputPlaceholder || "")}
required
defaultValue={
defaultLocation ? defaultLocation[eventLocationType.defaultValueVariable] : undefined
}
/>
<ErrorMessage
errors={locationFormMethods.formState.errors}
Expand Down Expand Up @@ -244,7 +213,6 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
});
setIsLocationUpdating(false);
setShowLocationModal(false);
setSelectedLocation?.(undefined);
locationFormMethods.unregister([
"locationType",
"locationLink",
Expand Down Expand Up @@ -295,7 +263,6 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
<LocationSelect
maxMenuHeight={300}
name="location"
defaultValue={selection}
options={locationOptions}
isSearchable
onChange={(val) => {
Expand All @@ -312,7 +279,6 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
"locationPhoneNumber",
"locationAddress",
]);
setSelectedLocation?.(val);
}
}}
/>
Expand All @@ -329,8 +295,6 @@ export const EditLocationDialog = (props: ISetLocationDialog) => {
<Button
onClick={() => {
setShowLocationModal(false);
setSelectedLocation?.(undefined);
setEditingLocationType?.("");
locationFormMethods.unregister(["locationType", "locationLink"]);
}}
type="button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,6 @@ function pluralize(opts: { num: number; plural: string; singular: string }) {
return opts.singular;
}

export default function SubHeadingTitleWithConnections(props: { title: ReactNode; numConnections?: number }) {
const num = props.numConnections;
return (
<>
<span>{props.title}</span>
{num ? (
<Badge variant="success">
{num}{" "}
{pluralize({
num,
singular: "connection",
plural: "connections",
})}
</Badge>
) : null}
</>
);
export default function SubHeadingTitleWithConnections(props: { title: ReactNode }) {
return <span>{props.title}</span>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ interface ICustomUsernameProps {
setInputUsernameValue: (value: string) => void;
onSuccessMutation?: () => void;
onErrorMutation?: (error: TRPCClientErrorLike<AppRouter>) => void;
readonly?: boolean;
}

const obtainNewUsernameChangeCondition = ({
Expand Down Expand Up @@ -66,7 +65,6 @@ const PremiumTextfield = (props: ICustomUsernameProps) => {
usernameRef,
onSuccessMutation,
onErrorMutation,
readonly: disabled,
} = props;
const [user] = trpc.viewer.me.get.useSuspenseQuery();
const [usernameIsAvailable, setUsernameIsAvailable] = useState(false);
Expand Down Expand Up @@ -215,16 +213,14 @@ const PremiumTextfield = (props: ICustomUsernameProps) => {
autoComplete="none"
autoCapitalize="none"
autoCorrect="none"
disabled={disabled}
className={classNames(
"border-l my-0 rounded-md font-sans text-sm leading-4 focus:ring-0! sm:rounded-l-none",
isInputUsernamePremium
? "border border-orange-400 focus:border focus:border-orange-400"
: "border focus:border",
markAsError
? "focus:shadow-0 focus:ring-shadow-0 border-red-500 focus:border-red-500 focus:outline-none"
: "border-l-default",
disabled ? "bg-subtle text-muted focus:border-0" : ""
: "border-l-default"
)}
value={inputUsernameValue}
onChange={(event) => {
Expand Down
2 changes: 0 additions & 2 deletions apps/web/modules/apps/components/DisconnectIntegration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export default function DisconnectIntegration(props: {
credentialId: number;
teamId?: number | null;
label?: string;
trashIcon?: boolean;
isGlobal?: boolean;
onSuccess?: () => void;
buttonProps?: ButtonProps;
}) {
Expand Down
9 changes: 0 additions & 9 deletions apps/web/modules/bookings/components/JoinMeetingButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,14 @@ interface JoinMeetingButtonProps {
location: string | null;
metadata?: unknown;
bookingStatus: BookingStatus;
size?: "sm" | "base" | "lg";
color?: "primary" | "secondary" | "minimal" | "destructive";
className?: string;
onClick?: (e: React.MouseEvent) => void;
}

export function JoinMeetingButton({
location,
metadata,
bookingStatus,
size = "base",
color = "secondary",
className,
onClick,
}: JoinMeetingButtonProps) {
const { t } = useLocale();
const { isJoinable, locationToDisplay, provider } = useJoinableLocation({
Expand All @@ -39,13 +33,10 @@ export function JoinMeetingButton({

const handleClick = (e: React.MouseEvent) => {
e.stopPropagation();
onClick?.(e);
};

return (
<Button
color={color}
size={size}
href={locationToDisplay}
target="_blank"
rel="noopener noreferrer"
Expand Down
5 changes: 1 addition & 4 deletions apps/web/modules/bookings/hooks/useBookings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export interface IUseBookings {
bookingForm: UseBookingFormReturnType["bookingForm"];
metadata: Record<string, string>;
teamMemberEmail?: string | null;
isBookingDryRun?: boolean;
}

const getBaseBookingEventPayload = (booking: {
Expand Down Expand Up @@ -84,7 +83,6 @@ const getBookingSuccessfulEventPayload = (booking: {
paymentRequired: boolean;
uid?: string;
isRecurring: boolean;
videoCallUrl?: string;
}) => {
return {
uid: booking.uid,
Expand All @@ -108,7 +106,7 @@ export interface IUseBookingErrors {
}
export type UseBookingsReturnType = ReturnType<typeof useBookings>;

export const useBookings = ({ event, hashedLink, bookingForm, metadata, isBookingDryRun }: IUseBookings) => {
export const useBookings = ({ event, hashedLink, bookingForm, metadata }: IUseBookings) => {
const router = useRouter();
const eventSlug = useBookerStoreContext((state) => state.eventSlug);
const eventTypeId = useBookerStoreContext((state) => state.eventId);
Expand Down Expand Up @@ -416,7 +414,6 @@ export const useBookings = ({ event, hashedLink, bookingForm, metadata, isBookin
metadata,
handleRecBooking: createRecurringBookingMutation.mutate,
handleBooking: createBookingMutation.mutate,
isBookingDryRun,
});

const errors = {
Expand Down
3 changes: 0 additions & 3 deletions apps/web/modules/bookings/hooks/useNearestFutureBooking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface UseNearestFutureBookingProps {
statuses: BookingListingStatus[];
userIds?: number[];
};
enabled?: boolean;
}

/**
Expand All @@ -24,7 +23,6 @@ interface UseNearestFutureBookingProps {
export function useNearestFutureBooking({
currentWeekStart,
filters,
enabled = true,
}: UseNearestFutureBookingProps) {
// Search from the end of current week to NAVIGATION_PROBE_WINDOW_MONTHS months ahead
const afterDate = currentWeekStart.add(1, "week").startOf("day");
Expand All @@ -42,7 +40,6 @@ export function useNearestFutureBooking({
// Default sort for "upcoming" status is ASC, which gives us the nearest future booking
},
{
enabled,
staleTime: 5 * 60 * 1000, // 5 minutes
}
);
Expand Down
Loading
Loading