Files
bodyshop/client/src/components/chat-open-button/chat-open-button.component.jsx
2020-09-03 09:18:53 -07:00

20 lines
633 B
JavaScript

import { MessageFilled } from "@ant-design/icons";
import React from "react";
import { connect } from "react-redux";
import { openChatByPhone } from "../../redux/messaging/messaging.actions";
const mapDispatchToProps = (dispatch) => ({
openChatByPhone: (phone) => dispatch(openChatByPhone(phone)),
});
export function ChatOpenButton({ phone, jobid, openChatByPhone }) {
return (
<MessageFilled
style={{ margin: 4 }}
onClick={(e) => {
e.stopPropagation();
openChatByPhone({ phone_num: phone, jobid: jobid });
}}
/>
);
}
export default connect(null, mapDispatchToProps)(ChatOpenButton);