jiti-meet/react/features/chat/components/web/GifMessage.tsx

41 lines
801 B
TypeScript
Raw Normal View History

import React from 'react';
2022-09-13 07:36:00 +00:00
import { makeStyles } from 'tss-react/mui';
interface IProps {
/**
* URL of the GIF.
*/
url: string;
}
2022-09-13 07:36:00 +00:00
const useStyles = makeStyles()(() => {
return {
container: {
display: 'flex',
justifyContent: 'center',
overflow: 'hidden',
maxHeight: '150px',
'& img': {
maxWidth: '100%',
maxHeight: '100%',
objectFit: 'contain',
2022-09-13 07:36:00 +00:00
flexGrow: 1
}
}
};
});
const GifMessage = ({ url }: IProps) => {
2022-09-13 07:36:00 +00:00
const { classes: styles } = useStyles();
return (<div className = { styles.container }>
<img
alt = { url }
src = { url } />
</div>);
};
export default GifMessage;