Skip to content

Commit 4740c31

Browse files
anaisbergSimonClo
authored andcommitted
♻️ extract default col def
1 parent 56c08dd commit 4740c31

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-blocks/DatabaseBlock/DatabaseGrid.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
ADD_NEW_ROW,
1717
addRowCellRenderer,
1818
createNewRow,
19+
defaultColDef,
1920
getColumnNames,
2021
newRowColSpan,
2122
} from './utils';
@@ -86,14 +87,6 @@ export const DatabaseGrid = ({
8687
// eslint-disable-next-line react-hooks/exhaustive-deps
8788
}, [colDefs]);
8889

89-
const defaultColDef = {
90-
flex: 1,
91-
filter: true,
92-
editable: true,
93-
unSortIcon: true,
94-
minWidth: 200,
95-
};
96-
9790
const addColumn = (columnName: string) => {
9891
const columnNames = getColumnNames(colDefs);
9992
const newColDef: ColDef = {

src/frontend/apps/impress/src/features/docs/doc-editor/components/custom-blocks/DatabaseBlock/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ export const autoSizeStrategy: SizeColumnsToContentStrategy = {
1515
type: 'fitCellContents',
1616
};
1717

18+
export const defaultColDef = {
19+
flex: 1,
20+
filter: true,
21+
editable: true,
22+
unSortIcon: true,
23+
minWidth: 200,
24+
};
25+
1826
export const createNewRow = ({
1927
columnNames,
2028
value = undefined,

0 commit comments

Comments
 (0)