2018-05-18 16:41:47 +00:00
|
|
|
import React from 'react';
|
2018-08-31 16:46:33 +00:00
|
|
|
import { Image, StyleSheet } from 'react-native';
|
2018-05-18 16:41:47 +00:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
2018-08-31 16:46:33 +00:00
|
|
|
style: {
|
|
|
|
marginRight: 7,
|
2019-03-01 16:49:11 +00:00
|
|
|
marginTop: 3,
|
2019-03-12 16:23:06 +00:00
|
|
|
tintColor: '#9EA2A8'
|
2018-05-18 16:41:47 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2019-03-01 16:49:11 +00:00
|
|
|
const RoomTypeIcon = React.memo(({ type, size, style }) => {
|
2018-05-24 20:17:45 +00:00
|
|
|
if (!type) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2018-08-31 16:46:33 +00:00
|
|
|
if (type === 'c') {
|
2018-10-31 18:40:08 +00:00
|
|
|
return <Image source={{ uri: 'hashtag' }} style={[styles.style, style, { width: size, height: size }]} />;
|
2018-08-31 16:46:33 +00:00
|
|
|
}
|
2018-10-31 18:40:08 +00:00
|
|
|
return <Image source={{ uri: 'lock' }} style={[styles.style, style, { width: size, height: size }]} />;
|
2019-03-01 16:49:11 +00:00
|
|
|
});
|
2018-05-18 16:41:47 +00:00
|
|
|
|
|
|
|
RoomTypeIcon.propTypes = {
|
2018-05-24 20:17:45 +00:00
|
|
|
type: PropTypes.string,
|
2018-08-31 16:46:33 +00:00
|
|
|
size: PropTypes.number,
|
|
|
|
style: PropTypes.object
|
2018-05-18 16:41:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
RoomTypeIcon.defaultProps = {
|
2018-08-31 16:46:33 +00:00
|
|
|
size: 10
|
2018-05-18 16:41:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default RoomTypeIcon;
|