2021-09-13 20:41:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
|
2022-04-07 14:10:03 +00:00
|
|
|
import { DisplayMode, themes } from '../../lib/constants';
|
2022-04-12 16:27:05 +00:00
|
|
|
import { TSupportedThemes } from '../../theme';
|
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;
|
2022-04-12 16:27:05 +00:00
|
|
|
theme: TSupportedThemes;
|
2021-09-13 20:41:05 +00:00
|
|
|
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
|
2022-03-07 20:48:45 +00:00
|
|
|
}
|
2021-09-13 20:41:05 +00:00
|
|
|
]}>
|
|
|
|
{children}
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default Wrapper;
|