Lucas/t 366 on comment drawer when i have comments on the selected (#201)

* Fixed right drawer width and shared in theme

* Added date packages and tooltip

* Added date utils and tests

* Added comment thread components

* Fixed comment chip

* Fix from rebase

* Fix from rebase

* Fix margin right

* Fixed CSS and graphql
This commit is contained in:
Lucas Bordeau
2023-06-07 12:48:44 +02:00
committed by GitHub
parent b1bf050936
commit 5e2673a2a4
30 changed files with 688 additions and 77 deletions

View File

@ -1,9 +1,9 @@
import { CellCommentChip } from '@/comments/components/comments/CellCommentChip';
import { useOpenCommentRightDrawer } from '@/comments/hooks/useOpenCommentRightDrawer';
import { useCompanyCommentsCountQuery } from '@/comments/services';
import EditableChip from '@/ui/components/editable-cell/types/EditableChip';
import { getLogoUrlFromDomainName } from '@/utils/utils';
import { CellCommentChip } from '../../comments/components/comments/CellCommentChip';
import { useCompanyCommentsCountQuery } from '../../comments/services';
import { Company } from '../interfaces/company.interface';
import { updateCompany } from '../services';
@ -16,7 +16,10 @@ type OwnProps = {
export function CompanyEditableNameChipCell({ company }: OwnProps) {
const openCommentRightDrawer = useOpenCommentRightDrawer();
function handleCommentClick() {
function handleCommentClick(event: React.MouseEvent<HTMLDivElement>) {
event.preventDefault();
event.stopPropagation();
openCommentRightDrawer([
{
type: 'Company',
@ -27,6 +30,8 @@ export function CompanyEditableNameChipCell({ company }: OwnProps) {
const commentCount = useCompanyCommentsCountQuery(company.id);
const displayCommentCount = !commentCount.loading;
return (
<EditableChip
value={company.name || ''}
@ -40,9 +45,9 @@ export function CompanyEditableNameChipCell({ company }: OwnProps) {
}}
ChipComponent={CompanyChip}
rightEndContents={[
commentCount.loading ? null : (
displayCommentCount && (
<CellCommentChip
count={commentCount.data || 0}
count={commentCount.data ?? 0}
onClick={handleCommentClick}
/>
),