From fa491ed6fae754369b3f7314dc4b9281171cbe6b Mon Sep 17 00:00:00 2001 From: Ben Reinhart Date: Mon, 21 Oct 2024 18:08:23 -0700 Subject: [PATCH] Update package install toast styles to match figma (#403) --- .../components/src/components/ui/button.tsx | 2 +- .../components/apps/package-install-toast.tsx | 103 +++++++++--------- 2 files changed, 50 insertions(+), 55 deletions(-) diff --git a/packages/components/src/components/ui/button.tsx b/packages/components/src/components/ui/button.tsx index 0b4ede06..7d0ec2c1 100644 --- a/packages/components/src/components/ui/button.tsx +++ b/packages/components/src/components/ui/button.tsx @@ -19,7 +19,7 @@ const buttonVariants = cva( secondary: 'bg-secondary text-secondary-foreground border border-border hover:bg-muted hover:text-secondary-hover', link: 'text-primary underline-offset-4 hover:underline', - ghost: 'border border-transparent hover:border hover:border-secondary-foreground', + ghost: 'border border-transparent hover:bg-sb-core-20 dark:hover:bg-sb-core-110', icon: 'bg-transparent text-secondary-foreground hover:bg-muted', }, size: { diff --git a/packages/web/src/components/apps/package-install-toast.tsx b/packages/web/src/components/apps/package-install-toast.tsx index b5bd2dcd..702cdd0c 100644 --- a/packages/web/src/components/apps/package-install-toast.tsx +++ b/packages/web/src/components/apps/package-install-toast.tsx @@ -1,22 +1,24 @@ import { useEffect, useState } from 'react'; -import { CircleAlertIcon, InfoIcon, Loader2Icon, XIcon } from 'lucide-react'; +import { CircleAlertIcon, InfoIcon, Loader2Icon } from 'lucide-react'; import { usePackageJson } from './use-package-json'; import { useLogs } from './use-logs'; import { Button } from '@srcbook/components/src/components/ui/button'; import { cn } from '@/lib/utils'; -const ToastWrapper: React.FC<{ showToast: boolean; children: React.ReactNode }> = ({ - showToast, - children, -}) => ( +const ToastWrapper: React.FC<{ + showToast: boolean; + className?: string; + children: React.ReactNode; +}> = ({ className, showToast, children }) => (
{children} @@ -37,75 +39,68 @@ const PackageInstallToast: React.FunctionComponent = () => { switch (status) { case 'installing': return ( - - - Installing Packages... - - - - ); - - case 'failed': - return ( - - - Packages failed to install + +
+ + Installing Packages... +
- -
); - case 'idle': - case 'complete': + case 'failed': return ( - - - Packages need to be installed + +
+ + Packages failed to install +
-
+
-
); + + case 'idle': + case 'complete': + return ( + +
+ + Packages need to be installed +
+ + +
+ ); } };