diff --git a/frontend/src/components/Appshell.module.css b/frontend/src/components/Appshell.module.css
index d9afaf2..7b2ba21 100644
--- a/frontend/src/components/Appshell.module.css
+++ b/frontend/src/components/Appshell.module.css
@@ -10,11 +10,19 @@
}
-
+.title {
+ font-family:
+ Greycliff CF,
+ var(--mantine-font-family);
+ margin-bottom: var(--mantine-spacing-sm);
+ background-color: var(--mantine-color-body);
+ padding: var(--mantine-spacing-md);
+ padding-top: 18px;
+ height: px;
+ border-bottom: 1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-7));
+}
- .collapsed {
- width: 70px; /* Ancho reducido cuando colapsa */
- }
+
.wrapper {
display: flex;
@@ -65,8 +73,6 @@
-
-
.link {
display: block;
text-decoration: none;
diff --git a/frontend/src/components/Appshell_collapse.tsx b/frontend/src/components/Appshell.tsx
similarity index 96%
rename from frontend/src/components/Appshell_collapse.tsx
rename to frontend/src/components/Appshell.tsx
index 4ef5c88..a390ab8 100644
--- a/frontend/src/components/Appshell_collapse.tsx
+++ b/frontend/src/components/Appshell.tsx
@@ -70,7 +70,13 @@ import {
],
};
- export function AppShellWithMenu() {
+
+ type AppShellWithMenuProps = {
+ children?: React.ReactNode; // <- ahora es opcional
+ };
+
+ export function AppShellWithMenu({ children }: AppShellWithMenuProps) {
+
const location = useLocation();
const isMobile = useMediaQuery('(max-width: 768px)');
const [mobileOpened, { toggle: toggleMobile, close: closeMobile }] = useDisclosure(false);
@@ -174,9 +180,10 @@ import {
{/* Main Content */}
- {/* Aquí va el contenido principal */}
- Main Content
-
+ {children}
+
+
+
);
}
diff --git a/frontend/src/components/LlamadorAPI.tsx b/frontend/src/components/LlamadorAPI.tsx
new file mode 100644
index 0000000..bbe27c9
--- /dev/null
+++ b/frontend/src/components/LlamadorAPI.tsx
@@ -0,0 +1,127 @@
+import { useState, useEffect } from 'react';
+import {
+ TextInput,
+ Textarea,
+ Button,
+ Box,
+ Center,
+ Stack,
+ Badge,
+ Group,
+} from '@mantine/core';
+import { MetodoSelect } from './MetodoSelect';
+
+export function LlamadorAPI() {
+ const [direccion, setDireccion] = useState('http://localhost:8000/api/saludo');
+ const [metodo, setMetodo] = useState('GET');
+ const [contenido, setContenido] = useState('');
+ const [respuesta, setRespuesta] = useState('');
+ const [codigoRespuesta, setCodigoRespuesta] = useState(null);
+
+ const colorCodigo = (status: number): string => {
+ if (status >= 200 && status < 300) return 'green';
+ if (status >= 300 && status < 400) return 'yellow';
+ if (status >= 400 && status < 500) return 'orange';
+ return 'red';
+ };
+
+ const llamarAPI = async () => {
+ try {
+ const options: RequestInit = {
+ method: metodo,
+ mode: 'cors',
+ headers: {},
+ };
+
+ if (metodo !== 'GET') {
+ options.headers = {
+ 'Content-Type': 'application/json',
+ };
+ try {
+ JSON.parse(contenido);
+ options.body = contenido;
+ } catch (err) {
+ setRespuesta('Error: El contenido no es un JSON válido');
+ setCodigoRespuesta(null);
+ return;
+ }
+ }
+
+ const res = await fetch(direccion, options);
+ setCodigoRespuesta(res.status);
+
+ const contentType = res.headers.get('content-type');
+
+ if (contentType?.includes('application/json')) {
+ const data = await res.json();
+ const formatted = JSON.stringify(data, null, 2);
+ setRespuesta(formatted);
+ } else {
+ const text = await res.text();
+ setRespuesta(text);
+ }
+ } catch (error: any) {
+ console.error('Error en la API:', error);
+ setRespuesta(`Error: ${error.message || error}`);
+ setCodigoRespuesta(null);
+ }
+ };
+
+ useEffect(() => {
+ const handler = (e: KeyboardEvent) => {
+ if (e.ctrlKey && e.key === 'Enter') {
+ e.preventDefault();
+ llamarAPI();
+ }
+ };
+
+ window.addEventListener('keydown', handler);
+ return () => window.removeEventListener('keydown', handler);
+ }, [metodo, direccion, contenido]);
+
+ return (
+
+
+
+ setDireccion(e.currentTarget.value)}
+ />
+
+
+
+
+
+
+ );
+}
diff --git a/frontend/src/pages/404.tsx b/frontend/src/pages/404.tsx
index bafada4..1ad2181 100644
--- a/frontend/src/pages/404.tsx
+++ b/frontend/src/pages/404.tsx
@@ -2,42 +2,48 @@ import { Box, Title, Text, Button, Group, Stack, Image, Center } from '@mantine/
import { IconArrowLeft } from '@tabler/icons-react';
import { Link } from 'react-router-dom';
import { MantineCardWithShader } from '../components/HoloShader'; // Ajusta ruta si es necesario
+import { AppShellWithMenu } from '../components/Appshell';
export function Error_404() {
return (
-
+
+
+
+
-
-
-
+
+
+ Página no encontrada
+
+
+ Parece que la página que estás buscando no existe o fue removida. Pero no te preocupes, puedes volver al inicio fácilmente.
+
-
-
-
-
- Página no encontrada
-
-
-
- Parece que la página que estás buscando no existe o fue removida. Pero no te preocupes, puedes volver al inicio fácilmente.
-
-
-
- }
- >
- Volver al inicio
-
-
-
+
+ }
+ >
+ Volver al inicio
+
+
+
+
-
+
+
);
}
\ No newline at end of file
diff --git a/frontend/src/pages/Analitica.tsx b/frontend/src/pages/Analitica.tsx
index a884305..dc731c7 100644
--- a/frontend/src/pages/Analitica.tsx
+++ b/frontend/src/pages/Analitica.tsx
@@ -2,19 +2,14 @@ import { ColorSchemeToggle } from '../components/ColorSchemeToggle/ColorSchemeTo
import { Welcome } from '../components/Welcome/Welcome';
import MiBoton from '../components/botoncito';
import { Center, Box } from '@mantine/core';
-import { DoubleNavbar } from '../components/DoubleNavbar';
-
+import { AppShellWithMenu } from '../components/Appshell';
export function Prueba_1() {
return (
-
- {/* Sidebar fijo a la izquierda */}
+
- {/* Contenido principal */}
-
-
-
+
);
}
\ No newline at end of file
diff --git a/frontend/src/pages/Consulta_api.tsx b/frontend/src/pages/Consulta_api.tsx
index 51e17a0..6574164 100644
--- a/frontend/src/pages/Consulta_api.tsx
+++ b/frontend/src/pages/Consulta_api.tsx
@@ -1,137 +1,12 @@
-import { useState } from 'react';
-import {
- TextInput,
- Textarea,
- Button,
- Box,
- Center,
- Stack,
- Badge,
- Group,
-} from '@mantine/core';
-import { MetodoSelect } from '../components/MetodoSelect'; // 👈 Importación del nuevo componente
-import { useEffect } from 'react';
-
-
+import { Box } from '@mantine/core';
+import { LlamadorAPI } from '../components/LlamadorAPI';
+import { AppShellWithMenu } from '../components/Appshell';
export function Consulta_API() {
- const [direccion, setDireccion] = useState('http://localhost:8000/api/saludo');
- const [metodo, setMetodo] = useState('GET');
- const [contenido, setContenido] = useState('');
- const [respuesta, setRespuesta] = useState('');
- const [codigoRespuesta, setCodigoRespuesta] = useState(null);
-
- const colorCodigo = (status: number): string => {
- if (status >= 200 && status < 300) return 'green';
- if (status >= 300 && status < 400) return 'yellow';
- if (status >= 400 && status < 500) return 'orange';
- return 'red';
- };
-
- const llamarAPI = async () => {
- try {
- const options: RequestInit = {
- method: metodo,
- mode: 'cors',
- headers: {},
- };
-
- if (metodo !== 'GET') {
- options.headers = {
- 'Content-Type': 'application/json',
- };
- try {
- JSON.parse(contenido);
- options.body = contenido;
- } catch (err) {
- setRespuesta('Error: El contenido no es un JSON válido');
- setCodigoRespuesta(null);
- return;
- }
- }
-
- const res = await fetch(direccion, options);
- setCodigoRespuesta(res.status);
-
- const contentType = res.headers.get('content-type');
-
- if (contentType?.includes('application/json')) {
- const data = await res.json();
- const formatted = JSON.stringify(data, null, 2);
- setRespuesta(formatted);
- } else {
- const text = await res.text();
- setRespuesta(text);
- }
- } catch (error: any) {
- console.error('Error en la API:', error);
- setRespuesta(`Error: ${error.message || error}`);
- setCodigoRespuesta(null);
- }
- };
-
-
- useEffect(() => {
- const handler = (e: KeyboardEvent) => {
- if (e.ctrlKey && e.key === 'Enter') {
- e.preventDefault();
- llamarAPI();
- }
- };
-
- window.addEventListener('keydown', handler);
- return () => window.removeEventListener('keydown', handler);
- }, [metodo, direccion, contenido]);
-
-
return (
-
-
-
-
-
- setDireccion(e.currentTarget.value)}
- />
-
-
-
-
-
-
-
+
+
+
);
-
-}
+}
\ No newline at end of file
diff --git a/frontend/src/pages/Home.page.tsx b/frontend/src/pages/Home.page.tsx
index a4be09b..ffb4ddb 100644
--- a/frontend/src/pages/Home.page.tsx
+++ b/frontend/src/pages/Home.page.tsx
@@ -1,16 +1,10 @@
-import { ColorSchemeToggle } from '../components/ColorSchemeToggle/ColorSchemeToggle';
-import { Welcome } from '../components/Welcome/Welcome';
-import MiBoton from '../components/botoncito';
-import { Center, Box } from '@mantine/core';
-import { MantineCardWithShader } from '../components/HoloShader';
-
-
+import { AppShellWithMenu } from '../components/Appshell';
export function HomePage() {
return (
-
+
-
+
);
}
\ No newline at end of file
diff --git a/frontend/src/pages/Plantilla.tsx b/frontend/src/pages/Plantilla.tsx
new file mode 100644
index 0000000..5d14e1e
--- /dev/null
+++ b/frontend/src/pages/Plantilla.tsx
@@ -0,0 +1,10 @@
+import { AppShellWithMenu } from '../components/Appshell';
+
+
+export function Plantilla() {
+ return (
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/frontend/src/pages/Prueba_appshell.tsx b/frontend/src/pages/Prueba_appshell.tsx
index 8711e99..62fcdd8 100644
--- a/frontend/src/pages/Prueba_appshell.tsx
+++ b/frontend/src/pages/Prueba_appshell.tsx
@@ -3,11 +3,15 @@ import { Welcome } from '../components/Welcome/Welcome';
import MiBoton from '../components/botoncito';
import { Center, Box } from '@mantine/core';
import { MantineCardWithShader } from '../components/HoloShader';
-import {AppShellWithMenu } from '../components/Appshell_collapse';
-
+import { AppShellWithMenu } from '../components/Appshell';
export function Prueba_appshell() {
return (
-
+
+
+
+
+
+
);
}
\ No newline at end of file