Files
twenty/packages/twenty-front/src/modules/activities/emails/components/EmailThreadMessageBody.tsx
Thomas Trompette c6c50180b7 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>
2024-02-02 14:37:46 +01:00

31 lines
805 B
TypeScript

import React from 'react';
import styled from '@emotion/styled';
import { motion } from 'framer-motion';
import { AnimatedEaseInOut } from '@/ui/utilities/animation/components/AnimatedEaseInOut';
const StyledThreadMessageBody = styled(motion.div)`
color: ${({ theme }) => theme.font.color.primary};
display: flex;
flex-direction: column;
margin-top: ${({ theme }) => theme.spacing(4)};
white-space: pre-line;
overflow-wrap: break-word;
`;
type EmailThreadMessageBodyProps = {
body: string;
isDisplayed: boolean;
};
export const EmailThreadMessageBody = ({
body,
isDisplayed,
}: EmailThreadMessageBodyProps) => {
return (
<AnimatedEaseInOut isOpen={isDisplayed} duration="fast">
<StyledThreadMessageBody>{body}</StyledThreadMessageBody>
</AnimatedEaseInOut>
);
};