File tree 5 files changed +66
-20
lines changed
5 files changed +66
-20
lines changed Original file line number Diff line number Diff line change 1
1
<!DOCTYPE html>
2
2
< html lang ="en ">
3
- < head >
4
- < meta charset ="UTF-8 " />
5
- < link rel ="icon " type ="image/svg+xml " href ="/vite.svg " />
6
- < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
- < title > Crm-React</ title >
8
- </ head >
9
- < body >
10
- < div id ="root "> </ div >
11
- < script type ="module " src ="/src/main.jsx "> </ script >
12
- </ body >
3
+ < head >
4
+ < meta charset ="UTF-8 " />
5
+ < link rel ="icon " type ="image/svg+xml " href ="/vite.svg " />
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
+ < title > Crm-React</ title >
8
+ </ head >
9
+ < body class =" min-h-screen bg-gray-100 " >
10
+ < div id ="root "> </ div >
11
+ < script type ="module " src ="/src/main.jsx "> </ script >
12
+ </ body >
13
13
</ html >
Original file line number Diff line number Diff line change
1
+ import { Outlet } from 'react-router-dom' ;
2
+
3
+ const Layout = ( ) => {
4
+ return (
5
+
6
+ < div className = "md:flex md:min-h-screen" >
7
+ < aside className = "md:w-1/4 bg-green-900 px-5 py-10" >
8
+ < h2 className = 'font-bold text-4xl text-center text-white' > CRM-Clientes</ h2 >
9
+ </ aside >
10
+
11
+ < main className = "md:w-3/4 p-10 md:h-screen overflow-scroll" >
12
+ < Outlet />
13
+ </ main >
14
+ </ div >
15
+ ) ;
16
+ } ;
17
+
18
+ export default Layout ;
Original file line number Diff line number Diff line change 1
- import React from 'react'
2
- import ReactDOM from 'react-dom/client'
3
- import './index.css'
1
+ import React from 'react' ;
2
+ import ReactDOM from 'react-dom/client' ;
3
+ import './index.css' ;
4
4
import { createBrowserRouter , RouterProvider } from "react-router-dom" ;
5
+ import Layout from './components/Layout' ;
6
+ import NuevoCliente from './pages/NuevoCliente' ;
7
+ import Index from './pages/Index' ;
8
+
5
9
6
10
const router = createBrowserRouter ( [
7
11
{
8
12
path : "/" ,
9
- element : < h1 > Inicio</ h1 >
13
+ element : < Layout /> ,
14
+ children : [
15
+ {
16
+ index : true ,
17
+ element : < Index />
18
+ } ,
19
+ {
20
+ path : "/clientes/nuevo" ,
21
+ element : < NuevoCliente />
22
+ } ,
23
+ ]
24
+
10
25
} ,
11
- {
12
- path : "/nosotros" ,
13
- element : < h1 > Nosotros</ h1 >
14
- }
15
- ] )
26
+
27
+ ] ) ;
16
28
17
29
ReactDOM . createRoot ( document . getElementById ( 'root' ) ) . render (
18
30
< React . StrictMode >
19
31
< RouterProvider router = { router } />
20
32
</ React . StrictMode > ,
21
- )
33
+ ) ;
Original file line number Diff line number Diff line change
1
+
2
+ const Index = ( ) => {
3
+ return (
4
+ < div > Inicio</ div >
5
+ ) ;
6
+ } ;
7
+
8
+ export default Index ;
Original file line number Diff line number Diff line change
1
+
2
+ const NuevoCliente = ( ) => {
3
+ return (
4
+ < div > Nuevo Cliente</ div >
5
+ ) ;
6
+ } ;
7
+
8
+ export default NuevoCliente ;
You can’t perform that action at this time.
0 commit comments