Feat/editable fields update (#743)
* Removed console log * Used current scope as default parent scope for fields * Finished editable fields on people show page * Added stories * Console log * Lint
This commit is contained in:
@ -2,7 +2,6 @@ import styled from '@emotion/styled';
|
||||
|
||||
import { CompanyAccountOwnerPicker } from '@/companies/components/CompanyAccountOwnerPicker';
|
||||
import { useEditableField } from '@/ui/editable-field/hooks/useEditableField';
|
||||
import { HotkeyScope } from '@/ui/hotkey/types/HotkeyScope';
|
||||
import { Company, User } from '~/generated/graphql';
|
||||
|
||||
const CompanyAccountOwnerPickerContainer = styled.div`
|
||||
@ -17,7 +16,6 @@ export type OwnProps = {
|
||||
};
|
||||
onSubmit?: () => void;
|
||||
onCancel?: () => void;
|
||||
parentHotkeyScope?: HotkeyScope;
|
||||
};
|
||||
|
||||
export function CompanyAccountOwnerPickerFieldEditMode({
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { EditableField } from '@/ui/editable-field/components/EditableField';
|
||||
import { EditableFieldEditModeDate } from '@/ui/editable-field/components/EditableFieldEditModeDate';
|
||||
import { FieldContext } from '@/ui/editable-field/states/FieldContext';
|
||||
import { EditableFieldEditModeDate } from '@/ui/editable-field/variants/components/EditableFieldEditModeDate';
|
||||
import { IconCalendar } from '@/ui/icon';
|
||||
import { RecoilScope } from '@/ui/recoil-scope/components/RecoilScope';
|
||||
import { Company, useUpdateCompanyMutation } from '~/generated/graphql';
|
||||
@ -56,6 +56,7 @@ export function CompanyCreatedAtEditableField({ company }: OwnProps) {
|
||||
? formatToHumanReadableDate(parseDate(internalValue).toJSDate())
|
||||
: 'No date'
|
||||
}
|
||||
isDisplayModeContentEmpty={!(internalValue !== '')}
|
||||
/>
|
||||
</RecoilScope>
|
||||
);
|
||||
|
||||
@ -56,6 +56,7 @@ export function CompanyDomainNameEditableField({ company }: OwnProps) {
|
||||
}
|
||||
displayModeContent={<FieldDisplayURL URL={internalValue} />}
|
||||
useEditButton
|
||||
isDisplayModeContentEmpty={!(internalValue !== '')}
|
||||
/>
|
||||
</RecoilScope>
|
||||
);
|
||||
|
||||
@ -70,6 +70,7 @@ export function CompanyEmployeesEditableField({ company }: OwnProps) {
|
||||
/>
|
||||
}
|
||||
displayModeContent={internalValue}
|
||||
isDisplayModeContentEmpty={!(internalValue && internalValue !== '0')}
|
||||
/>
|
||||
</RecoilScope>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user