Skip to content

Commit

Permalink
feat: add clear chat prop
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Apr 28, 2022
1 parent e1185b4 commit 090b508
Show file tree
Hide file tree
Showing 3 changed files with 382 additions and 251 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "AGPL-3.0-only",
"dependencies": {
"@graasp/chatbox": "github:graasp/graasp-chatbox.git",
"@graasp/query-client": "github:graasp/graasp-query-client.git#151/validationHooks",
"@graasp/query-client": "github:graasp/graasp-query-client.git",
"@graasp/translations": "github:graasp/graasp-translations.git",
"@graasp/ui": "github:graasp/graasp-ui.git",
"@graasp/utils": "github:graasp/graasp-utils.git",
Expand Down
2 changes: 2 additions & 0 deletions src/components/common/Chatbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Chatbox = ({ item }) => {
const { mutate: deleteMessage } = useMutation(
MUTATION_KEYS.DELETE_ITEM_CHAT_MESSAGE,
);
const { mutate: clearChat } = useMutation(MUTATION_KEYS.CLEAR_ITEM_CHAT);
const [windowHeight, setWindowHeight] = useState(window.innerHeight);

useEffect(
Expand Down Expand Up @@ -76,6 +77,7 @@ const Chatbox = ({ item }) => {
sendMessageFunction={sendMessage}
deleteMessageFunction={deleteMessage}
editMessageFunction={editMessage}
clearChatFunction={clearChat}
useAvatarHook={useAvatar}
/>
);
Expand Down
Loading

0 comments on commit 090b508

Please sign in to comment.