From 2d707ea65d87d1dcebfb24023257493b3ec4229f Mon Sep 17 00:00:00 2001 From: Devessier Date: Mon, 16 Dec 2024 17:52:49 +0100 Subject: [PATCH] revert: go back to previous version with untouched DateInput component --- .../input/components/DateFieldInput.tsx | 32 +++++++------------ .../input/components/DateTimeFieldInput.tsx | 32 +++++++------------ 2 files changed, 22 insertions(+), 42 deletions(-) diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateFieldInput.tsx index 631c57bb18ac..74ad1528189e 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateFieldInput.tsx +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateFieldInput.tsx @@ -4,9 +4,8 @@ import { useDateField } from '@/object-record/record-field/meta-types/hooks/useD import { DateInput } from '@/ui/field/input/components/DateInput'; import { isDefined } from '~/utils/isDefined'; -import { useRef, useState } from 'react'; -import { usePersistField } from '../../../hooks/usePersistField'; import { FieldInputClickOutsideEvent } from '@/object-record/record-field/meta-types/input/components/DateTimeFieldInput'; +import { usePersistField } from '../../../hooks/usePersistField'; type FieldInputEvent = (persist: () => void) => void; @@ -68,25 +67,16 @@ export const DateFieldInput = ({ const dateValue = fieldValue ? new Date(fieldValue) : null; - const wrapperRef = useRef(null); - - const [temporaryValue, setTemporaryValue] = - useState>(dateValue); - return ( -
- -
+ ); }; diff --git a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateTimeFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateTimeFieldInput.tsx index cc5c638a5a27..15f85c61c276 100644 --- a/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateTimeFieldInput.tsx +++ b/packages/twenty-front/src/modules/object-record/record-field/meta-types/input/components/DateTimeFieldInput.tsx @@ -2,7 +2,6 @@ import { Nullable } from 'twenty-ui'; import { DateInput } from '@/ui/field/input/components/DateInput'; -import { useRef, useState } from 'react'; import { usePersistField } from '../../../hooks/usePersistField'; import { useDateTimeField } from '../../hooks/useDateTimeField'; @@ -70,26 +69,17 @@ export const DateTimeFieldInput = ({ const dateValue = fieldValue ? new Date(fieldValue) : null; - const wrapperRef = useRef(null); - - const [temporaryValue, setTemporaryValue] = - useState>(dateValue); - return ( -
- -
+ ); };