feature/IO-3000-messaging-sockets-migration2 - Handle some of the PR notes

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-11-25 08:36:33 -08:00
parent 49044e5669
commit cbc8665636
8 changed files with 109 additions and 45 deletions

View File

@@ -4,8 +4,17 @@ import React, { useContext, useState } from "react";
import { useTranslation } from "react-i18next";
import { TOGGLE_CONVERSATION_ARCHIVE } from "../../graphql/conversations.queries";
import SocketContext from "../../contexts/SocketIO/socketContext.jsx";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors.js";
import { connect } from "react-redux";
export default function ChatArchiveButton({ conversation, bodyshop }) {
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
});
const mapDispatchToProps = () => ({});
export function ChatArchiveButton({ conversation, bodyshop }) {
const [loading, setLoading] = useState(false);
const { t } = useTranslation();
const [updateConversation] = useMutation(TOGGLE_CONVERSATION_ARCHIVE);
@@ -36,3 +45,5 @@ export default function ChatArchiveButton({ conversation, bodyshop }) {
</Button>
);
}
export default connect(mapStateToProps, mapDispatchToProps)(ChatArchiveButton);