mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-25 21:13:01 +03:00
Fix message opening (#3687)
* fix * improve styling so we can close the message by clicking on the whole header * fix line overflowing * fix
This commit is contained in:
parent
fc63c51d6d
commit
a012ba1087
@ -11,7 +11,7 @@ const StyledThreadMessage = styled.div`
|
||||
border-bottom: 1px solid ${({ theme }) => theme.border.color.light};
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: ${({ theme }) => theme.spacing(4, 6)};
|
||||
padding: ${({ theme }) => theme.spacing(4, 0)};
|
||||
`;
|
||||
|
||||
const StyledThreadMessageHeader = styled.div`
|
||||
@ -20,6 +20,11 @@ const StyledThreadMessageHeader = styled.div`
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-bottom: ${({ theme }) => theme.spacing(2)};
|
||||
padding: ${({ theme }) => theme.spacing(0, 6)};
|
||||
`;
|
||||
|
||||
const StyledThreadMessageBody = styled.div`
|
||||
padding: ${({ theme }) => theme.spacing(0, 6)};
|
||||
`;
|
||||
|
||||
type EmailThreadMessageProps = {
|
||||
@ -45,16 +50,21 @@ export const EmailThreadMessage = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<StyledThreadMessage>
|
||||
<StyledThreadMessageHeader onClick={() => setIsOpen(!isOpen)}>
|
||||
<StyledThreadMessage
|
||||
onClick={() => !isOpen && setIsOpen(true)}
|
||||
style={{ cursor: isOpen ? 'auto' : 'pointer' }}
|
||||
>
|
||||
<StyledThreadMessageHeader onClick={() => isOpen && setIsOpen(false)}>
|
||||
<EmailThreadMessageSender sender={from} sentAt={sentAt} />
|
||||
{isOpen && <EmailThreadMessageReceivers receivers={receivers} />}
|
||||
</StyledThreadMessageHeader>
|
||||
{isOpen ? (
|
||||
<EmailThreadMessageBody body={body} />
|
||||
) : (
|
||||
<EmailThreadMessageBodyPreview body={body} />
|
||||
)}
|
||||
<StyledThreadMessageBody>
|
||||
{isOpen ? (
|
||||
<EmailThreadMessageBody body={body} />
|
||||
) : (
|
||||
<EmailThreadMessageBodyPreview body={body} />
|
||||
)}
|
||||
</StyledThreadMessageBody>
|
||||
</StyledThreadMessage>
|
||||
);
|
||||
};
|
||||
|
@ -7,6 +7,7 @@ const StyledThreadMessageBody = styled.div`
|
||||
flex-direction: column;
|
||||
margin-top: ${({ theme }) => theme.spacing(4)};
|
||||
white-space: pre-line;
|
||||
overflow-wrap: break-word;
|
||||
`;
|
||||
|
||||
type EmailThreadMessageBodyProps = {
|
||||
|
Loading…
Reference in New Issue
Block a user