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

27 lines
565 B
TypeScript
Raw Normal View History

2019-03-27 20:06:57 +00:00
import React from 'react';
import { ImageBackground, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
image: {
width: '100%',
height: '100%',
position: 'absolute'
}
});
interface IEmptyRoomProps {
length: number;
mounted: boolean;
theme: string;
rid: string;
}
const EmptyRoom = React.memo(({ length, mounted, theme, rid }: IEmptyRoomProps) => {
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;