Design fixes (#696)

* Design fixes

* Fix design

* unused code

* Fix tests
This commit is contained in:
Charles Bochet
2023-07-16 17:36:40 -07:00
committed by GitHub
parent 6ced8434bd
commit 4cb856a180
42 changed files with 177 additions and 339 deletions

View File

@ -1,9 +1,7 @@
import styled from '@emotion/styled';
import { useOpenTimelineRightDrawer } from '@/activities/hooks/useOpenTimelineRightDrawer';
import { CellCommentChip } from '@/activities/table/components/CellCommentChip';
import { EditableCellDoubleText } from '@/ui/table/editable-cell/types/EditableCellDoubleText';
import { CommentableType, Person } from '~/generated/graphql';
import { Person } from '~/generated/graphql';
import { PersonChip } from './PersonChip';
@ -26,18 +24,12 @@ const NoEditModeContainer = styled.div`
width: 100%;
`;
const RightContainer = styled.div`
margin-left: ${(props) => props.theme.spacing(1)};
`;
export function EditablePeopleFullName({
person,
onChange,
onSubmit,
onCancel,
}: OwnProps) {
const openCommentRightDrawer = useOpenTimelineRightDrawer();
function handleDoubleTextChange(
firstValue: string,
secondValue: string,
@ -45,22 +37,6 @@ export function EditablePeopleFullName({
onChange(firstValue, secondValue);
}
function handleCommentClick(event: React.MouseEvent<HTMLDivElement>) {
event.preventDefault();
event.stopPropagation();
if (!person) {
return;
}
openCommentRightDrawer([
{
type: CommentableType.Person,
id: person.id ?? '',
},
]);
}
return (
<EditableCellDoubleText
firstValue={person?.firstName ?? ''}
@ -76,12 +52,6 @@ export function EditablePeopleFullName({
name={person?.firstName + ' ' + person?.lastName}
id={person?.id ?? ''}
/>
<RightContainer>
<CellCommentChip
count={person?._commentThreadCount ?? 0}
onClick={handleCommentClick}
/>
</RightContainer>
</NoEditModeContainer>
}
/>

View File

@ -24,6 +24,7 @@ export function PeopleCompanyCell({ people }: OwnProps) {
return (
<EditableCell
transparent
editHotkeyScope={{ scope: RelationPickerHotkeyScope.RelationPicker }}
editModeContent={
isCreating ? (