You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

GifMessage.tsx 801B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React from 'react';
  2. import { makeStyles } from 'tss-react/mui';
  3. interface IProps {
  4. /**
  5. * URL of the GIF.
  6. */
  7. url: string;
  8. }
  9. const useStyles = makeStyles()(() => {
  10. return {
  11. container: {
  12. display: 'flex',
  13. justifyContent: 'center',
  14. overflow: 'hidden',
  15. maxHeight: '150px',
  16. '& img': {
  17. maxWidth: '100%',
  18. maxHeight: '100%',
  19. objectFit: 'contain',
  20. flexGrow: 1
  21. }
  22. }
  23. };
  24. });
  25. const GifMessage = ({ url }: IProps) => {
  26. const { classes: styles } = useStyles();
  27. return (<div className = { styles.container }>
  28. <img
  29. alt = { url }
  30. src = { url } />
  31. </div>);
  32. };
  33. export default GifMessage;