TypeScript
Add root card labels and theme-aware liquid smoke color
Andrew Luoa53ee73bd468
diff --git a/apps/v4/components/root-components-collage.tsx b/apps/v4/components/root-components-collage.tsxindex 6af16dc..3fe58e2 100644--- a/apps/v4/components/root-components-collage.tsx+++ b/apps/v4/components/root-components-collage.tsx@@ -4,6 +4,7 @@ import type * as React from "react"import dynamic from "next/dynamic"import Image from "next/image"+import { cn } from "@/lib/utils"import { Spinner } from "@/components/ui/spinner"import { CsvViewerPreviewClient } from "@/components/csv-viewer-docs"import {@@ -99,7 +100,7 @@ export function RootComponentsCollage() {function PdfViewerTile() {return (- <ComponentCrop className="h-[560px] border bg-background">+ <ComponentCrop label="PDF Viewer" className="h-[560px] bg-background"><PdfViewerPreview file="/samples/knicks.pdf" showRotateControls={false} /></ComponentCrop>)@@ -107,19 +108,23 @@ function PdfViewerTile() {function CsvViewerTile() {return (- <ComponentCrop className="h-[400px] border bg-background">+ <ComponentCrop label="CSV Viewer" className="h-[400px] bg-background"><CsvViewerPreviewClient /></ComponentCrop>)}function FileUploadTile() {- return <FileUpload showFileList={false} />+ return (+ <ComponentCrop label="File Upload" className="bg-background p-3">+ <FileUpload showFileList={false} />+ </ComponentCrop>+ )}function FileThumbnailTile() {return (- <ComponentCrop className="border bg-background">+ <ComponentCrop label="File Thumbnail" className="bg-background"><RootFileThumbnailGrid /></ComponentCrop>)@@ -127,7 +132,7 @@ function FileThumbnailTile() {function DocxViewerTile() {return (- <ComponentCrop className="h-[560px] border bg-background">+ <ComponentCrop label="DOCX Viewer" className="h-[560px] bg-background"><DocxViewerPreview className="h-full" src="/samples/demo.docx" /></ComponentCrop>)@@ -135,7 +140,7 @@ function DocxViewerTile() {function XlsxViewerTile() {return (- <ComponentCrop className="h-[560px] border bg-background">+ <ComponentCrop label="XLSX Viewer" className="h-[560px] bg-background"><XlsxViewerPreviewclassName="h-full"src="/samples/crazy-chart-zoo.xlsx"@@ -146,7 +151,7 @@ function XlsxViewerTile() {function OcrBlocksTile() {return (- <ComponentCrop className="h-[430px]">+ <ComponentCrop label="OCR Blocks" className="h-[430px]"><OcrBlocks /></ComponentCrop>)@@ -178,14 +183,19 @@ function ViewerPreviewLoading() {function ComponentCrop({className,+ label,children,}: {className?: string+ label: stringchildren: React.ReactNode}) {return (- <div className={["overflow-hidden rounded-lg", className].join(" ")}>- {children}+ <div className="overflow-hidden rounded-lg border bg-background">+ <div className="flex h-8 items-center rounded-t-[inherit] border-b bg-muted/45 px-3 text-xs font-medium text-muted-foreground">+ {label}+ </div>+ <div className={cn("overflow-hidden", className)}>{children}</div></div>)}diff --git a/apps/v4/components/root-liquid-logo.tsx b/apps/v4/components/root-liquid-logo.tsxindex c0ac6b5..55a70b4 100644--- a/apps/v4/components/root-liquid-logo.tsx+++ b/apps/v4/components/root-liquid-logo.tsx@@ -1,8 +1,20 @@"use client"+import * as React from "react"import { GemSmoke } from "@paper-design/shaders-react"+import { useTheme } from "next-themes"export function RootLiquidLogo() {+ const { resolvedTheme } = useTheme()+ const [isMounted, setIsMounted] = React.useState(false)++ React.useEffect(() => {+ setIsMounted(true)+ }, [])++ const colorInner =+ isMounted && resolvedTheme === "dark" ? "#000000" : "#ffffff"+return (<divaria-hidden="true"@@ -14,7 +26,7 @@ export function RootLiquidLogo() {image="/extend-logo.svg"colors={["#004CFF", "#FF8C00", "#FFB066", "#0084FF"]}colorBack="#00000000"- colorInner="#000000"+ colorInner={colorInner}shape={undefined}innerDistortion={0.48}outerDistortion={0}