Design fixes (#696)
* Design fixes * Fix design * unused code * Fix tests
This commit is contained in:
@ -27,6 +27,7 @@ export function CompanyAccountOwnerCell({ company }: OwnProps) {
|
||||
|
||||
return (
|
||||
<EditableCell
|
||||
transparent
|
||||
editHotkeyScope={{ scope: RelationPickerHotkeyScope.RelationPicker }}
|
||||
editModeContent={
|
||||
<CompanyAccountOwnerPicker
|
||||
|
||||
@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user