Feat/harmonize chips cell fields (#724)

* Wip

* Finished

* Fix lint
This commit is contained in:
Lucas Bordeau
2023-07-18 02:14:09 +02:00
committed by GitHub
parent 8b7314cd39
commit 5b21657c4e
21 changed files with 347 additions and 217 deletions

View File

@ -1,4 +1,4 @@
import React from 'react';
import { PropsWithChildren } from 'react';
import { useScopedHotkeys } from '@/ui/hotkey/hooks/useScopedHotkeys';
import { HotkeyScope } from '@/ui/hotkey/types/HotkeyScope';
@ -7,15 +7,16 @@ import { isNonTextWritingKey } from '@/ui/hotkey/utils/isNonTextWritingKey';
import { TableHotkeyScope } from '../../types/TableHotkeyScope';
import { useEditableCell } from '../hooks/useEditableCell';
import {
EditableCellNormalModeInnerContainer,
EditableCellNormalModeOuterContainer,
} from './EditableCellDisplayMode';
import { EditableCellDisplayContainer } from './EditableCellContainer';
type OwnProps = PropsWithChildren<{
editHotkeyScope?: HotkeyScope;
}>;
export function EditableCellSoftFocusMode({
children,
editHotkeyScope,
}: React.PropsWithChildren<{ editHotkeyScope?: HotkeyScope }>) {
}: OwnProps) {
const { openEditableCell } = useEditableCell();
function openEditMode() {
@ -61,13 +62,8 @@ export function EditableCellSoftFocusMode({
}
return (
<EditableCellNormalModeOuterContainer
onClick={handleClick}
softFocus={true}
>
<EditableCellNormalModeInnerContainer>
{children}
</EditableCellNormalModeInnerContainer>
</EditableCellNormalModeOuterContainer>
<EditableCellDisplayContainer onClick={handleClick} softFocus>
{children}
</EditableCellDisplayContainer>
);
}