mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat/add row functionality done
This commit is contained in:
parent
764ec73e94
commit
db1184ff0d
@ -38,7 +38,7 @@ export const Grid = ({ viewId }: { viewId: string }) => {
|
||||
<GridTableRows onOpenRow={onOpenRow} allRows={rows} viewId={viewId} controller={controller} />
|
||||
</table>
|
||||
|
||||
<GridAddRow />
|
||||
<GridAddRow controller={controller} />
|
||||
</div>
|
||||
|
||||
<GridTableCount />
|
||||
|
@ -1,7 +1,8 @@
|
||||
export const useGridAddRow = () => {
|
||||
function addRow() {
|
||||
// create a new row
|
||||
console.log('create a new row');
|
||||
import { DatabaseController } from '@/appflowy_app/stores/effects/database/database_controller';
|
||||
|
||||
export const useGridAddRow = (controller: DatabaseController) => {
|
||||
async function addRow() {
|
||||
await controller.createRow();
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { DatabaseController } from '@/appflowy_app/stores/effects/database/database_controller';
|
||||
import AddSvg from '../../_shared/svg/AddSvg';
|
||||
import { useGridAddRow } from './GridAddRow.hooks';
|
||||
export const GridAddRow = () => {
|
||||
const { addRow } = useGridAddRow();
|
||||
export const GridAddRow = ({ controller }: { controller: DatabaseController }) => {
|
||||
const { addRow } = useGridAddRow(controller);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
Loading…
Reference in New Issue
Block a user