From b286a4118f8ade64a6c37e4ff7676f3f723ec581 Mon Sep 17 00:00:00 2001 From: CJ Pais Date: Thu, 7 Aug 2025 17:03:25 -0700 Subject: [PATCH] tweak language slightly. --- src/components/settings/ShowOverlay.tsx | 17 ++++++----- src/components/ui/Dropdown.tsx | 39 ++++++++++++++++++++----- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/src/components/settings/ShowOverlay.tsx b/src/components/settings/ShowOverlay.tsx index 3810852..e177e6d 100644 --- a/src/components/settings/ShowOverlay.tsx +++ b/src/components/settings/ShowOverlay.tsx @@ -10,22 +10,23 @@ interface ShowOverlayProps { } const overlayOptions = [ - { value: "none", label: "Do not show" }, - { value: "bottom", label: "On bottom" }, - { value: "top", label: "On top" } + { value: "none", label: "None" }, + { value: "bottom", label: "Bottom" }, + { value: "top", label: "Top" }, ]; export const ShowOverlay: React.FC = ({ descriptionMode = "tooltip", - grouped = false + grouped = false, }) => { const { getSetting, updateSetting, isUpdating } = useSettings(); - const selectedPosition = (getSetting("overlay_position") || "bottom") as OverlayPosition; + const selectedPosition = (getSetting("overlay_position") || + "bottom") as OverlayPosition; return ( = ({ updateSetting("overlay_position", value as OverlayPosition)} + onSelect={(value) => + updateSetting("overlay_position", value as OverlayPosition) + } disabled={isUpdating("overlay_position")} /> diff --git a/src/components/ui/Dropdown.tsx b/src/components/ui/Dropdown.tsx index 857d69e..5ffb010 100644 --- a/src/components/ui/Dropdown.tsx +++ b/src/components/ui/Dropdown.tsx @@ -7,6 +7,7 @@ export interface DropdownOption { interface DropdownProps { options: DropdownOption[]; + className?: string; selectedValue: string | null; onSelect: (value: string) => void; placeholder?: string; @@ -18,6 +19,7 @@ export const Dropdown: React.FC = ({ options, selectedValue, onSelect, + className = "", placeholder = "Select an option...", disabled = false, onRefresh, @@ -27,7 +29,10 @@ export const Dropdown: React.FC = ({ useEffect(() => { const handleClickOutside = (event: MouseEvent) => { - if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) { + if ( + dropdownRef.current && + !dropdownRef.current.contains(event.target as Node) + ) { setIsOpen(false); } }; @@ -35,7 +40,9 @@ export const Dropdown: React.FC = ({ return () => document.removeEventListener("mousedown", handleClickOutside); }, []); - const selectedOption = options.find(option => option.value === selectedValue); + const selectedOption = options.find( + (option) => option.value === selectedValue, + ); const handleSelect = (value: string) => { onSelect(value); @@ -49,31 +56,47 @@ export const Dropdown: React.FC = ({ }; return ( -
+
{isOpen && !disabled && (
{options.length === 0 ? ( -
No options found
+
+ No options found +
) : ( options.map((option) => (