2019-03-27 20:06:57 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { ImageBackground, StyleSheet } from 'react-native';
|
2022-03-02 14:18:01 +00:00
|
|
|
|
|
|
|
import { useTheme } from '../../theme';
|
2019-03-27 20:06:57 +00:00
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
image: {
|
|
|
|
width: '100%',
|
|
|
|
height: '100%',
|
|
|
|
position: 'absolute'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-03-02 14:18:01 +00:00
|
|
|
const EmptyRoom = React.memo(({ length, mounted, rid }: { length: number; mounted: boolean; rid: string }) => {
|
|
|
|
const { theme } = useTheme();
|
2019-11-25 20:01:17 +00:00
|
|
|
if ((length === 0 && mounted) || !rid) {
|
2021-09-13 20:41:05 +00:00
|
|
|
return <ImageBackground source={{ uri: `message_empty_${theme}` }} style={styles.image} />;
|
2019-03-27 20:06:57 +00:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
});
|
|
|
|
|
|
|
|
export default EmptyRoom;
|