From 89d053e765394b6cd970958a1092d710d871a028 Mon Sep 17 00:00:00 2001 From: Nabhag8848 Date: Thu, 29 Aug 2024 15:12:04 +0530 Subject: [PATCH] fix: core ui components instead --- .../src/modules/ui/input/components/TextArea.tsx | 7 +++++-- .../developers/api-keys/SettingsDevelopersApiKeyDetail.tsx | 4 +--- .../SettingsServerlessFunctionDetail.tsx | 2 +- .../SettingsServerlessFunctionsNew.tsx | 3 +-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/twenty-front/src/modules/ui/input/components/TextArea.tsx b/packages/twenty-front/src/modules/ui/input/components/TextArea.tsx index aee5943e6e16..d58f076349ec 100644 --- a/packages/twenty-front/src/modules/ui/input/components/TextArea.tsx +++ b/packages/twenty-front/src/modules/ui/input/components/TextArea.tsx @@ -1,9 +1,10 @@ +import styled from '@emotion/styled'; import { FocusEventHandler } from 'react'; import TextareaAutosize from 'react-textarea-autosize'; -import styled from '@emotion/styled'; import { usePreviousHotkeyScope } from '@/ui/utilities/hotkey/hooks/usePreviousHotkeyScope'; +import { convertToEmptyStringForWhitespaces } from '~/utils/string/convertToEmptyStringForWhitespaces'; import { InputHotkeyScope } from '../types/InputHotkeyScope'; const MAX_ROWS = 5; @@ -75,7 +76,9 @@ export const TextArea = ({ maxRows={MAX_ROWS} minRows={computedMinRows} value={value} - onChange={(event) => onChange?.(event.target.value)} + onChange={(event) => + onChange?.(convertToEmptyStringForWhitespaces(event.target.value)) + } onFocus={handleFocus} onBlur={handleBlur} disabled={disabled} diff --git a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx index 59eae8c62080..21919f09a4f5 100644 --- a/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx +++ b/packages/twenty-front/src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx @@ -173,9 +173,7 @@ export const SettingsDevelopersApiKeyDetail = () => { apiKeyName={apiKeyName} apiKeyId={apiKeyData?.id} disabled={loading} - onNameUpdate={(value: string) => { - setApiKeyName(value); - }} + onNameUpdate={setApiKeyName} />
diff --git a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsx b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsx index a6f01e6b4bac..7df3d6619f34 100644 --- a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsx +++ b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionDetail.tsx @@ -79,7 +79,7 @@ export const SettingsServerlessFunctionDetail = () => { return async (value: string) => { setFormValues((prevState) => ({ ...prevState, - [key]: convertToEmptyStringForWhitespaces(value), + [key]: value, })); await handleSave(); }; diff --git a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionsNew.tsx b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionsNew.tsx index 7519e0384b34..92a5cb0f7387 100644 --- a/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionsNew.tsx +++ b/packages/twenty-front/src/pages/settings/serverless-functions/SettingsServerlessFunctionsNew.tsx @@ -17,7 +17,6 @@ import { Key } from 'ts-key-enum'; import { IconFunction } from 'twenty-ui'; import { useHotkeyScopeOnMount } from '~/hooks/useHotkeyScopeOnMount'; import { isDefined } from '~/utils/isDefined'; -import { convertToEmptyStringForWhitespaces } from '~/utils/string/convertToEmptyStringForWhitespaces'; export const SettingsServerlessFunctionsNew = () => { const navigate = useNavigate(); @@ -50,7 +49,7 @@ export const SettingsServerlessFunctionsNew = () => { return (value: string) => { setFormValues((prevState) => ({ ...prevState, - [key]: convertToEmptyStringForWhitespaces(value), + [key]: value, })); }; };