* Remove shadow

* Empty screen

* V2 Create event type

* Fix switch not being right alligned

* Fix modal anatomy

* Fix layouts across app

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2022-09-05 16:23:18 +02:00
1 parent 7b0d4f0f78
commit 8602a0a6e1
7 files changed
+55 -53

No files matched your search

@@ -3,9 +3,9 @@ import { Dispatch, SetStateAction } from "react";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { HttpError } from "@calcom/lib/http-error";
import { trpc } from "@calcom/trpc/react";
import ConfirmationDialogContent from "@calcom/ui/ConfirmationDialogContent";
import { Dialog } from "@calcom/ui/v2";
import { showToast } from "@calcom/ui/v2";
import ConfirmationDialogContent from "@calcom/ui/v2/core/ConfirmationDialogContent";
interface IDeleteDialog {
isOpenDialog: boolean;
+20 -18
View File
@@ -96,8 +96,8 @@ export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps
{props.type === "creation" && (
<div>
{props.title && <DialogHeader title={props.title} />}
{props.description && <p className="pb-8 text-sm text-gray-500">{props.description}</p>}
<div className="flex flex-col gap-6">{children}</div>
{props.description && <p className="pb-5 text-sm text-gray-500">{props.description}</p>}
<div className="flex flex-col space-y-6">{children}</div>
</div>
)}
{props.type === "confirmation" && (
@@ -115,21 +115,23 @@ export const DialogContent = React.forwardRef<HTMLDivElement, DialogContentProps
)}
{!props.useOwnActionButtons && (
<DialogFooter>
<DialogClose asChild>
{/* This will require the i18n string passed in */}
<Button color="minimal" onClick={props.actionOnClose}>
{props.closeText ?? "Close"}
</Button>
</DialogClose>
{props.actionOnClick ? (
<Button color="primary" disabled={props.actionDisabled} onClick={props.actionOnClick}>
{props.actionText}
</Button>
) : (
<Button color="primary" type="submit" disabled={props.actionDisabled}>
{props.actionText}
</Button>
)}
<div className="mt-2">
<DialogClose asChild>
{/* This will require the i18n string passed in */}
<Button color="minimal" onClick={props.actionOnClose}>
{props.closeText ?? "Close"}
</Button>
</DialogClose>
{props.actionOnClick ? (
<Button color="primary" disabled={props.actionDisabled} onClick={props.actionOnClick}>
{props.actionText}
</Button>
) : (
<Button color="primary" type="submit" disabled={props.actionDisabled}>
{props.actionText}
</Button>
)}
</div>
</DialogFooter>
)}
</DialogPrimitive.Content>
@@ -145,7 +147,7 @@ type DialogHeaderProps = {
export function DialogHeader(props: DialogHeaderProps) {
return (
<>
<h3 className="leading-20 text-semibold text-xl text-black" id="modal-title">
<h3 className="leading-20 text-semibold font-cal pb-1 text-xl text-gray-900" id="modal-title">
{props.title}
</h3>
{props.subtitle && <div className="text-sm text-gray-400">{props.subtitle}</div>}
+2 -2
View File
@@ -25,7 +25,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(function Input(pro
{...props}
ref={ref}
className={classNames(
"mb-[7px] block h-9 w-full rounded-md border border-gray-300 py-2 px-3 shadow-sm hover:border-gray-400 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-neutral-800 focus:ring-offset-1 sm:text-sm",
"mb-[7px] block h-9 w-full rounded-md border border-gray-300 py-2 px-3 hover:border-gray-400 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-neutral-800 focus:ring-offset-1 sm:text-sm",
props.className
)}
/>
@@ -283,7 +283,7 @@ export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function
ref={ref}
{...props}
className={classNames(
"my-2 block w-full rounded-md border border-gray-300 py-2 px-3 shadow-sm hover:border-gray-400 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-neutral-800 focus:ring-offset-1 sm:text-sm",
"block w-full rounded-md border border-gray-300 py-2 px-3 hover:border-gray-400 focus:border-neutral-300 focus:outline-none focus:ring-2 focus:ring-neutral-800 focus:ring-offset-1 sm:text-sm",
props.className
)}
/>
@@ -15,8 +15,17 @@ import { createEventTypeInput } from "@calcom/prisma/zod/custom/eventtype";
import { trpc } from "@calcom/trpc/react";
import { Alert } from "@calcom/ui/Alert";
import { Icon } from "@calcom/ui/Icon";
import { Form, InputLeading, TextAreaField, TextField } from "@calcom/ui/form/fields";
import { Dialog, DialogClose, DialogContent, Button, Avatar, showToast } from "@calcom/ui/v2";
import {
Dialog,
DialogClose,
DialogContent,
Button,
Avatar,
showToast,
Form,
TextAreaField,
TextField,
} from "@calcom/ui/v2";
import Dropdown, {
DropdownMenuContent,
DropdownMenuItem,
@@ -173,21 +182,18 @@ export default function CreateEventTypeButton(props: CreateEventTypeBtnProps) {
</Dropdown>
)}
<DialogContent type="creation" className="overflow-y-auto" useOwnActionButtons>
<div className="mb-4">
<h3 className="text-lg font-bold leading-6 text-gray-900" id="modal-title">
{teamId ? t("add_new_team_event_type") : t("add_new_event_type")}
</h3>
<div>
<p className="text-sm text-gray-500">{t("new_event_type_to_book_description")}</p>
</div>
</div>
<DialogContent
type="creation"
className="overflow-y-auto"
useOwnActionButtons
title={teamId ? t("add_new_team_event_type") : t("add_new_event_type")}
description={t("new_event_type_to_book_description")}>
<Form
form={form}
handleSubmit={(values) => {
createMutation.mutate(values);
}}>
<div className="mt-3 space-y-4">
<div className="mt-3 space-y-6">
{teamId && (
<TextField
type="hidden"
@@ -203,7 +209,7 @@ export default function CreateEventTypeButton(props: CreateEventTypeBtnProps) {
<TextField
label={`${t("url")}: ${process.env.NEXT_PUBLIC_WEBSITE_URL}`}
required
addOnLeading={<InputLeading>/{pageSlug}/</InputLeading>}
addOnLeading={<>/{pageSlug}/</>}
{...register("slug")}
/>
) : (
@@ -211,9 +217,9 @@ export default function CreateEventTypeButton(props: CreateEventTypeBtnProps) {
label={t("url")}
required
addOnLeading={
<InputLeading>
<>
{process.env.NEXT_PUBLIC_WEBSITE_URL}/{pageSlug}/
</InputLeading>
</>
}
{...register("slug")}
/>
@@ -234,10 +240,8 @@ export default function CreateEventTypeButton(props: CreateEventTypeBtnProps) {
label={t("length")}
className="pr-20"
{...register("length", { valueAsNumber: true })}
addOnSuffix={t("minutes")}
/>
<div className="absolute inset-y-0 right-0 mt-1.5 flex items-center pt-4 pr-3 text-sm text-gray-400">
{t("minutes")}
</div>
</div>
{teamId && (