move calendso branding into pro (#629)

* badge

* mv branding to paid plan

* upgrade ts

* hideBranding check

* user.plan

* lint fixes

* `isBrandingHidden` helper

* hide pro for non-pros
This commit is contained in:
Alex Johansson authored and GitHub committed 2021-09-13 10:48:55 +01:00
1 parent 8ee68e2ace
commit ab78bb3802
8 files changed
+185 -55

No files matched your search

+23 -5
View File
@@ -1,8 +1,16 @@
import { Fragment } from "react";
import { Fragment, ReactNode } from "react";
import { Dialog, Transition } from "@headlessui/react";
import { CheckIcon } from "@heroicons/react/outline";
import { CheckIcon, InformationCircleIcon } from "@heroicons/react/outline";
import classNames from "@lib/classNames";
export default function Modal(props) {
export default function Modal(props: {
heading: ReactNode;
description: ReactNode;
handleClose: () => void;
open: boolean;
variant?: "success" | "warning";
}) {
const { variant = "success" } = props;
return (
<Transition.Root show={props.open} as={Fragment}>
<Dialog
@@ -37,8 +45,18 @@ export default function Modal(props) {
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95">
<div className="inline-block align-bottom bg-white rounded-lg px-4 pt-5 pb-4 text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-sm sm:w-full sm:p-6">
<div>
<div className="mx-auto flex items-center justify-center h-12 w-12 rounded-full bg-green-100">
<CheckIcon className="h-6 w-6 text-green-600" aria-hidden="true" />
<div
className={classNames(
"mx-auto flex items-center justify-center h-12 w-12 rounded-full",
variant === "success" && "bg-green-100",
variant === "warning" && "bg-yellow-100"
)}>
{variant === "success" && (
<CheckIcon className="h-6 w-6 text-green-600" aria-hidden="true" />
)}
{variant === "warning" && (
<InformationCircleIcon className={"h-6 w-6 text-yellow-400"} aria-hidden="true" />
)}
</div>
<div className="mt-3 text-center sm:mt-5">
<Dialog.Title as="h3" className="text-lg leading-6 font-medium text-gray-900">
+25
View File
@@ -0,0 +1,25 @@
import classNames from "@lib/classNames";
import React from "react";
export type BadgeProps = {
variant: "default" | "success";
} & JSX.IntrinsicElements["span"];
export const Badge = function Badge(props: BadgeProps) {
const { variant, className, ...passThroughProps } = props;
return (
<span
{...passThroughProps}
className={classNames(
"font-bold px-2 py-0.5 inline-block",
variant === "default" && "bg-yellow-100 text-yellow-800",
variant === "success" && "bg-green-100 text-green-800",
className
)}>
{props.children}
</span>
);
};
export default Badge;