vn-verdnaturachat/app/containers/RoomTypeIcon.js

35 lines
740 B
JavaScript
Raw Normal View History

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