diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/board/Board.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/board/Board.tsx index 9e26ab0f9a..b367dfc642 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/board/Board.tsx +++ b/frontend/appflowy_tauri/src/appflowy_app/components/board/Board.tsx @@ -4,7 +4,7 @@ import { BoardBlock } from './BoardBlock'; import { NewBoardBlock } from './NewBoardBlock'; import { useDatabase } from '../_shared/database-hooks/useDatabase'; import { ViewLayoutTypePB } from '@/services/backend'; -import { DragDropContext, Droppable } from 'react-beautiful-dnd'; +import { DragDropContext } from 'react-beautiful-dnd'; export const Board = ({ viewId }: { viewId: string }) => { const { controller, rows, groups, onNewRowClick, onDragEnd } = useDatabase(viewId, ViewLayoutTypePB.Board); @@ -29,21 +29,16 @@ export const Board = ({ viewId }: { viewId: string }) => { {controller && groups && groups.map((group, index) => ( - - {(provided, snapshot) => ( - - onNewRowClick(index)} - /> - - )} - + onNewRowClick(index)} + /> ))} console.log('new block')}> diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/board/BoardBlock.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/board/BoardBlock.tsx index c1a23be4c3..d62ba15aa6 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/board/BoardBlock.tsx +++ b/frontend/appflowy_tauri/src/appflowy_app/components/board/BoardBlock.tsx @@ -4,9 +4,10 @@ import { BoardCard } from './BoardCard'; import { RowInfo } from '../../stores/effects/database/row/row_cache'; import { DatabaseController } from '../../stores/effects/database/database_controller'; import { RowPB } from '@/services/backend'; -import { Draggable } from 'react-beautiful-dnd'; +import { Droppable } from 'react-beautiful-dnd'; export const BoardBlock = ({ + groupId, viewId, controller, title, @@ -14,6 +15,7 @@ export const BoardBlock = ({ allRows, onNewRowClick, }: { + groupId: string; viewId: string; controller: DatabaseController; title: string; @@ -37,22 +39,24 @@ export const BoardBlock = ({ - - {rows.map((row_pb, index) => { - const row = allRows.find((r) => r.row.id === row_pb.id); - return row ? ( - - {(provided, snapshot) => ( - - - - )} - - ) : ( - - ); - })} - + + {(provided) => ( + + {rows.map((row_pb, index) => { + const row = allRows.find((r) => r.row.id === row_pb.id); + return row ? ( + + ) : ( + + ); + })} + + )} + console.log('on click')} - className={`relative cursor-pointer select-none rounded-lg border border-shade-6 bg-white px-3 py-2 transition-transform duration-100 hover:bg-main-selector `} - > - - - - - {cells.map((cell, index) => ( - - ))} - - + + {(provided) => ( + console.log('on click')} + className={`relative cursor-pointer select-none rounded-lg border border-shade-6 bg-white px-3 py-2 transition-transform duration-100 hover:bg-main-selector `} + > + + + + + {cells.map((cell, cellIndex) => ( + + ))} + + + )} + ); };