mirror of
https://github.com/lingble/twenty.git
synced 2025-10-31 20:57:55 +00:00
Add animation during email message opening (#3774)
* Add animation while message opening * Set isDisplayed as always true --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@@ -60,7 +60,7 @@ export const EmailThreadMessage = ({
|
|||||||
</StyledThreadMessageHeader>
|
</StyledThreadMessageHeader>
|
||||||
<StyledThreadMessageBody>
|
<StyledThreadMessageBody>
|
||||||
{isOpen ? (
|
{isOpen ? (
|
||||||
<EmailThreadMessageBody body={body} />
|
<EmailThreadMessageBody body={body} isDisplayed />
|
||||||
) : (
|
) : (
|
||||||
<EmailThreadMessageBodyPreview body={body} />
|
<EmailThreadMessageBodyPreview body={body} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
import { motion } from 'framer-motion';
|
||||||
|
|
||||||
const StyledThreadMessageBody = styled.div`
|
import { AnimatedEaseInOut } from '@/ui/utilities/animation/components/AnimatedEaseInOut';
|
||||||
|
|
||||||
|
const StyledThreadMessageBody = styled(motion.div)`
|
||||||
color: ${({ theme }) => theme.font.color.primary};
|
color: ${({ theme }) => theme.font.color.primary};
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -12,10 +15,16 @@ const StyledThreadMessageBody = styled.div`
|
|||||||
|
|
||||||
type EmailThreadMessageBodyProps = {
|
type EmailThreadMessageBodyProps = {
|
||||||
body: string;
|
body: string;
|
||||||
|
isDisplayed: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EmailThreadMessageBody = ({
|
export const EmailThreadMessageBody = ({
|
||||||
body,
|
body,
|
||||||
|
isDisplayed,
|
||||||
}: EmailThreadMessageBodyProps) => {
|
}: EmailThreadMessageBodyProps) => {
|
||||||
return <StyledThreadMessageBody>{body}</StyledThreadMessageBody>;
|
return (
|
||||||
|
<AnimatedEaseInOut isOpen={isDisplayed} duration="fast">
|
||||||
|
<StyledThreadMessageBody>{body}</StyledThreadMessageBody>
|
||||||
|
</AnimatedEaseInOut>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user