Files
AppFlowy-Web/src/components/database/grid/Grid.tsx
Kilu.He 748f790771 feat: support database (#2)
* chore: support drag row

* chore: support drag column

* chore: modified board virtual list

* chore: support drag board column

* chore: support drag card

* chore: support fix grid header

* chore: support fix board header

* chore: disabled drag and drop on readonly

* chore: adjust padding start and end on document

* chore: support new row

* chore: support create view

* chore: hide or show the property

* chore: lint

* chore: add card at the top

* chore: support text cell editing

* chore: support swicth property type and checkbox editing

* chore: support number cell editing

* chore: support select cell editing

* chore: support date cell editing

* chore: support relation and checklist

* chore: support calculation

* chore: support filters and sorts

* chore: support edit row modal

* chore: support files&media

* chore: pull origin main

* chore: modified border width

* chore: fixed some issues

* chore: modified active cell style

* chore: add switch language to AI Translate

* chore: modified upload color

* chore: support board group

* chore: support board

* chore: update database filter and board column components

* chore: update download

* chore: update components and pages, optimize UI and functionality

* chore: update component and update key bind

* chore: update filters

* chore: add copy button to date cell

* chore: board

* chore: replace some old token to new one

* chore: add hidden item menu

* chore: show the checkbox on card

* chore: adjust resize row

* chore: update sorts

* chore: fix issues of database on document

* chore: fix checkbox data

* chore: modified test
2025-06-17 17:50:26 +08:00

32 lines
875 B
TypeScript

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 () {
const { fields } = useRenderFields();
const viewId = useDatabaseViewId();
const { onRendered } = useDatabaseContext();
useEffect(() => {
if (fields) {
onRendered?.();
}
}, [fields, onRendered]);
return (
<GridProvider>
<div className={`database-grid relative grid-table-${viewId} flex w-full flex-1 flex-col`}>
<GridVirtualizer
columns={fields}
/>
</div>
</GridProvider>
);
}
export default Grid;