diff --git a/src/components/database/components/cell/Cell.tsx b/src/components/database/components/cell/Cell.tsx index 7c1e474e..6635bc2e 100644 --- a/src/components/database/components/cell/Cell.tsx +++ b/src/components/database/components/cell/Cell.tsx @@ -1,8 +1,8 @@ import { FC, useMemo } from 'react'; -import { Cell as CellType, CellProps } from '@/application/database-yjs/cell.type'; +import { CellProps, Cell as CellType } from '@/application/database-yjs/cell.type'; import { FieldType } from '@/application/database-yjs/database.type'; -import { useCellSelector, useFieldSelector } from '@/application/database-yjs/selector'; +import { useFieldSelector } from '@/application/database-yjs/selector'; import { YjsDatabaseKey } from '@/application/types'; import { AITextCell } from '@/components/database/components/cell/ai-text/AITextCell'; import { CheckboxCell } from '@/components/database/components/cell/checkbox'; @@ -20,7 +20,6 @@ export function Cell(props: CellProps) { const { rowId, fieldId, style, wrap, isHovering } = props; const { field } = useFieldSelector(fieldId); const fieldType = Number(field?.get(YjsDatabaseKey.type)) as FieldType; - const cell = useCellSelector({ rowId, fieldId }); const Component = useMemo(() => { switch (fieldType) { @@ -65,10 +64,6 @@ export function Cell(props: CellProps) { ); } - if (cell && cell.fieldType !== fieldType) { - return null; - } - return ; } diff --git a/src/components/database/components/cell/select-option/SelectOptionCell.tsx b/src/components/database/components/cell/select-option/SelectOptionCell.tsx index a5f36895..61bb1d73 100644 --- a/src/components/database/components/cell/select-option/SelectOptionCell.tsx +++ b/src/components/database/components/cell/select-option/SelectOptionCell.tsx @@ -1,10 +1,11 @@ +import { useCallback, useMemo } from 'react'; + import { FieldType, parseSelectOptionTypeOptions, useFieldSelector } from '@/application/database-yjs'; import { CellProps, SelectOptionCell as SelectOptionCellType } from '@/application/database-yjs/cell.type'; +import { Tag } from '@/components/_shared/tag'; import { SelectOptionColorMap, SelectOptionFgColorMap } from '@/components/database/components/cell/cell.const'; import SelectOptionCellMenu from '@/components/database/components/cell/select-option/SelectOptionCellMenu'; -import { Tag } from '@/components/_shared/tag'; import { cn } from '@/lib/utils'; -import { useCallback, useMemo } from 'react'; export function SelectOptionCell({ editing, diff --git a/src/components/database/components/grid/grid-cell/GridRowCell.tsx b/src/components/database/components/grid/grid-cell/GridRowCell.tsx index 2d079527..95cd1e61 100644 --- a/src/components/database/components/grid/grid-cell/GridRowCell.tsx +++ b/src/components/database/components/grid/grid-cell/GridRowCell.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { FieldType, useCellSelector, useFieldWrap, useReadOnly } from '@/application/database-yjs'; -import { Cell as CellType, CellProps } from '@/application/database-yjs/cell.type'; +import { CellProps, Cell as CellType } from '@/application/database-yjs/cell.type'; import { useFieldSelector } from '@/application/database-yjs/selector'; import { FieldId, YjsDatabaseKey } from '@/application/types'; import { Cell } from '@/components/database/components/cell'; @@ -71,6 +71,7 @@ export function GridRowCell({ rowId, fieldId }: GridCellProps) { const isActive = activeCell?.rowId === rowId && activeCell?.fieldId === fieldId; + const setEditing = useCallback( (status: boolean) => { if (status) { diff --git a/src/components/database/components/tabs/DatabaseTabs.tsx b/src/components/database/components/tabs/DatabaseTabs.tsx index 8b87d283..256555a7 100644 --- a/src/components/database/components/tabs/DatabaseTabs.tsx +++ b/src/components/database/components/tabs/DatabaseTabs.tsx @@ -342,7 +342,7 @@ export const DatabaseTabs = forwardRef( : ViewLayout.Grid, } } - className={'!h-5 !w-5 text-base'} + className={'!h-5 !w-5 text-base leading-[1.3rem]'} />