2021-09-13 20:41:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
|
|
|
|
import { themes } from '../../constants/colors';
|
2022-01-11 14:47:23 +00:00
|
|
|
import { DisplayMode } from '../../constants/constantDisplayMode';
|
2021-10-06 20:30:10 +00:00
|
|
|
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
|
2022-01-11 14:47:23 +00:00
|
|
|
style={[styles.container, displayMode === DisplayMode.Condensed && styles.containerCondensed]}
|
2021-10-06 20:30:10 +00:00
|
|
|
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
|
|
|
},
|
2022-01-11 14:47:23 +00:00
|
|
|
displayMode === DisplayMode.Condensed && styles.condensedPaddingVertical
|
2021-09-13 20:41:05 +00:00
|
|
|
]}>
|
|
|
|
{children}
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default Wrapper;
|