verdnatura-chat/app/views/RoomView/EmptyRoom.tsx

23 lines
567 B
TypeScript
Raw Permalink Normal View History

2019-03-27 20:06:57 +00:00
import React from 'react';
import { ImageBackground, StyleSheet } from 'react-native';
import { useTheme } from '../../theme';
2019-03-27 20:06:57 +00:00
const styles = StyleSheet.create({
image: {
width: '100%',
height: '100%',
position: 'absolute'
}
});
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) {
return <ImageBackground source={{ uri: `message_empty_${theme}` }} style={styles.image} />;
2019-03-27 20:06:57 +00:00
}
return null;
});
export default EmptyRoom;