From 8040a87759746c81694d2cbd1fb82039eb0e68f0 Mon Sep 17 00:00:00 2001
From: HombreLaser <sebastian-440@live.com>
Date: Sat, 6 May 2023 00:02:56 -0600
Subject: Agregado dropdown menu de autenticación
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/components/user_dropdown_button.tsx | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 src/components/user_dropdown_button.tsx

(limited to 'src/components/user_dropdown_button.tsx')

diff --git a/src/components/user_dropdown_button.tsx b/src/components/user_dropdown_button.tsx
new file mode 100644
index 0000000..f4148bc
--- /dev/null
+++ b/src/components/user_dropdown_button.tsx
@@ -0,0 +1,32 @@
+import { useEffect } from "react";
+import { PersonCircle } from "react-bootstrap-icons";
+import { Dropdown, DropdownOptions } from 'flowbite';
+import UserAccountDropdownMenu from "./user_account_dropdown_menu";
+
+export default function UserDropdownButton() {
+  useEffect(() => {
+    const target = document.getElementById("userAccountDropdownMenu");
+    const trigger = document.getElementById("userAccountButton");
+    const options: DropdownOptions = {
+      triggerType: 'click',
+      placement: 'bottom'
+    };
+    const dropdown_menu = new Dropdown(target, trigger, options);
+    trigger?.addEventListener("click", () => {
+      if(dropdown_menu.isVisible())
+        dropdown_menu.show();
+    });
+  }, []);
+
+  return (
+    <>
+      <button id="userAccountButton" className="mr-4 text-neutral-500 hover:text-neutral-700 focus:text-neutral-700 disabled:text-black/30 dark:text-neutral-200 dark:hover:text-neutral-300 dark:focus:text-neutral-300 [&.active]:text-black/90 dark:[&.active]:text-neutral-400">
+        <span className="[&>svg]:w-5">
+          <PersonCircle color="#394490" size={32}/>
+        </span>
+      </button>
+
+      <UserAccountDropdownMenu/>
+    </>
+  );
+}
\ No newline at end of file
-- 
cgit v1.2.3

