Persist table cell values on cell close (#655)

* Persist table cell values on cell close

* Apply to all cells
This commit is contained in:
Charles Bochet
2023-07-13 21:20:08 -07:00
committed by GitHub
parent ca1723f2e6
commit 551c3b5e60
20 changed files with 260 additions and 133 deletions

View File

@ -15,6 +15,8 @@ type OwnProps = {
| null
| undefined;
onChange: (firstName: string, lastName: string) => void;
onSubmit?: () => void;
onCancel?: () => void;
};
const NoEditModeContainer = styled.div`
@ -28,7 +30,12 @@ const RightContainer = styled.div`
margin-left: ${(props) => props.theme.spacing(1)};
`;
export function EditablePeopleFullName({ person, onChange }: OwnProps) {
export function EditablePeopleFullName({
person,
onChange,
onSubmit,
onCancel,
}: OwnProps) {
const openCommentRightDrawer = useOpenTimelineRightDrawer();
function handleDoubleTextChange(
@ -61,6 +68,8 @@ export function EditablePeopleFullName({ person, onChange }: OwnProps) {
firstValuePlaceholder="First name"
secondValuePlaceholder="Last name"
onChange={handleDoubleTextChange}
onSubmit={onSubmit}
onCancel={onCancel}
nonEditModeContent={
<NoEditModeContainer>
<PersonChip

View File

@ -72,7 +72,7 @@ export function PeopleCompanyCreateCell({ people }: OwnProps) {
secondValuePlaceholder="Name"
onChange={handleDoubleTextChange}
onSubmit={() => handleCompanyCreate(companyName, companyDomainName)}
onExit={() => setIsCreating(false)}
onCancel={() => setIsCreating(false)}
/>
);
}