2021-10-01 18:12:19 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
|
2022-04-28 18:44:40 +00:00
|
|
|
import { DisplayMode, themes } from '../../lib/constants';
|
2021-10-28 17:49:08 +00:00
|
|
|
import IconOrAvatar from './IconOrAvatar';
|
2022-04-28 18:44:40 +00:00
|
|
|
import { IWrapperProps } from './interfaces';
|
2021-10-28 17:49:08 +00:00
|
|
|
import styles from './styles';
|
2021-10-01 18:12:19 +00:00
|
|
|
|
2022-04-28 18:44:40 +00:00
|
|
|
const Wrapper = ({ accessibilityLabel, theme, children, displayMode, ...props }: IWrapperProps): React.ReactElement => (
|
2021-10-28 17:49:08 +00:00
|
|
|
<View
|
2022-01-24 20:12:25 +00:00
|
|
|
style={[styles.container, displayMode === DisplayMode.Condensed && styles.containerCondensed]}
|
2021-10-28 17:49:08 +00:00
|
|
|
accessibilityLabel={accessibilityLabel}>
|
|
|
|
<IconOrAvatar theme={theme} displayMode={displayMode} {...props} />
|
2021-10-01 18:12:19 +00:00
|
|
|
<View
|
|
|
|
style={[
|
|
|
|
styles.centerContainer,
|
|
|
|
{
|
|
|
|
borderColor: themes[theme].separatorColor
|
2022-03-29 18:53:27 +00:00
|
|
|
}
|
2021-10-01 18:12:19 +00:00
|
|
|
]}>
|
|
|
|
{children}
|
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
|
|
|
|
export default Wrapper;
|