From 649e732a82fec6d0ee4781d706b7e4a5ae83aa69 Mon Sep 17 00:00:00 2001 From: JailtonAraujo Date: Wed, 21 Jun 2023 23:45:45 -0300 Subject: [PATCH] estabilizando ant disiger no projeto e criando primero form --- first-app/src/App.tsx | 15 +++- first-app/src/components/ClienteForm.tsx | 87 +++++++++++++++++++ first-app/src/components/sideBar.tsx | 61 +++++++++++++ first-app/src/index.css | 10 +++ .../src/pages/Cliente/Cliente.module.css | 3 + first-app/src/pages/Cliente/NewCliente.tsx | 25 ++++++ first-app/src/pages/PageBase/PageBase.tsx | 25 ++++++ first-app/src/pages/home/home.tsx | 75 ---------------- 8 files changed, 223 insertions(+), 78 deletions(-) create mode 100644 first-app/src/components/ClienteForm.tsx create mode 100644 first-app/src/components/sideBar.tsx create mode 100644 first-app/src/pages/Cliente/Cliente.module.css create mode 100644 first-app/src/pages/Cliente/NewCliente.tsx create mode 100644 first-app/src/pages/PageBase/PageBase.tsx delete mode 100644 first-app/src/pages/home/home.tsx diff --git a/first-app/src/App.tsx b/first-app/src/App.tsx index 560eef6..9f92bee 100644 --- a/first-app/src/App.tsx +++ b/first-app/src/App.tsx @@ -2,15 +2,24 @@ import { createBrowserRouter, RouterProvider, } from "react-router-dom"; - import './App.css' -import Home from "./pages/home/home"; + +//pages +import PageBase from "./pages/PageBase/PageBase"; +import NewCliente from "./pages/Cliente/NewCliente"; const router = createBrowserRouter([ { path: "/", - element: , + element: , + children:[ + { + path:"/cliente/new", + element: + } + ] }, + ]); function App() { diff --git a/first-app/src/components/ClienteForm.tsx b/first-app/src/components/ClienteForm.tsx new file mode 100644 index 0000000..d392fc2 --- /dev/null +++ b/first-app/src/components/ClienteForm.tsx @@ -0,0 +1,87 @@ +import { Button, Form, Input, Select } from 'antd'; +import styles from '../pages/Cliente/Cliente.module.css'; +import { useEffect } from 'react'; + +export interface FormClienteProps { + values?: any, + btnTitle: string, + eventEmiter: any +} + +function ClienteForm(props: FormClienteProps) { + + const onFinish = (values: any) => { + props.eventEmiter(values); + }; + + const onFinishFailed = (errorInfo: any) => { + console.log('Failed:', errorInfo); + }; + + useEffect(() => { + //TO DO + //GET ALL COUNTRIES FOR SHOW IN SELECT ELEMENT + }, []) + + + return ( +
+ + + + + + + + + + + + + +