From 61a322bbdcbc5460b9456cd5935a22f0bb1a29ad Mon Sep 17 00:00:00 2001 From: Neyl-123 <97339070+Neyl-123@users.noreply.github.com> Date: Thu, 14 May 2026 16:13:02 +0200 Subject: [PATCH 1/2] Made dropdowns had a white backgroud which was barely readable with the white text --- .../src/components/ui/simple-select.tsx | 67 ++++++++++++++++++ .../src/views/settings/configuration.tsx | 68 ++++++++----------- 2 files changed, 96 insertions(+), 39 deletions(-) create mode 100644 apps/desktop/src/components/ui/simple-select.tsx diff --git a/apps/desktop/src/components/ui/simple-select.tsx b/apps/desktop/src/components/ui/simple-select.tsx new file mode 100644 index 00000000..5b7372e8 --- /dev/null +++ b/apps/desktop/src/components/ui/simple-select.tsx @@ -0,0 +1,67 @@ +import { useState, useRef, useEffect } from "react"; +import { ChevronDown } from "lucide-react"; + +interface Option { + value: string; + label: string; +} + +interface SimpleSelectProps { + id?: string; + value: string; + options: Option[]; + onChange: (value: string) => void; + className?: string; +} + +export function SimpleSelect({ value, options, onChange, className = "", id }: SimpleSelectProps) { + const [isOpen, setIsOpen] = useState(false); + const containerRef = useRef(null); + + useEffect(() => { + function handleClickOutside(event: MouseEvent) { + if (containerRef.current && !containerRef.current.contains(event.target as Node)) { + setIsOpen(false); + } + } + document.addEventListener("mousedown", handleClickOutside); + return () => document.removeEventListener("mousedown", handleClickOutside); + }, []); + + const selectedOption = options.find(opt => opt.value === value) || options[0]; + + return ( +
+ + + {isOpen && ( +
+
    + {options.map(option => ( +
  • { + onChange(option.value); + setIsOpen(false); + }} + > + {option.label} +
  • + ))} +
+
+ )} +
+ ); +} diff --git a/apps/desktop/src/views/settings/configuration.tsx b/apps/desktop/src/views/settings/configuration.tsx index bebe410e..e60549f3 100644 --- a/apps/desktop/src/views/settings/configuration.tsx +++ b/apps/desktop/src/views/settings/configuration.tsx @@ -4,6 +4,7 @@ import Config from "@/config"; import { useConfigValue } from "@/hooks/use-config-value"; import { emit } from "@tauri-apps/api/event"; import { invoke } from "@tauri-apps/api/core"; +import { SimpleSelect } from "@/components/ui/simple-select"; export const Configuration = () => { const { value: showOnlyTalkingUsers } = useConfigValue("showOnlyTalkingUsers"); @@ -68,27 +69,22 @@ export const Configuration = () => { > Anchor horizontal - + options={[ + { value: "left", label: "Left" }, + { value: "center", label: "Center" }, + { value: "right", label: "Right" }, + ]} + className="w-40" + />
- + options={[ + { value: "top", label: "Top" }, + { value: "bottom", label: "Bottom" }, + ]} + className="w-40" + />
- + options={[ + { value: "all", label: "Everything" }, + { value: "username-box", label: "Username background only" }, + ]} + className="w-56" + />