fix: layout size

This commit is contained in:
mehedi-hasan 2024-04-14 14:21:49 +06:00
parent dbcf6cab66
commit def648dc38
3 changed files with 8 additions and 7 deletions

View File

@ -13,8 +13,6 @@ export default function WorkspaceLayout(props: {
const defaultLayout = layout?.value ? JSON.parse(layout.value) : undefined; const defaultLayout = layout?.value ? JSON.parse(layout.value) : undefined;
const defaultCollapsed = collapsed?.value ? JSON.parse(collapsed.value) : undefined; const defaultCollapsed = collapsed?.value ? JSON.parse(collapsed.value) : undefined;
console.log("defaultL ", defaultLayout)
console.log("defaultC ", defaultCollapsed)
return ( return (
<> <>

View File

@ -29,6 +29,7 @@ import { DataTablePagination } from "./data-table-pagination";
import { DataTableToolbar } from "./data-table-toolbar"; import { DataTableToolbar } from "./data-table-toolbar";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area"; import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
import { Organization } from "@/types/organization"; import { Organization } from "@/types/organization";
import { ApiCommunication } from "@/types/api-communication";
interface DataTableProps<TData, TValue> { interface DataTableProps<TData, TValue> {
columns: ColumnDef<TData, TValue>[]; columns: ColumnDef<TData, TValue>[];
@ -71,7 +72,7 @@ export function DataTable<TData, TValue>({
return ( return (
<div className="space-y-4"> <div className="space-y-4">
<DataTableToolbar table={table} data={data as Organization[]} /> <DataTableToolbar table={table} data={data as ApiCommunication[]} />
{/* <div className="rounded-md border"> */} {/* <div className="rounded-md border"> */}
<ScrollArea className="rounded-md border h-[66vh]"> <ScrollArea className="rounded-md border h-[66vh]">
<Table> <Table>

View File

@ -29,7 +29,7 @@ interface DashboardProps {
} }
export function Dashboard({ export function Dashboard({
defaultLayout = [20, 40, 40], defaultLayout = [15, 85],
defaultCollapsed = false, defaultCollapsed = false,
navCollapsedSize, navCollapsedSize,
children, children,
@ -51,8 +51,10 @@ export function Dashboard({
defaultSize={defaultLayout[0]} defaultSize={defaultLayout[0]}
collapsedSize={navCollapsedSize} collapsedSize={navCollapsedSize}
collapsible={true} collapsible={true}
minSize={11} // minSize={11}
maxSize={12} // maxSize={12}
minSize={12}
maxSize={15}
onCollapse={() => { onCollapse={() => {
setIsCollapsed(true); setIsCollapsed(true);
document.cookie = `react-resizable-panels:collapsed=${JSON.stringify( document.cookie = `react-resizable-panels:collapsed=${JSON.stringify(
@ -75,7 +77,7 @@ export function Dashboard({
{/* <DocsSidebarNav items={docsConfig.sidebarNav} /> */} {/* <DocsSidebarNav items={docsConfig.sidebarNav} /> */}
</ResizablePanel> </ResizablePanel>
<ResizableHandle withHandle className="hidden lg:flex" /> <ResizableHandle withHandle className="hidden lg:flex" />
<ResizablePanel defaultSize={defaultLayout[1]} minSize={30}> <ResizablePanel defaultSize={defaultLayout[1]} minSize={75}>
{/* <TopNav navItems={topNavItems}/> */} {/* <TopNav navItems={topNavItems}/> */}
{children} {children}
</ResizablePanel> </ResizablePanel>