diff --git a/public/logo.png b/public/logo.png new file mode 100644 index 0000000..cff8085 Binary files /dev/null and b/public/logo.png differ diff --git a/src/App.tsx b/src/App.tsx index 1a95bcc..0c90c5f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -33,6 +33,9 @@ const App: React.FC = () => { const [isVersionDropdownOpen, setIsVersionDropdownOpen] = useState(false); const [isAccountDropdownOpen, setIsAccountDropdownOpen] = useState(false); + const versionRef = React.useRef(null); + const accountRef = React.useRef(null); + useEffect(() => { const fetchVersions = async () => { const v = await launcherService.getVersions(); @@ -42,6 +45,27 @@ const App: React.FC = () => { fetchVersions(); }, []); + useEffect(() => { + function handleClickOutside(event: MouseEvent) { + const target = event.target as Node; + + // Close version dropdown if clicked outside + if (versionRef.current && !versionRef.current.contains(target)) { + setIsVersionDropdownOpen(false); + } + + // Close account dropdown if clicked outside + if (accountRef.current && !accountRef.current.contains(target)) { + setIsAccountDropdownOpen(false); + } + } + + document.addEventListener("mousedown", handleClickOutside); + return () => { + document.removeEventListener("mousedown", handleClickOutside); + }; + }, []); + return (
{/* Sidebar */} @@ -94,13 +118,16 @@ const App: React.FC = () => { {/* Top Bar */}
{/* Version Selector */} -
+
{/* Glow */}
- {isVersionDropdownOpen && ( -
- {versions.map((v) => ( - - ))} -
- )} +
+ {versions.map((v) => ( + + ))} +
{/* Account Selector */} -
+
{/* Glow */}
@@ -159,24 +191,29 @@ const App: React.FC = () => {
- {isAccountDropdownOpen && ( -
-
-

SaturnDev

-

- dev@saturnclient.com -

-
- - +
+
+

SaturnDev

+

+ dev@saturnclient.com +

- )} + + +