Files
twenty/front/src/modules/people/components/EditablePeopleFullName.tsx
Félix Malfait 5c376cbabb Add profile pictures to people and fix account/workspace deletion (#984)
* Fix LinkedIn URL not redirecting to the right url

* add avatars for people and seeds

* Fix delete account/workspace

* Add people picture on other pages

* Change style of delete button

* Revert modal to previous size

* Fix tests
2023-07-28 15:40:03 -07:00

59 lines
1.3 KiB
TypeScript

import styled from '@emotion/styled';
import { EditableCellDoubleText } from '@/ui/table/editable-cell/types/EditableCellDoubleText';
import { Person } from '~/generated/graphql';
import { PersonChip } from './PersonChip';
type OwnProps = {
person:
| Partial<
Pick<
Person,
| 'id'
| 'firstName'
| 'lastName'
| 'displayName'
| 'avatarUrl'
| '_activityCount'
>
>
| null
| undefined;
onSubmit?: (firstName: string, lastName: string) => void;
onCancel?: () => void;
};
const NoEditModeContainer = styled.div`
align-items: center;
display: flex;
justify-content: space-between;
width: 100%;
`;
export function EditablePeopleFullName({
person,
onSubmit,
onCancel,
}: OwnProps) {
return (
<EditableCellDoubleText
firstValue={person?.firstName ?? ''}
secondValue={person?.lastName ?? ''}
firstValuePlaceholder="First name"
secondValuePlaceholder="Last name"
onSubmit={onSubmit}
onCancel={onCancel}
nonEditModeContent={
<NoEditModeContainer>
<PersonChip
name={`${person?.firstName ?? ''} ${person?.lastName ?? ''}`}
id={person?.id ?? ''}
pictureUrl={person?.avatarUrl ?? ''}
/>
</NoEditModeContainer>
}
/>
);
}