mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 12:19:16 +00:00
feat: add queue color to tickets list item
This commit is contained in:
@@ -87,6 +87,15 @@ const useStyles = makeStyles(theme => ({
|
||||
position: "absolute",
|
||||
left: "50%",
|
||||
},
|
||||
|
||||
ticketQueueColor: {
|
||||
flex: "none",
|
||||
width: "8px",
|
||||
height: "100%",
|
||||
position: "absolute",
|
||||
top: "0%",
|
||||
left: "0%",
|
||||
},
|
||||
}));
|
||||
|
||||
const TicketListItem = ({ ticket }) => {
|
||||
@@ -138,6 +147,10 @@ const TicketListItem = ({ ticket }) => {
|
||||
[classes.pendingTicket]: ticket.status === "pending",
|
||||
})}
|
||||
>
|
||||
<span
|
||||
style={{ backgroundColor: ticket.queue?.color }}
|
||||
className={classes.ticketQueueColor}
|
||||
></span>
|
||||
<ListItemAvatar>
|
||||
<Avatar
|
||||
src={ticket.contact.profilePicUrl && ticket.contact.profilePicUrl}
|
||||
|
||||
@@ -100,6 +100,8 @@ const reducer = (state, action) => {
|
||||
if (action.type === "UPDATE_TICKET") {
|
||||
const ticket = action.payload;
|
||||
|
||||
console.log("TICKET", ticket);
|
||||
|
||||
const ticketIndex = state.findIndex(t => t.id === ticket.id);
|
||||
if (ticketIndex !== -1) {
|
||||
state[ticketIndex] = ticket;
|
||||
|
||||
@@ -86,7 +86,7 @@ const WhatsAppModal = ({ open, onClose, whatsAppId }) => {
|
||||
|
||||
const handleSaveWhatsApp = async values => {
|
||||
const whatsappData = { ...values, queueIds: selectedQueueIds };
|
||||
console.log("SELECTED", whatsappData);
|
||||
|
||||
try {
|
||||
if (whatsAppId) {
|
||||
await api.put(`/whatsapp/${whatsAppId}`, whatsappData);
|
||||
|
||||
Reference in New Issue
Block a user