2018-05-18 16:41:47 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { StyleSheet } from 'react-native';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
type: {
|
|
|
|
marginRight: 5,
|
|
|
|
marginTop: 3
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
const RoomTypeIcon = ({ type, size }) => {
|
2018-05-24 20:17:45 +00:00
|
|
|
if (!type) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2018-05-18 16:41:47 +00:00
|
|
|
const icon = {
|
|
|
|
c: 'pound',
|
|
|
|
p: 'lock',
|
|
|
|
l: 'account',
|
|
|
|
d: 'at'
|
|
|
|
}[type];
|
|
|
|
return <Icon name={icon} size={size} style={styles.type} />;
|
|
|
|
};
|
|
|
|
|
|
|
|
RoomTypeIcon.propTypes = {
|
2018-05-24 20:17:45 +00:00
|
|
|
type: PropTypes.string,
|
2018-05-18 16:41:47 +00:00
|
|
|
size: PropTypes.number
|
|
|
|
};
|
|
|
|
|
|
|
|
RoomTypeIcon.defaultProps = {
|
|
|
|
size: 15
|
|
|
|
};
|
|
|
|
|
|
|
|
export default RoomTypeIcon;
|