-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DOC] Point cloud section to new signup form (#3448)
To be merged when trychroma.com/signup goes live.
- Loading branch information
Showing
17 changed files
with
328 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
102 changes: 102 additions & 0 deletions
102
docs/docs.trychroma.com/components/header/cloud-signup.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
"use client"; | ||
|
||
import React, { useEffect, useState } from "react"; | ||
import { Cross2Icon } from "@radix-ui/react-icons"; | ||
import ChromaIcon from "../../public/chroma-icon.svg"; | ||
import Link from "next/link"; | ||
import Image from "next/image"; | ||
|
||
const SignUpLink: React.FC<{ children: React.ReactNode }> = ({ children }) => { | ||
return ( | ||
<Link | ||
href={"https://www.trychroma.com/signup"} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className="underline" | ||
> | ||
{children} | ||
</Link> | ||
); | ||
}; | ||
|
||
const ONE_WEEK_MS = 7 * 24 * 60 * 60 * 1000; | ||
|
||
const CloudSignUp: React.FC = () => { | ||
const [open, setOpen] = useState(false); | ||
const [imageLoaded, setImageLoaded] = useState(false); | ||
|
||
useEffect(() => { | ||
const lastClosed = localStorage.getItem("cloudSignupLastClosed"); | ||
const now = Date.now(); | ||
|
||
if (!lastClosed || now - parseInt(lastClosed, 10) > ONE_WEEK_MS) { | ||
setOpen(true); | ||
} | ||
}, []); | ||
|
||
const handleDialogClose = () => { | ||
setOpen(false); | ||
localStorage.setItem("cloudSignupLastClosed", Date.now().toString()); | ||
}; | ||
|
||
return ( | ||
open && ( | ||
<div | ||
className={`absolute bottom-4 z-20 right-4 bg-white border border-black h-48 w-[400px] flex flex-col gap-0 sm:rounded-none p-0 dark:border-white dark:border dark:bg-gray-950 ${imageLoaded ? "opacity-100" : "opacity-0"}`} | ||
> | ||
<div className="relative py-2 px-[3px] h-fit border-b-[1px] border-black dark:border-gray-300 dark:bg-gray-950"> | ||
<div className="flex flex-col gap-0.5"> | ||
{[...Array(7)].map((_, index) => ( | ||
<div | ||
key={index} | ||
className="w-full h-[1px] bg-black dark:bg-gray-300" | ||
/> | ||
))} | ||
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 px-2 py-1 bg-white dark:bg-gray-950 font-mono select-none"> | ||
NEW | ||
</div> | ||
<div | ||
className="absolute right-4 top-[6px] px-1 bg-white dark:bg-gray-950 cursor-pointer" | ||
onClick={handleDialogClose} | ||
> | ||
<div className="flex items-center justify-center bg-white dark:bg-gray-950 border-[1px] border-black disabled:pointer-events-none focus-visible:outline-none"> | ||
<Cross2Icon className="h-5 w-5" /> | ||
<span className="sr-only">Close</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex gap-5 h-full"> | ||
<div className="flex flex-col gap-3 pt-4 pl-5 "> | ||
<div className="flex items-center gap-2 select-none"> | ||
<ChromaIcon className="w-10 h-10" /> | ||
<p className="text-lg font-bold">Chroma Cloud</p> | ||
</div> | ||
|
||
<div className="flex flex-col gap-2 text-sm"> | ||
<p> | ||
Our fully managed hosted service,{" "} | ||
<span className="font-bold">Chroma Cloud</span> is here. | ||
</p> | ||
<p> | ||
<SignUpLink>Sign up</SignUpLink> for early access! | ||
</p> | ||
</div> | ||
</div> | ||
<div className="h-full flex items-start justify-end flex-shrink-0 "> | ||
<Image | ||
src="/cloud-art.svg" | ||
alt="Cloud Art" | ||
width={128} | ||
height={155} | ||
priority | ||
onLoad={() => setImageLoaded(true)} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
); | ||
}; | ||
|
||
export default CloudSignUp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
import * as DialogPrimitive from "@radix-ui/react-dialog"; | ||
import { cn } from "@/lib/utils"; | ||
import { Cross2Icon } from "@radix-ui/react-icons"; | ||
|
||
const Dialog = DialogPrimitive.Root; | ||
|
||
const DialogTrigger = DialogPrimitive.Trigger; | ||
|
||
const DialogPortal = DialogPrimitive.Portal; | ||
|
||
const DialogClose = DialogPrimitive.Close; | ||
|
||
const DialogOverlay = React.forwardRef< | ||
React.ElementRef<typeof DialogPrimitive.Overlay>, | ||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay> | ||
>(({ className, ...props }, ref) => ( | ||
<DialogPrimitive.Overlay | ||
ref={ref} | ||
className={cn( | ||
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
)); | ||
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; | ||
|
||
const DialogContent = React.forwardRef< | ||
React.ElementRef<typeof DialogPrimitive.Content>, | ||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> | ||
>(({ className, children, ...props }, ref) => ( | ||
<DialogPortal> | ||
<DialogOverlay /> | ||
<DialogPrimitive.Content | ||
ref={ref} | ||
className={cn( | ||
"fixed right-4 bottom-4 z-50 w-full max-w-lg gap-4 border border-zinc-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-zinc-800 dark:bg-zinc-950", | ||
className, | ||
)} | ||
{...props} | ||
> | ||
{children} | ||
</DialogPrimitive.Content> | ||
</DialogPortal> | ||
)); | ||
DialogContent.displayName = DialogPrimitive.Content.displayName; | ||
|
||
const DialogHeader = ({ | ||
className, | ||
...props | ||
}: React.HTMLAttributes<HTMLDivElement>) => ( | ||
<div | ||
className={cn( | ||
"flex flex-col space-y-1.5 text-center sm:text-left", | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
); | ||
DialogHeader.displayName = "DialogHeader"; | ||
|
||
const DialogFooter = ({ | ||
className, | ||
...props | ||
}: React.HTMLAttributes<HTMLDivElement>) => ( | ||
<div | ||
className={cn( | ||
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
); | ||
DialogFooter.displayName = "DialogFooter"; | ||
|
||
const DialogTitle = React.forwardRef< | ||
React.ElementRef<typeof DialogPrimitive.Title>, | ||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title> | ||
>(({ className, ...props }, ref) => ( | ||
<DialogPrimitive.Title | ||
ref={ref} | ||
className={cn( | ||
"text-lg font-semibold leading-none tracking-tight", | ||
className, | ||
)} | ||
{...props} | ||
/> | ||
)); | ||
DialogTitle.displayName = DialogPrimitive.Title.displayName; | ||
|
||
const DialogDescription = React.forwardRef< | ||
React.ElementRef<typeof DialogPrimitive.Description>, | ||
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description> | ||
>(({ className, ...props }, ref) => ( | ||
<DialogPrimitive.Description | ||
ref={ref} | ||
className={cn("text-sm text-zinc-500 dark:text-zinc-400", className)} | ||
{...props} | ||
/> | ||
)); | ||
DialogDescription.displayName = DialogPrimitive.Description.displayName; | ||
|
||
export { | ||
Dialog, | ||
DialogPortal, | ||
DialogOverlay, | ||
DialogTrigger, | ||
DialogClose, | ||
DialogContent, | ||
DialogHeader, | ||
DialogFooter, | ||
DialogTitle, | ||
DialogDescription, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.