2022-03-11 13:00:49 +00:00
|
|
|
import React from 'react';
|
2022-09-13 07:36:00 +00:00
|
|
|
import { makeStyles } from 'tss-react/mui';
|
2022-03-11 13:00:49 +00:00
|
|
|
|
2022-11-03 08:35:51 +00:00
|
|
|
interface IProps {
|
2022-03-11 13:00:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* URL of the GIF.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
url: string;
|
2022-11-03 08:35:51 +00:00
|
|
|
}
|
2022-03-11 13:00:49 +00:00
|
|
|
|
2022-09-13 07:36:00 +00:00
|
|
|
const useStyles = makeStyles()(() => {
|
2022-03-11 13:00:49 +00:00
|
|
|
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
|
2022-03-11 13:00:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2022-11-03 08:35:51 +00:00
|
|
|
const GifMessage = ({ url }: IProps) => {
|
2022-09-13 07:36:00 +00:00
|
|
|
const { classes: styles } = useStyles();
|
2022-03-11 13:00:49 +00:00
|
|
|
|
|
|
|
return (<div className = { styles.container }>
|
|
|
|
<img
|
|
|
|
alt = { url }
|
|
|
|
src = { url } />
|
|
|
|
</div>);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default GifMessage;
|