Corrige overflow del layout y autenticación de la API de proyectos
This commit is contained in:
@@ -6,6 +6,7 @@ body, html, #root {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
font-family: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||||
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* =========================
|
/* =========================
|
||||||
@@ -21,7 +22,7 @@ body, html, #root {
|
|||||||
grid-template-columns: var(--sidebar-width) 1fr;
|
grid-template-columns: var(--sidebar-width) 1fr;
|
||||||
grid-template-rows: 100vh;
|
grid-template-rows: 100vh;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: grid-template-columns 0.3s ease;
|
transition: grid-template-columns 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|||||||
20
src/App.tsx
20
src/App.tsx
@@ -39,11 +39,21 @@ export default function App() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-screen">
|
// Blindaje global del layout
|
||||||
<Sidebar setPage={setPage} />
|
<div className="flex h-screen w-full overflow-hidden">
|
||||||
<div className="flex-1 flex flex-col">
|
{/* Sidebar no debe encogerse */}
|
||||||
<TopMenu />
|
<div className="shrink-0">
|
||||||
<main className="flex-1 overflow-auto">
|
<Sidebar setPage={setPage} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* min-w-0: evita que páginas anchas (tablas) empujen el layout */}
|
||||||
|
<div className="flex min-w-0 flex-1 flex-col">
|
||||||
|
<div className="shrink-0">
|
||||||
|
<TopMenu />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Scroll solo aquí */}
|
||||||
|
<main className="min-w-0 flex-1 overflow-auto">
|
||||||
{renderPage()}
|
{renderPage()}
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ export const PROJECTS_API_URL = `${API_BASE_URL}/api/v3/data/ppfu31vhv5gf6i0/m05
|
|||||||
const API_TOKEN = import.meta.env.VITE_API_TOKEN;
|
const API_TOKEN = import.meta.env.VITE_API_TOKEN;
|
||||||
|
|
||||||
export const getAuthHeaders = () => ({
|
export const getAuthHeaders = () => ({
|
||||||
Authorization: `Bearer ${API_TOKEN}`,
|
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
"xc-token": API_TOKEN, // NocoDB style
|
||||||
|
Authorization: `Bearer ${API_TOKEN}`, // fallback por si el backend usa Bearer
|
||||||
});
|
});
|
||||||
|
|
||||||
export interface ProjectRecord {
|
export interface ProjectRecord {
|
||||||
|
|||||||
@@ -2,16 +2,12 @@ import { defineConfig } from "vite";
|
|||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
import tailwindcss from "@tailwindcss/vite";
|
import tailwindcss from "@tailwindcss/vite";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tailwindcss()],
|
plugins: [react(), tailwindcss()],
|
||||||
|
|
||||||
server: {
|
server: {
|
||||||
allowedHosts: [
|
host: true, // expone en 0.0.0.0
|
||||||
"localhost",
|
allowedHosts: "all", // permite dominios como *.ngrok-free.dev
|
||||||
"127.0.0.1",
|
|
||||||
"reyna-compressive-shaunna.ngrok-free.dev",
|
|
||||||
],
|
|
||||||
port: 5173,
|
port: 5173,
|
||||||
|
strictPort: true, // no brinca de puerto
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user