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.js 798B

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