From 994e2040971b0745fca7ba292c36f7d0d75fe50a Mon Sep 17 00:00:00 2001 From: ascarbek Date: Mon, 27 Mar 2023 01:09:38 +0600 Subject: [PATCH] fix: padding fixes for cell wrapper --- .../components/_shared/EditRow/CellOptions.tsx | 6 +++++- .../_shared/EditRow/CellOptionsPopup.tsx | 7 +++++++ .../components/_shared/EditRow/EditCellDate.tsx | 6 +++++- .../components/_shared/EditRow/EditCellText.tsx | 16 +++++++++------- .../_shared/EditRow/EditCellWrapper.tsx | 4 ++-- .../components/_shared/EditRow/EditRow.tsx | 2 ++ 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/CellOptions.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/CellOptions.tsx index 2413afb6ee..9aa2f9d38c 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/CellOptions.tsx +++ b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/CellOptions.tsx @@ -18,7 +18,11 @@ export const CellOptions = ({ }; return ( -
onClick()} className={'flex flex-wrap items-center gap-2 text-xs text-black'}> +
onClick()} + className={'flex flex-wrap items-center gap-2 px-4 py-2 text-xs text-black'} + > {data?.select_options.map((option, index) => (
{option?.name || ''} diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/CellOptionsPopup.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/CellOptionsPopup.tsx index 9b7a8bc16d..a69cc0ec29 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/CellOptionsPopup.tsx +++ b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/CellOptionsPopup.tsx @@ -9,6 +9,7 @@ import { useTranslation } from 'react-i18next'; import { Details2Svg } from '$app/components/_shared/svg/Details2Svg'; import { CheckmarkSvg } from '$app/components/_shared/svg/CheckmarkSvg'; import { CloseSvg } from '$app/components/_shared/svg/CloseSvg'; +import useOutsideClick from '$app/components/_shared/useOutsideClick'; export const CellOptionsPopup = ({ top, @@ -16,12 +17,14 @@ export const CellOptionsPopup = ({ cellIdentifier, cellCache, fieldController, + onOutsideClick, }: { top: number; left: number; cellIdentifier: CellIdentifier; cellCache: CellCache; fieldController: FieldController; + onOutsideClick: () => void; }) => { const ref = useRef(null); const { t } = useTranslation(''); @@ -39,6 +42,10 @@ export const CellOptionsPopup = ({ } }, [ref, window, top, left]); + useOutsideClick(ref, async () => { + onOutsideClick(); + }); + return (
; + return ( +
+ ; +
+ ); }; diff --git a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditCellText.tsx b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditCellText.tsx index bc36f35ecf..357fbac9d7 100644 --- a/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditCellText.tsx +++ b/frontend/appflowy_tauri/src/appflowy_app/components/_shared/EditRow/EditCellText.tsx @@ -21,12 +21,14 @@ export const EditCellText = ({ data, cellController }: { data: string; cellContr }; return ( -