diff --git a/ui/src/components/LoginModal.jsx b/ui/src/components/LoginModal.jsx new file mode 100644 index 0000000..ba3e89f --- /dev/null +++ b/ui/src/components/LoginModal.jsx @@ -0,0 +1,90 @@ +import { Modal, Button, Checkbox, Form, Input } from 'antd'; + +import _service from '@netuno/service-client'; + +function LoginModal({isLoginModalOpen, setIsLoginModalOpen}) { + const handleLoginOk = () => { + setIsLoginModalOpen(false); + }; + const handleLoginCancel = () => { + setIsLoginModalOpen(false); + }; + + const onFinish = values => { + console.log('Success:', values); + _service({ + url: "/services/_auth", + method: "POST", + data: {...values, jwt: true }, + success: (response) => { + if (response.json) { + console.log("Service Response", response.json); + } + }, + fail: (e) => { + console.log("Service Error", e); + } + }); + }; + + const onFinishFailed = errorInfo => { + console.log('Failed:', errorInfo); + }; + + return ( + <> + + + +
+ + + + + + + + + + + Remember me + + + + + + +
+ +
+ + ); +} + +export default LoginModal; diff --git a/ui/src/containers/DashboardContainer/index.jsx b/ui/src/containers/DashboardContainer/index.jsx index 5acd349..5cbde25 100644 --- a/ui/src/containers/DashboardContainer/index.jsx +++ b/ui/src/containers/DashboardContainer/index.jsx @@ -5,6 +5,7 @@ import { Button } from 'antd'; import ListaMedicosModal from "../../components/ListaMedicosModal.jsx"; import ListaPacientesModal from "../../components/ListaPacientesModal.jsx"; import CadastrarMedicosModal from "../../components/CadastrarMedicosModal.jsx"; +import LoginModal from "../../components/LoginModal.jsx"; import "./index.less"; @@ -12,6 +13,7 @@ function DashboardContainer() { const [isPacientesModalOpen, setIsPacientesModalOpen] = useState(false); const [isMedicosModalOpen, setIsMedicosModalOpen] = useState(false); const [isCadastrarMedicosModalOpen, setIsCadastrarMedicosModalOpen] = useState(false); + const [isLoginModalOpen, setIsLoginModalOpen] = useState(false); const showPacientesModal = () => { setIsPacientesModalOpen(true); @@ -25,6 +27,10 @@ function DashboardContainer() { setIsCadastrarMedicosModalOpen(true); }; + const showLoginModal = () => { + setIsLoginModalOpen(true); + }; + return ( <> + + ); }