2021-09-13 20:41:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
|
|
|
|
import { themes } from '../../constants/colors';
|
2021-10-06 20:30:10 +00:00
|
|
|
import { DISPLAY_MODE_CONDENSED } from '../../constants/constantDisplayMode';
|
|
|
|
import IconOrAvatar from './IconOrAvatar';
|
|
|
|
import styles from './styles';
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
interface IWrapper {
|
|
|
|
accessibilityLabel: string;
|
|
|
|
avatar: string;
|
|
|
|
avatarSize: number;
|
|
|
|
type: string;
|
|
|
|
theme: string;
|
|
|
|
rid: string;
|
|
|
|
children: JSX.Element;
|
2021-10-06 20:30:10 +00:00
|
|
|
displayMode: string;
|
|
|
|
prid: string;
|
|
|
|
showLastMessage: boolean;
|
|
|
|
status: string;
|
|
|
|
isGroupChat: boolean;
|
|
|
|
teamMain: boolean;
|
|
|
|
showAvatar: boolean;
|
2021-09-13 20:41:05 +00:00
|
|
|
}
|
|
|
|
|
2021-10-06 20:30:10 +00:00
|
|
|
const Wrapper = ({ accessibilityLabel, theme, children, displayMode, ...props }: IWrapper) => (
|
|
|
|
<View
|
|
|
|
style={[styles.container, displayMode === DISPLAY_MODE_CONDENSED && styles.containerCondensed]}
|
|
|
|
accessibilityLabel={accessibilityLabel}>
|
|
|
|
<IconOrAvatar theme={theme} displayMode={displayMode} {...props} />
|
2021-09-13 20:41:05 +00:00
|
|
|
<View
|
|
|
|
style={[
|
|
|
|
styles.centerContainer,
|
|
|
|
{
|
|
|
|
borderColor: themes[theme].separatorColor
|
2021-10-06 20:30:10 +00:00
|
|
|
},
|
|
|
|
displayMode === DISPLAY_MODE_CONDENSED && styles.condensedPaddingVertical
|
2021-09-13 20:41:05 +00:00
|
|
|
]}>
|
|
|
|
{children}
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default Wrapper;
|