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

@ -27,6 +27,7 @@ export function CompanyAccountOwnerCell({ company }: OwnProps) {
return (
<EditableCell
transparent
editHotkeyScope={{ scope: RelationPickerHotkeyScope.RelationPicker }}
editModeContent={
<CompanyAccountOwnerPicker

View File

@ -1,10 +1,7 @@
import { useEffect, useState } from 'react';
import { useOpenTimelineRightDrawer } from '@/activities/hooks/useOpenTimelineRightDrawer';
import { CellCommentChip } from '@/activities/table/components/CellCommentChip';
import { EditableCellChip } from '@/ui/table/editable-cell/types/EditableChip';
import {
CommentableType,
GetCompaniesQuery,
useUpdateCompanyMutation,
} from '~/generated/graphql';
@ -20,23 +17,10 @@ type OwnProps = {
};
export function CompanyEditableNameChipCell({ company }: OwnProps) {
const openCommentRightDrawer = useOpenTimelineRightDrawer();
const [updateCompany] = useUpdateCompanyMutation();
const [internalValue, setInternalValue] = useState(company.name ?? '');
function handleCommentClick(event: React.MouseEvent<HTMLDivElement>) {
event.preventDefault();
event.stopPropagation();
openCommentRightDrawer([
{
type: CommentableType.Company,
id: company.id,
},
]);
}
useEffect(() => {
setInternalValue(company.name ?? '');
}, [company.name]);
@ -49,12 +33,6 @@ export function CompanyEditableNameChipCell({ company }: OwnProps) {
id={company.id}
changeHandler={setInternalValue}
ChipComponent={CompanyChip}
rightEndContents={[
<CellCommentChip
count={company._commentThreadCount ?? 0}
onClick={handleCommentClick}
/>,
]}
onSubmit={() =>
updateCompany({
variables: {