From 51d553559f634d98d7cba2f2ac98c221ba74584c Mon Sep 17 00:00:00 2001 From: Peer Richelsen Date: Wed, 9 Feb 2022 00:05:13 +0000 Subject: [PATCH] tailwind prettier (#1646) * tailwind prettier * Minor fixes * Sorts components and pages Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: zomars --- .prettierrc.js | 1 + .vscode/extensions.json | 1 - @types/@wojtekmaj:react-daterange-picker.d.ts | 15 ++ components/AddToHomescreen.tsx | 16 +- components/DestinationCalendarSelector.tsx | 6 +- components/Dialog.tsx | 8 +- components/EmptyScreen.tsx | 8 +- components/ImageUploader.tsx | 20 +- components/List.tsx | 2 +- components/Logo.tsx | 2 +- components/NavTabs.tsx | 8 +- components/Shell.tsx | 90 ++++----- components/Slider.tsx | 2 +- components/Swatch.tsx | 8 +- components/Tooltip.tsx | 2 +- components/auth/SAMLLogin.tsx | 2 +- components/auth/TwoFactor.tsx | 2 +- components/booking/AvailableTimes.tsx | 14 +- components/booking/BookingListItem.tsx | 12 +- components/booking/DatePicker.tsx | 20 +- components/booking/TimeOptions.tsx | 12 +- components/booking/pages/AvailabilityPage.tsx | 32 +-- components/booking/pages/BookingPage.tsx | 54 ++--- .../dialog/ConfirmationDialogContent.tsx | 18 +- components/error/error-page.tsx | 14 +- components/eventtype/CreateEventType.tsx | 12 +- components/eventtype/EventTypeDescription.tsx | 12 +- components/form/fields.tsx | 10 +- .../integrations/CalendarListContainer.tsx | 2 +- .../integrations/IntegrationListItem.tsx | 4 +- .../pages/eventtypes/CustomInputTypeForm.tsx | 19 +- components/security/ChangePasswordSection.tsx | 8 +- components/security/DisableTwoFactorModal.tsx | 2 +- components/security/EnableTwoFactorModal.tsx | 6 +- components/security/TwoFactorAuthSection.tsx | 4 +- components/security/TwoFactorModalHeader.tsx | 6 +- components/team/MemberChangeRoleModal.tsx | 4 +- components/team/MemberInvitationModal.tsx | 26 +-- components/team/MemberList.tsx | 2 +- components/team/MemberListItem.tsx | 24 +-- components/team/TeamCreateModal.tsx | 16 +- components/team/TeamList.tsx | 2 +- components/team/TeamListItem.tsx | 16 +- components/team/TeamPill.tsx | 12 +- components/team/TeamSettings.tsx | 16 +- components/team/TeamSettingsRightSidebar.tsx | 4 +- components/team/UpgradeToFlexibleProModal.tsx | 2 +- components/team/screens/Team.tsx | 8 +- components/ui/Alert.tsx | 8 +- components/ui/AuthContainer.tsx | 12 +- components/ui/Avatar.tsx | 2 +- components/ui/AvatarGroup.tsx | 2 +- components/ui/Badge.tsx | 2 +- components/ui/Button.tsx | 10 +- components/ui/Dropdown.tsx | 4 +- components/ui/InfoBadge.tsx | 2 +- components/ui/LinkIconButton.tsx | 4 +- components/ui/ModalContainer.tsx | 12 +- components/ui/PoweredByCal.tsx | 8 +- components/ui/Scheduler.tsx | 10 +- components/ui/SettingInputContainer.tsx | 6 +- components/ui/Switch.tsx | 8 +- components/ui/TableActions.tsx | 10 +- components/ui/WeekdaySelect.tsx | 6 +- components/ui/colorpicker.tsx | 6 +- components/ui/form/CheckboxField.tsx | 8 +- components/ui/form/CheckedSelect.tsx | 53 +++-- components/ui/form/DatePicker.tsx | 4 +- components/ui/form/DateRangePicker.tsx | 4 +- components/ui/form/MinutesField.tsx | 6 +- components/ui/form/PhoneInput.tsx | 2 +- components/ui/form/Schedule.tsx | 6 +- .../ui/form/radio-area/RadioAreaGroup.tsx | 2 +- components/ui/form/radio-area/Select.tsx | 23 ++- components/ui/modal/SetTimesModal.tsx | 86 ++++---- .../ui/svg/UserCalendarIllustration.tsx | 2 +- ee/components/LicenseBanner.tsx | 32 +-- ee/components/TrialBanner.tsx | 4 +- ee/components/saml/Configuration.tsx | 4 +- ee/components/stripe/Payment.tsx | 2 +- ee/components/stripe/PaymentPage.tsx | 18 +- .../availability/TeamAvailabilityModal.tsx | 14 +- .../availability/TeamAvailabilityScreen.tsx | 22 +- .../availability/TeamAvailabilityTimes.tsx | 4 +- ee/components/web3/CryptoSection.tsx | 8 +- ee/lib/intercom/HelpMenuItem.tsx | 2 +- lib/core/http/error/http-error.ts | 4 +- .../components/AddCalDavIntegration.tsx | 8 +- package.json | 1 + pages/404.tsx | 112 +++++------ pages/[user].tsx | 18 +- pages/auth/error.tsx | 6 +- pages/auth/forgot-password/[id].tsx | 22 +- pages/auth/forgot-password/index.tsx | 2 +- pages/auth/login.tsx | 4 +- pages/auth/logout.tsx | 6 +- pages/auth/signup.tsx | 22 +- pages/availability/index.tsx | 8 +- pages/availability/troubleshoot.tsx | 14 +- pages/bookings/[status].tsx | 8 +- pages/call/[uid].tsx | 2 +- pages/call/meeting-ended/[uid].tsx | 18 +- pages/call/meeting-not-started/[uid].tsx | 18 +- pages/call/no-meeting-found.tsx | 14 +- pages/cancel/[uid].tsx | 24 +-- pages/cancel/success.tsx | 12 +- pages/event-types/[type].tsx | 190 +++++++++--------- pages/event-types/index.tsx | 56 +++--- pages/getting-started.tsx | 40 ++-- pages/integrations/index.tsx | 68 +++---- pages/sandbox/Alert.tsx | 4 +- pages/sandbox/Badge.tsx | 4 +- pages/sandbox/Button.tsx | 4 +- pages/sandbox/RadioArea.tsx | 16 +- pages/sandbox/form.tsx | 6 +- pages/sandbox/index.tsx | 4 +- pages/settings/billing.tsx | 12 +- pages/settings/profile.tsx | 52 ++--- pages/settings/security.tsx | 2 +- pages/settings/teams.tsx | 4 +- pages/settings/teams/[id].tsx | 8 +- pages/success.tsx | 44 ++-- pages/team/[slug].tsx | 14 +- styles/globals.css | 62 +++--- yarn.lock | 5 + 125 files changed, 977 insertions(+), 945 deletions(-) create mode 100644 @types/@wojtekmaj:react-daterange-picker.d.ts diff --git a/.prettierrc.js b/.prettierrc.js index bd891544e4..a24db20059 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -9,4 +9,5 @@ module.exports = { arrowParens: "always", importOrder: ["^@ee/(.*)$", "^@lib/(.*)$", "^@components/(.*)$", "^@(server|trpc)/(.*)$", "^[./]"], importOrderSeparation: true, + plugins: [require("prettier-plugin-tailwindcss")], }; diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d95fa075db..e0b5078f4f 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,6 @@ "esbenp.prettier-vscode", // prettier plugin "dbaeumer.vscode-eslint", // eslint plugin "bradlc.vscode-tailwindcss", // hinting / autocompletion for tailwind - "heybourn.headwind", // automatically sort tailwind classes in predictable order, kinda like "prettier for tailwind", "ban.spellright", // Spell check for docs "stripe.vscode-stripe" // stripe VSCode extension ] diff --git a/@types/@wojtekmaj:react-daterange-picker.d.ts b/@types/@wojtekmaj:react-daterange-picker.d.ts new file mode 100644 index 0000000000..8383940892 --- /dev/null +++ b/@types/@wojtekmaj:react-daterange-picker.d.ts @@ -0,0 +1,15 @@ +declare module "@wojtekmaj/react-daterange-picker/dist/entry.nostyle" { + import { CalendarProps } from "react-calendar"; + export type DateRangePickerCalendarProps = Omit< + CalendarProps, + "calendarClassName" | "onChange" | "value" + > & { + calendarClassName?: string; + onChange: (value: [Date, Date]) => void; + value: [Date, Date]; + clearIcon: JSX.Element | null; + calendarIcon: JSX.Element | null; + rangeDivider: JSX.Element | null; + }; + export default function DateRangePicker(props: DateRangePickerCalendarProps): JSX.Element; +} diff --git a/components/AddToHomescreen.tsx b/components/AddToHomescreen.tsx index defdb65e07..edfeef4175 100644 --- a/components/AddToHomescreen.tsx +++ b/components/AddToHomescreen.tsx @@ -14,13 +14,13 @@ export default function AddToHomescreen() { } return !closeBanner ? (
-
-
+
+
-
- +
+ @@ -34,13 +34,13 @@ export default function AddToHomescreen() {

-
+
diff --git a/components/DestinationCalendarSelector.tsx b/components/DestinationCalendarSelector.tsx index ef9dd1f740..93c6321318 100644 --- a/components/DestinationCalendarSelector.tsx +++ b/components/DestinationCalendarSelector.tsx @@ -56,8 +56,8 @@ const DestinationCalendarSelector = ({
{/* There's no easy way to customize the displayed value for a Select, so we fake it. */} {!hidePlaceholder && ( -
-
@@ -67,7 +67,7 @@ const DestinationCalendarSelector = ({ placeholder={!hidePlaceholder ? `${t("select_destination_calendar")}:` : undefined} options={options} isSearchable={false} - className="flex-1 block w-full min-w-0 mt-1 mb-2 border-gray-300 rounded-none focus:ring-primary-500 focus:border-primary-500 rounded-r-md sm:text-sm" + className="mt-1 mb-2 block w-full min-w-0 flex-1 rounded-none rounded-r-md border-gray-300 focus:border-primary-500 focus:ring-primary-500 sm:text-sm" onChange={(option) => { setSelectedOption(option); if (!option) { diff --git a/components/Dialog.tsx b/components/Dialog.tsx index 38639bb9c0..5d77c465e2 100644 --- a/components/Dialog.tsx +++ b/components/Dialog.tsx @@ -6,7 +6,7 @@ export function Dialog(props: DialogProps) { const { children, ...other } = props; return ( - + {children} ); @@ -17,7 +17,7 @@ export const DialogContent = React.forwardRef ( {children} @@ -32,7 +32,7 @@ type DialogHeaderProps = { export function DialogHeader(props: DialogHeaderProps) { return (
- {props.subtitle &&
{props.subtitle}
} @@ -43,7 +43,7 @@ export function DialogHeader(props: DialogHeaderProps) { export function DialogFooter(props: { children: ReactNode }) { return (
-
{props.children}
+
{props.children}
); } diff --git a/components/EmptyScreen.tsx b/components/EmptyScreen.tsx index feadb03632..a1ea0e3eb7 100644 --- a/components/EmptyScreen.tsx +++ b/components/EmptyScreen.tsx @@ -13,12 +13,12 @@ export default function EmptyScreen({ }) { return ( <> -
-
- +
+
+
-

{headline}

+

{headline}

{description}

diff --git a/components/ImageUploader.tsx b/components/ImageUploader.tsx index 111d0f2a68..e77c147649 100644 --- a/components/ImageUploader.tsx +++ b/components/ImageUploader.tsx @@ -38,8 +38,8 @@ function CropContainer({ }; return ( -
-
+
+
-
-
+
{!result && ( -
+
{!imageSrc && ( -

+

{t("no_target", { target })}

)} - {imageSrc && {target}} + {imageSrc && {target}}
)} {result && } -
-
+
diff --git a/components/List.tsx b/components/List.tsx index 0d7ae7a0ab..f9eb647ac4 100644 --- a/components/List.tsx +++ b/components/List.tsx @@ -5,7 +5,7 @@ import classNames from "@lib/classNames"; export function List(props: JSX.IntrinsicElements["ul"]) { return ( -