diff --git a/example/src/components/ChatboxTest.tsx b/example/src/components/ChatboxTest.tsx index 94384aa5..55f1cdf4 100644 --- a/example/src/components/ChatboxTest.tsx +++ b/example/src/components/ChatboxTest.tsx @@ -18,7 +18,7 @@ import { MUTATION_KEYS } from '@graasp/query-client'; import { ChatMention } from '@graasp/sdk'; import buildI18n, { namespaces } from '@graasp/translations'; -import { MentionButton } from '../../../src'; +import { MentionButton } from '@graasp/chatbox'; import { DEFAULT_CHAT_ID, DEFAULT_LANG, diff --git a/package.json b/package.json index b48f89c8..22c6fd97 100644 --- a/package.json +++ b/package.json @@ -57,9 +57,9 @@ "dependencies": { "@emotion/react": "11.10.6", "@emotion/styled": "11.10.6", - "@graasp/sdk": "0.5.0", - "@graasp/translations": "1.6.0", - "@graasp/ui": "0.13.0", + "@graasp/sdk": "0.9.2", + "@graasp/translations": "1.8.0", + "@graasp/ui": "2.2.0", "clsx": "1.2.1", "i18next": "21.8.1", "immutable": "4.2.4", diff --git a/src/components/Chatbox/InputBar.tsx b/src/components/Chatbox/InputBar.tsx index a8c08de7..a6814f03 100644 --- a/src/components/Chatbox/InputBar.tsx +++ b/src/components/Chatbox/InputBar.tsx @@ -1,11 +1,10 @@ -import { EditMessageFunctionType, SendMessageFunctionType } from '@/types'; - import { FC, useEffect, useRef, useState } from 'react'; import { MessageBodyType } from '@graasp/sdk'; import { useEditingContext } from '../../context/EditingContext'; import { useMessagesContext } from '../../context/MessagesContext'; +import { EditMessageFunctionType, SendMessageFunctionType } from '../../types'; import FullWidthWrapper from '../common/FullWidthWrapper'; import EditBanner from './EditBanner'; import Input from './Input'; diff --git a/src/components/Mentions/MentionButton.tsx b/src/components/Mentions/MentionButton.tsx index 99f77dcc..5d82783b 100644 --- a/src/components/Mentions/MentionButton.tsx +++ b/src/components/Mentions/MentionButton.tsx @@ -5,7 +5,7 @@ import { I18nextProvider } from 'react-i18next'; import { UseQueryResult } from 'react-query'; import { Notifications } from '@mui/icons-material'; -import { Badge, IconButton, styled } from '@mui/material'; +import { Badge, BadgeProps, IconButton } from '@mui/material'; import { MentionStatus } from '@graasp/sdk'; import { MemberMentionsRecord, MemberRecord } from '@graasp/sdk/frontend'; @@ -17,6 +17,7 @@ import MentionsTable from './MentionsTable'; type Props = { color?: 'primary' | 'secondary'; + badgeColor?: BadgeProps['color']; lang?: string; useMentions: ( options?: { getUpdates?: boolean | undefined } | undefined, @@ -29,6 +30,7 @@ type Props = { const MentionButton: FC = ({ color = 'primary', + badgeColor = 'warning', lang = langs.en, useMentions, useMembers, @@ -36,15 +38,6 @@ const MentionButton: FC = ({ deleteMentionFunction, clearAllMentionsFunction, }) => { - const StyledBadge = styled(Badge)(({ theme }) => ({ - '& .MuiBadge-badge': { - border: `2px solid ${ - color === 'primary' - ? theme.palette.background.paper - : theme.palette.primary.main - }`, - }, - })); const i18n = useMemo(() => { const i18nInstance = buildI18n(namespaces.chatbox); i18nInstance.changeLanguage(lang); @@ -78,16 +71,16 @@ const MentionButton: FC = ({ data-cy={mentionButtonCypress} onClick={(): void => setOpen(true)} > - m.status === MentionStatus.UNREAD) ?.size || 0 } > - +