mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat/integrate single select options to grid
This commit is contained in:
parent
e38398e235
commit
6977e5e65c
@ -1,4 +1,4 @@
|
||||
import { useState, useEffect, useRef } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { CellOptions } from '../../_shared/EditRow/CellOptions';
|
||||
import { CellIdentifier } from '@/appflowy_app/stores/effects/database/cell/cell_bd_svc';
|
||||
import { CellCache } from '@/appflowy_app/stores/effects/database/cell/cell_cache';
|
||||
@ -16,11 +16,8 @@ export default function GridSingleSelectOptions({
|
||||
cellCache: CellCache;
|
||||
fieldController: FieldController;
|
||||
}) {
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const { data } = useCell(cellIdentifier, cellCache, fieldController);
|
||||
|
||||
const { data, cellController } = useCell(cellIdentifier, cellCache, fieldController);
|
||||
|
||||
const [value, setValue] = useState((data as SelectOptionCellDataPB) || '');
|
||||
const [showOptionsPopup, setShowOptionsPopup] = useState(false);
|
||||
const [changeOptionsTop, setChangeOptionsTop] = useState(0);
|
||||
const [changeOptionsLeft, setChangeOptionsLeft] = useState(0);
|
||||
@ -31,9 +28,6 @@ export default function GridSingleSelectOptions({
|
||||
setShowOptionsPopup(true);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (data) setValue(data as SelectOptionCellDataPB);
|
||||
}, [data]);
|
||||
return (
|
||||
<>
|
||||
<div className='flex w-full cursor-pointer justify-start'>
|
||||
|
Loading…
Reference in New Issue
Block a user