2019-03-27 20:06:57 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { ImageBackground, StyleSheet } from 'react-native';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
image: {
|
|
|
|
width: '100%',
|
|
|
|
height: '100%',
|
|
|
|
position: 'absolute'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-12-11 23:01:12 +00:00
|
|
|
const EmptyRoom = React.memo(({
|
|
|
|
length, mounted, theme, rid
|
|
|
|
}) => {
|
|
|
|
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;
|
|
|
|
});
|
|
|
|
|
|
|
|
EmptyRoom.propTypes = {
|
2019-10-07 20:56:30 +00:00
|
|
|
length: PropTypes.number.isRequired,
|
2019-12-11 23:01:12 +00:00
|
|
|
mounted: PropTypes.bool,
|
|
|
|
theme: PropTypes.string,
|
|
|
|
rid: PropTypes.string
|
2019-03-27 20:06:57 +00:00
|
|
|
};
|
|
|
|
export default EmptyRoom;
|