2022-03-30 16:54:03 +03:00
|
|
|
import React from 'react';
|
2023-04-25 13:50:52 +03:00
|
|
|
import { Image, ImageStyle, View } from 'react-native';
|
2022-03-30 16:54:03 +03:00
|
|
|
|
2024-08-27 17:14:29 -05:00
|
|
|
import { extractGifURL } from '../../../gifs/function.any';
|
2022-03-30 16:54:03 +03:00
|
|
|
|
|
|
|
|
import styles from './styles';
|
|
|
|
|
|
2023-04-25 13:50:52 +03:00
|
|
|
interface IProps {
|
2022-03-30 16:54:03 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The formatted gif message.
|
|
|
|
|
*/
|
2023-04-25 13:50:52 +03:00
|
|
|
message: string;
|
2022-03-30 16:54:03 +03:00
|
|
|
}
|
|
|
|
|
|
2023-04-25 13:50:52 +03:00
|
|
|
const GifMessage = ({ message }: IProps) => {
|
2024-08-27 17:14:29 -05:00
|
|
|
const url = extractGifURL(message);
|
2022-03-30 16:54:03 +03:00
|
|
|
|
|
|
|
|
return (<View
|
2024-08-10 18:02:48 +03:00
|
|
|
id = 'gif-message'
|
2022-03-30 16:54:03 +03:00
|
|
|
style = { styles.gifContainer }>
|
|
|
|
|
<Image
|
|
|
|
|
source = {{ uri: url }}
|
2023-04-25 13:50:52 +03:00
|
|
|
style = { styles.gifImage as ImageStyle } />
|
2022-03-30 16:54:03 +03:00
|
|
|
</View>);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default GifMessage;
|