2020-05-08 17:36:10 +00:00
|
|
|
import React from 'react';
|
2021-09-13 20:41:05 +00:00
|
|
|
import { Text, View } from 'react-native';
|
2020-05-08 17:36:10 +00:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import { themes } from '../../constants/colors';
|
|
|
|
import I18n from '../../i18n';
|
|
|
|
import Timezone from './Timezone';
|
|
|
|
import CustomFields from './CustomFields';
|
|
|
|
import styles from './styles';
|
|
|
|
|
2021-09-13 20:41:05 +00:00
|
|
|
const Roles = ({ roles, theme }) =>
|
|
|
|
roles && roles.length ? (
|
|
|
|
<View style={styles.item}>
|
|
|
|
<Text style={[styles.itemLabel, { color: themes[theme].titleText }]}>{I18n.t('Roles')}</Text>
|
|
|
|
<View style={styles.rolesContainer}>
|
|
|
|
{roles.map(role =>
|
|
|
|
role ? (
|
2022-01-11 14:33:18 +00:00
|
|
|
<View style={[styles.roleBadge, { backgroundColor: themes[theme].chatComponentBackground }]} key={role}>
|
|
|
|
<Text style={[styles.role, { color: themes[theme].titleText }]}>{role}</Text>
|
2021-09-13 20:41:05 +00:00
|
|
|
</View>
|
|
|
|
) : null
|
|
|
|
)}
|
|
|
|
</View>
|
2020-05-08 17:36:10 +00:00
|
|
|
</View>
|
2021-09-13 20:41:05 +00:00
|
|
|
) : null;
|
2020-05-08 17:36:10 +00:00
|
|
|
Roles.propTypes = {
|
|
|
|
roles: PropTypes.array,
|
|
|
|
theme: PropTypes.string
|
|
|
|
};
|
|
|
|
|
|
|
|
const Direct = ({ roomUser, theme }) => (
|
|
|
|
<>
|
|
|
|
<Roles roles={roomUser.parsedRoles} theme={theme} />
|
|
|
|
<Timezone utcOffset={roomUser.utcOffset} theme={theme} />
|
|
|
|
<CustomFields customFields={roomUser.customFields} theme={theme} />
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
Direct.propTypes = {
|
|
|
|
roomUser: PropTypes.object,
|
|
|
|
theme: PropTypes.string
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Direct;
|