chore: fix switch view (#71)

* chore: fix switch view

* chore: fix the issue of switch database view
This commit is contained in:
Kilu.He
2025-09-12 10:06:43 +08:00
committed by GitHub
parent 02ac0ee3ee
commit 3e94fe7cde
10 changed files with 79 additions and 106 deletions

View File

@@ -1,10 +1,11 @@
import { useEffect } from 'react';
import { useDatabaseContext, useDatabaseViewId } from '@/application/database-yjs';
import { useRenderFields } from '@/components/database/components/grid/grid-column';
import GridVirtualizer from '@/components/database/components/grid/grid-table/GridVirtualizer';
import { GridProvider } from '@/components/database/grid/GridProvider';
import { useEffect } from 'react';
export function Grid () {
export function Grid() {
const { fields } = useRenderFields();
const viewId = useDatabaseViewId();
@@ -18,13 +19,13 @@ export function Grid () {
return (
<GridProvider>
<div data-testid="database-grid" className={`database-grid relative grid-table-${viewId} flex w-full flex-1 flex-col`}>
<GridVirtualizer
columns={fields}
/>
<div
data-testid='database-grid'
className={`database-grid relative grid-table-${viewId} flex w-full flex-1 flex-col`}
>
<GridVirtualizer columns={fields} />
</div>
</GridProvider>
);
}