improvement: fixed styles when replying messages

This commit is contained in:
canove
2020-10-29 11:49:09 -03:00
parent f68d52ae45
commit 957e5182eb
2 changed files with 37 additions and 35 deletions

View File

@@ -123,7 +123,7 @@ const useStyles = makeStyles(theme => ({
paddingRight: 7, paddingRight: 7,
}, },
quotedContainerRight: { quotedContainer: {
flex: 1, flex: 1,
marginRight: 5, marginRight: 5,
overflowY: "hidden", overflowY: "hidden",
@@ -133,41 +133,31 @@ const useStyles = makeStyles(theme => ({
position: "relative", position: "relative",
}, },
quotedMsgRight: { quotedMsgBody: {
padding: 10, padding: 10,
maxWidth: 300,
height: "auto",
whiteSpace: "pre-wrap",
},
quotedSideRight: {
flex: "none",
width: "4px",
backgroundColor: "#35cd96",
},
quotedContainerLeft: {
overflow: "hidden",
backgroundColor: "rgba(0, 0, 0, 0.05)",
borderRadius: "7.5px",
display: "flex",
position: "relative",
},
quotedMsg: {
padding: 10,
maxWidth: 300,
height: "auto", height: "auto",
display: "block", display: "block",
whiteSpace: "pre-wrap", whiteSpace: "pre-wrap",
overflow: "hidden", overflow: "hidden",
}, },
quotedSideLeft: { quotedSideOther: {
flex: "none",
width: "4px",
backgroundColor: "#35cd96",
},
quotedSideMine: {
flex: "none", flex: "none",
width: "4px", width: "4px",
backgroundColor: "#6bcbef", backgroundColor: "#6bcbef",
}, },
messageContactName: {
display: "flex",
color: "#6bcbef",
fontWeight: 500,
},
})); }));
const MessageInput = ({ ticketStatus }) => { const MessageInput = ({ ticketStatus }) => {
@@ -335,17 +325,13 @@ const MessageInput = ({ ticketStatus }) => {
const renderQuotedMessage = message => { const renderQuotedMessage = message => {
return ( return (
<div className={classes.quotedMsgWrapper}> <div className={classes.quotedMsgWrapper}>
<div <div className={classes.quotedContainer}>
className={clsx(classes.quotedContainerLeft, {
[classes.quotedContainerRight]: message.fromMe,
})}
>
<span <span
className={clsx(classes.quotedSideLeft, { className={clsx(classes.quotedSideOther, {
[classes.quotedSideRight]: message.quotedMsg?.fromMe, [classes.quotedSideMine]: !message.fromMe,
})} })}
></span> ></span>
<div className={classes.quotedMsg}> <div className={classes.quotedMsgBody}>
{!message.fromMe && ( {!message.fromMe && (
<span className={classes.messageContactName}> <span className={classes.messageContactName}>
{message.contact?.name} {message.contact?.name}

View File

@@ -66,6 +66,12 @@ const useStyles = makeStyles(theme => ({
height: "auto", height: "auto",
display: "block", display: "block",
position: "relative", position: "relative",
"&:hover #messageActionsButton": {
display: "flex",
position: "absolute",
top: 0,
right: 0,
},
whiteSpace: "pre-wrap", whiteSpace: "pre-wrap",
backgroundColor: "#ffffff", backgroundColor: "#ffffff",
@@ -163,8 +169,8 @@ const useStyles = makeStyles(theme => ({
position: "relative", position: "relative",
color: "#999", color: "#999",
zIndex: 1, zIndex: 1,
backgroundColor: "#dcf8c6", backgroundColor: "inherit",
"&:hover, &.Mui-focusVisible": { backgroundColor: "#dcf8c6" }, "&:hover, &.Mui-focusVisible": { backgroundColor: "inherit" },
}, },
messageContactName: { messageContactName: {
@@ -553,6 +559,16 @@ const MessagesList = ({ ticketId, isGroup, setReplyingMessage }) => {
{renderDailyTimestamps(message, index)} {renderDailyTimestamps(message, index)}
{renderMessageDivider(message, index)} {renderMessageDivider(message, index)}
<div className={classes.messageLeft}> <div className={classes.messageLeft}>
<IconButton
variant="contained"
size="small"
id="messageActionsButton"
disabled={message.isDeleted}
className={classes.messageActionsButton}
onClick={e => handleOpenMessageOptionsMenu(e, message)}
>
<ExpandMore />
</IconButton>
{isGroup && ( {isGroup && (
<span className={classes.messageContactName}> <span className={classes.messageContactName}>
{message.contact?.name} {message.contact?.name}