Skip to content

Commit

Permalink
fix: core ui components instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabhag8848 committed Aug 29, 2024
1 parent 4478c81 commit 89d053e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ export const SettingsDevelopersApiKeyDetail = () => {
apiKeyName={apiKeyName}
apiKeyId={apiKeyData?.id}
disabled={loading}
onNameUpdate={(value: string) => {
setApiKeyName(value);
}}
onNameUpdate={setApiKeyName}
/>
</Section>
<Section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const SettingsServerlessFunctionDetail = () => {
return async (value: string) => {
setFormValues((prevState) => ({
...prevState,
[key]: convertToEmptyStringForWhitespaces(value),
[key]: value,
}));
await handleSave();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -50,7 +49,7 @@ export const SettingsServerlessFunctionsNew = () => {
return (value: string) => {
setFormValues((prevState) => ({
...prevState,
[key]: convertToEmptyStringForWhitespaces(value),
[key]: value,
}));
};
};
Expand Down

0 comments on commit 89d053e

Please sign in to comment.