From 3d29fc04eec0e32df4d9c66388fb2303d01dac45 Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 4 May 2023 19:51:08 -0600 Subject: Arregla modal de inicio de sesión MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/forms/login_form.tsx | 69 +++++++++++++++++++++++++++++++++++ src/components/login_button.tsx | 11 ++++++ src/components/navbar.tsx | 12 +++--- src/components/stylesheets/shared.css | 2 +- 4 files changed, 86 insertions(+), 8 deletions(-) create mode 100644 src/components/forms/login_form.tsx create mode 100644 src/components/login_button.tsx (limited to 'src/components') diff --git a/src/components/forms/login_form.tsx b/src/components/forms/login_form.tsx new file mode 100644 index 0000000..bd1d01e --- /dev/null +++ b/src/components/forms/login_form.tsx @@ -0,0 +1,69 @@ +import { Modal } from "flowbite"; +import { PersonCircle } from "react-bootstrap-icons"; +import LoginButton from "../login_button"; +import "../stylesheets/shared.css" +import { useEffect, useState } from "react"; + +export function LoginForm() { + useEffect(() => { + const target = document.getElementById("loginModal"); + const options = { + closable: true + }; + const modal = new Modal(target, options); + document.getElementById('closeModalButton')?.addEventListener("click", () => { + modal.hide(); + }); + + document.getElementById('loginButton')?.addEventListener("click", () => { + modal.show(); + }); + }, []); + + function handleLogin(event) { + event.preventDefault(); + const form = event.target; + const formData = new FormData(form); + const formJson = Object.fromEntries(formData.entries()); + console.log(formJson); + } + + return( + <> + + + + + ); +} \ No newline at end of file diff --git a/src/components/login_button.tsx b/src/components/login_button.tsx new file mode 100644 index 0000000..3516088 --- /dev/null +++ b/src/components/login_button.tsx @@ -0,0 +1,11 @@ +import { PersonCircle } from "react-bootstrap-icons"; + +export default function LoginButton() { + return ( + + ); +} \ No newline at end of file diff --git a/src/components/navbar.tsx b/src/components/navbar.tsx index dd8ca25..b5599b9 100644 --- a/src/components/navbar.tsx +++ b/src/components/navbar.tsx @@ -1,6 +1,8 @@ -import { CartFill, PersonCircle } from "react-bootstrap-icons"; +import { CartFill } from "react-bootstrap-icons"; import "./stylesheets/navbar.css"; import "./stylesheets/shared.css"; +import React from "react"; +import { LoginForm } from "./forms/login_form"; export default function Navbar() { return( @@ -39,12 +41,8 @@ export default function Navbar() { - - - - - + { /* Modal */ } + diff --git a/src/components/stylesheets/shared.css b/src/components/stylesheets/shared.css index 5f410c7..9bda368 100644 --- a/src/components/stylesheets/shared.css +++ b/src/components/stylesheets/shared.css @@ -7,7 +7,7 @@ } .button { - background-color: #394490; + background-color: #394490 !important; } .main-view { -- cgit v1.2.3