* Removed view field duplicate types * wip * wip 2 * wip 3 * Unified state for fields * Renaming * Wip * Post merge * Post post merge * wip * Delete unused file * Boolean and Probability * Finished InlineCell * Renamed EditableCell to TableCell * Finished double texts * Finished MoneyField * Fixed bug inline cell click outside * Fixed hotkey scope * Final fixes * Phone * Fix url and number input validation * Fix * Fix position * wip refactor activity editor * Fixed activity editor --------- Co-authored-by: Charles Bochet <charles@twenty.com>
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { InlineCell } from '@/ui/editable-field/components/InlineCell';
|
|
import { EditableFieldHotkeyScope } from '@/ui/editable-field/types/EditableFieldHotkeyScope';
|
|
import { FieldContext } from '@/ui/field/contexts/FieldContext';
|
|
import { FieldDefinition } from '@/ui/field/types/FieldDefinition';
|
|
import { FieldDateMetadata } from '@/ui/field/types/FieldMetadata';
|
|
import { IconCalendar } from '@/ui/icon/index';
|
|
import { RecoilScope } from '@/ui/utilities/recoil-scope/components/RecoilScope';
|
|
import { useUpdateActivityMutation } from '~/generated/graphql';
|
|
|
|
type OwnProps = {
|
|
activityId: string;
|
|
};
|
|
|
|
export const ActivityEditorDateField = ({ activityId }: OwnProps) => {
|
|
return (
|
|
<RecoilScope>
|
|
<FieldContext.Provider
|
|
value={{
|
|
entityId: activityId,
|
|
recoilScopeId: 'activityDueAt',
|
|
fieldDefinition: {
|
|
key: 'activityDueAt',
|
|
name: 'Due date',
|
|
Icon: IconCalendar,
|
|
type: 'date',
|
|
metadata: {
|
|
fieldName: 'dueAt',
|
|
},
|
|
} satisfies FieldDefinition<FieldDateMetadata>,
|
|
useUpdateEntityMutation: useUpdateActivityMutation,
|
|
hotkeyScope: EditableFieldHotkeyScope.EditableField,
|
|
}}
|
|
>
|
|
<InlineCell />
|
|
</FieldContext.Provider>
|
|
</RecoilScope>
|
|
);
|
|
};
|