From 8c21f0ece3f31ad70f609c2693a97d8ef30d44f6 Mon Sep 17 00:00:00 2001 From: cannuri <91494156+cannuri@users.noreply.github.com> Date: Tue, 11 Mar 2025 03:59:46 +0100 Subject: [PATCH] refactor alert dialog styles, use vscode theme --- .../src/components/settings/SettingsView.tsx | 27 ++++++++---- webview-ui/src/components/ui/alert-dialog.tsx | 41 +++++++++++++------ 2 files changed, 47 insertions(+), 21 deletions(-) diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index df08a03971..7caf280dba 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -1,6 +1,15 @@ import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react" import { Button as VSCodeButton } from "vscrui" -import { CheckCheck, SquareMousePointer, Webhook, GitBranch, Bell, Cog, FlaskConical } from "lucide-react" +import { + CheckCheck, + SquareMousePointer, + Webhook, + GitBranch, + Bell, + Cog, + FlaskConical, + AlertTriangle, +} from "lucide-react" import { ApiConfiguration } from "../../../../src/shared/api" import { ExperimentId } from "../../../../src/shared/experiments" @@ -419,15 +428,17 @@ const SettingsView = forwardRef(({ onDone }, - Unsaved changes - - - Do you want to discard changes and continue? - + + + Unsaved Changes + + Do you want to discard changes and continue? - onConfirmDialogResult(true)}>Yes - onConfirmDialogResult(false)}>No + onConfirmDialogResult(false)}>Cancel + onConfirmDialogResult(true)}> + Discard changes + diff --git a/webview-ui/src/components/ui/alert-dialog.tsx b/webview-ui/src/components/ui/alert-dialog.tsx index 82a25bf8f7..6782b399c1 100644 --- a/webview-ui/src/components/ui/alert-dialog.tsx +++ b/webview-ui/src/components/ui/alert-dialog.tsx @@ -36,7 +36,7 @@ function AlertDialogContent({ className, ...props }: React.ComponentProps) { - return ( -
- ) + return
} function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">) { return (
) @@ -69,7 +63,10 @@ function AlertDialogTitle({ className, ...props }: React.ComponentProps ) @@ -82,18 +79,36 @@ function AlertDialogDescription({ return ( ) } function AlertDialogAction({ className, ...props }: React.ComponentProps) { - return + return ( + + ) } function AlertDialogCancel({ className, ...props }: React.ComponentProps) { - return + return ( + + ) } export {