feat: updated message highlight durations

pull/3083/head
William Grant 12 months ago
parent 6477d73c7b
commit e6a26945d5

@ -1,6 +1,7 @@
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { MouseEvent, ReactNode } from 'react'; import { MouseEvent, ReactNode } from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import { THEME_GLOBALS } from '../../../../themes/globals';
const StyledMessageHighlighter = styled(motion.div)``; const StyledMessageHighlighter = styled(motion.div)``;
@ -20,7 +21,11 @@ export function MessageHighlighter(props: {
onClick={onClick} onClick={onClick}
animate={{ animate={{
opacity: highlight ? [1, 0.2, 1, 0.2, 1] : undefined, opacity: highlight ? [1, 0.2, 1, 0.2, 1] : undefined,
transition: { duration: 1, ease: 'linear', repeat: 0 }, transition: {
duration: THEME_GLOBALS['--duration-message-highlight-seconds'],
ease: 'linear',
repeat: 0,
},
}} }}
> >
{children} {children}

@ -33,9 +33,7 @@ type Props = {
}; };
const highlightedMessageAnimation = keyframes` const highlightedMessageAnimation = keyframes`
1% { 1% { background-color: var(--primary-color); }
background-color: var(--primary-color);
}
`; `;
const StyledReadableMessage = styled.div<{ const StyledReadableMessage = styled.div<{
@ -50,7 +48,7 @@ const StyledReadableMessage = styled.div<{
padding: ${props => (props.isDetailView ? '0' : 'var(--margins-xs) var(--margins-lg) 0')}; padding: ${props => (props.isDetailView ? '0' : 'var(--margins-xs) var(--margins-lg) 0')};
&.message-highlighted { &.message-highlighted {
animation: ${highlightedMessageAnimation} 1s ease-in-out; animation: ${highlightedMessageAnimation} var(--duration-message-highlight) ease-in-out;
} }
${StyledMessageReactionsContainer} { ${StyledMessageReactionsContainer} {

Loading…
Cancel
Save