From 8040a87759746c81694d2cbd1fb82039eb0e68f0 Mon Sep 17 00:00:00 2001 From: HombreLaser 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 ( + <> + + + + + ); +} \ No newline at end of file -- cgit v1.2.3