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';
|
2019-04-08 12:35:28 +00:00
|
|
|
import { CustomIcon } from '../lib/Icons';
|
|
|
|
import { COLOR_TEXT_DESCRIPTION } from '../constants/colors';
|
2018-05-18 16:41:47 +00:00
|
|
|
|
|
|
|
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-04-08 12:35:28 +00:00
|
|
|
tintColor: COLOR_TEXT_DESCRIPTION,
|
|
|
|
color: COLOR_TEXT_DESCRIPTION
|
|
|
|
},
|
|
|
|
discussion: {
|
|
|
|
marginRight: 6
|
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;
|
|
|
|
}
|
|
|
|
|
2019-04-08 12:35:28 +00:00
|
|
|
if (type === 'discussion') {
|
|
|
|
// FIXME: These are temporary only. We should have all room icons on <Customicon />, but our design team is still working on this.
|
|
|
|
return <CustomIcon name='chat' size={13} style={[styles.style, styles.discussion]} />;
|
|
|
|
}
|
|
|
|
|
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;
|