Corrige overflow del layout y autenticación de la API de proyectos

This commit is contained in:
Marlene-Angel
2025-12-22 13:00:53 -08:00
parent 1519548c90
commit 25da09352d
4 changed files with 23 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ body, html, #root {
padding: 0;
height: 100%;
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-rows: 100vh;
height: 100vh;
width: 100vw;
width: 100%;
overflow: hidden;
transition: grid-template-columns 0.3s ease;
}

View File

@@ -39,11 +39,21 @@ export default function App() {
};
return (
<div className="flex h-screen">
// Blindaje global del layout
<div className="flex h-screen w-full overflow-hidden">
{/* Sidebar no debe encogerse */}
<div className="shrink-0">
<Sidebar setPage={setPage} />
<div className="flex-1 flex flex-col">
</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 />
<main className="flex-1 overflow-auto">
</div>
{/* Scroll solo aquí */}
<main className="min-w-0 flex-1 overflow-auto">
{renderPage()}
</main>
</div>

View File

@@ -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;
export const getAuthHeaders = () => ({
Authorization: `Bearer ${API_TOKEN}`,
"Content-Type": "application/json",
"xc-token": API_TOKEN, // NocoDB style
Authorization: `Bearer ${API_TOKEN}`, // fallback por si el backend usa Bearer
});
export interface ProjectRecord {

View File

@@ -2,16 +2,12 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
server: {
allowedHosts: [
"localhost",
"127.0.0.1",
"reyna-compressive-shaunna.ngrok-free.dev",
],
host: true, // expone en 0.0.0.0
allowedHosts: "all", // permite dominios como *.ngrok-free.dev
port: 5173,
strictPort: true, // no brinca de puerto
},
});