diff --git a/.changeset/big-apples-reflect.md b/.changeset/big-apples-reflect.md deleted file mode 100644 index 1fc71d688..000000000 --- a/.changeset/big-apples-reflect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@trigger.dev/sdk": patch ---- - -Make the schema an optional param for customEvent and webhookEvent diff --git a/apps/webapp/app/components/CopyText.tsx b/apps/webapp/app/components/CopyText.tsx index 5f3ac68aa..9987f6cde 100644 --- a/apps/webapp/app/components/CopyText.tsx +++ b/apps/webapp/app/components/CopyText.tsx @@ -13,12 +13,17 @@ export function CopyText({ className, onCopied, }: CopyTextProps) { - const onClick = useCallback(() => { - navigator.clipboard.writeText(value); - if (onCopied) { - onCopied(); - } - }, [value, onCopied]); + const onClick = useCallback( + (event: React.MouseEvent) => { + event.preventDefault(); + event.stopPropagation(); + navigator.clipboard.writeText(value); + if (onCopied) { + onCopied(); + } + }, + [value, onCopied] + ); return (
diff --git a/apps/webapp/app/components/CopyTextButton.tsx b/apps/webapp/app/components/CopyTextButton.tsx index fce6808f4..1190d9c57 100644 --- a/apps/webapp/app/components/CopyTextButton.tsx +++ b/apps/webapp/app/components/CopyTextButton.tsx @@ -1,6 +1,7 @@ -import { ClipboardIcon } from "@heroicons/react/24/outline"; +import { CheckIcon, ClipboardIcon } from "@heroicons/react/24/outline"; import classNames from "classnames"; import { useCallback, useState } from "react"; +import { EnvironmentIcon } from "~/routes/resources/environment"; import { CopyText } from "./CopyText"; const variantStyle = { @@ -16,6 +17,7 @@ const variantStyle = { export type CopyTextButtonProps = { value: string; + text?: string; className?: string; variant?: "slate" | "blue" | "darkTransparent" | "lightTransparent" | "text"; }; @@ -23,6 +25,7 @@ export type CopyTextButtonProps = { export function CopyTextButton({ value, className, + text, variant = "blue", }: CopyTextButtonProps) { const [copied, setCopied] = useState(false); @@ -57,3 +60,48 @@ export function CopyTextButton({ ); } + +const panelVariantStyle = { + primary: + "truncate text-indigo-300 bg-indigo-700/50 pl-3.5 pr-2 py-3 rounded border border-indigo-600 flex items-center justify-between gap-2 hover:cursor-pointer hover:bg-indigo-600/50 hover:border-indigo-600 transition", + slate: + "flex w-full items-center justify-between gap-2 truncate rounded bg-slate-850 py-2 pl-2.5 pr-1 transition hover:cursor-pointer hover:bg-slate-800 hover:text-slate-300", + text: "flex w-full items-center justify-between gap-2 truncate rounded bg-transparent py-2 pl-2.5 pr-1 transition hover:cursor-pointer hover:border-slate-700/50 hover:bg-slate-700/50", +}; + +export type CopyTextPanelProps = { + value: string; + text?: string; + className?: string; + variant?: "primary" | "slate" | "text"; +}; + +export function CopyTextPanel({ + value, + text, + className, + variant = "primary", +}: CopyTextPanelProps) { + const [copied, setCopied] = useState(false); + const onCopied = useCallback(() => { + setCopied(true); + setTimeout(() => { + setCopied(false); + }, 1500); + }, [setCopied]); + return ( + + {copied ? ( +
+ {text ?? value} + +
+ ) : ( +
+ {text ?? value} + +
+ )} +
+ ); +} diff --git a/apps/webapp/app/components/layout/Container.tsx b/apps/webapp/app/components/layout/Container.tsx index ae00813a1..f79743181 100644 --- a/apps/webapp/app/components/layout/Container.tsx +++ b/apps/webapp/app/components/layout/Container.tsx @@ -1,6 +1,6 @@ import classNames from "classnames"; -const baseClasses = "px-12 py-10"; +const baseClasses = "px-4 py-4 md:px-8 md:py-6 lg:px-12 lg:py-10"; export function Container({ children, diff --git a/apps/webapp/app/components/navigation/OrganizationMenu.tsx b/apps/webapp/app/components/navigation/OrganizationMenu.tsx index df589ae7e..66b84ff5b 100644 --- a/apps/webapp/app/components/navigation/OrganizationMenu.tsx +++ b/apps/webapp/app/components/navigation/OrganizationMenu.tsx @@ -1,5 +1,10 @@ import { Popover, Transition } from "@headlessui/react"; -import { BookmarkIcon, ChevronUpDownIcon } from "@heroicons/react/24/outline"; +import { + BookmarkIcon, + BuildingOffice2Icon, + ChevronUpDownIcon, + UserIcon, +} from "@heroicons/react/24/outline"; import { CheckIcon, PlusIcon } from "@heroicons/react/24/solid"; import { Link } from "@remix-run/react"; import classNames from "classnames"; @@ -33,10 +38,10 @@ export function OrganizationMenu() { -