2020-07-31 17:06:22 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import styles from './styles';
|
|
|
|
import { themes } from '../../constants/colors';
|
2020-10-30 13:12:02 +00:00
|
|
|
import Avatar from '../../containers/Avatar/Avatar';
|
2020-07-31 17:06:22 +00:00
|
|
|
|
2020-10-30 13:12:02 +00:00
|
|
|
const Wrapper = ({
|
2020-07-31 17:06:22 +00:00
|
|
|
accessibilityLabel,
|
|
|
|
avatar,
|
|
|
|
avatarSize,
|
2020-10-30 13:12:02 +00:00
|
|
|
avatarETag,
|
2020-07-31 17:06:22 +00:00
|
|
|
type,
|
|
|
|
baseUrl,
|
|
|
|
userId,
|
|
|
|
token,
|
|
|
|
theme,
|
2020-10-30 13:51:04 +00:00
|
|
|
rid,
|
2020-07-31 17:06:22 +00:00
|
|
|
children
|
|
|
|
}) => (
|
|
|
|
<View
|
|
|
|
style={styles.container}
|
|
|
|
accessibilityLabel={accessibilityLabel}
|
|
|
|
>
|
|
|
|
<Avatar
|
|
|
|
text={avatar}
|
|
|
|
size={avatarSize}
|
|
|
|
type={type}
|
|
|
|
style={styles.avatar}
|
2020-10-30 13:12:02 +00:00
|
|
|
server={baseUrl}
|
|
|
|
user={{ id: userId, token }}
|
|
|
|
avatarETag={avatarETag}
|
2020-10-30 13:51:04 +00:00
|
|
|
rid={rid}
|
2020-07-31 17:06:22 +00:00
|
|
|
/>
|
|
|
|
<View
|
|
|
|
style={[
|
|
|
|
styles.centerContainer,
|
|
|
|
{
|
|
|
|
borderColor: themes[theme].separatorColor
|
|
|
|
}
|
|
|
|
]}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
|
2020-10-30 13:12:02 +00:00
|
|
|
Wrapper.propTypes = {
|
2020-07-31 17:06:22 +00:00
|
|
|
accessibilityLabel: PropTypes.string,
|
|
|
|
avatar: PropTypes.string,
|
|
|
|
avatarSize: PropTypes.number,
|
2020-10-30 13:12:02 +00:00
|
|
|
avatarETag: PropTypes.string,
|
2020-07-31 17:06:22 +00:00
|
|
|
type: PropTypes.string,
|
|
|
|
baseUrl: PropTypes.string,
|
|
|
|
userId: PropTypes.string,
|
|
|
|
token: PropTypes.string,
|
|
|
|
theme: PropTypes.string,
|
2020-10-30 13:51:04 +00:00
|
|
|
rid: PropTypes.string,
|
2020-07-31 17:06:22 +00:00
|
|
|
children: PropTypes.element
|
|
|
|
};
|
|
|
|
|
2020-10-30 13:12:02 +00:00
|
|
|
export default Wrapper;
|