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';
|
2021-10-06 20:30:10 +00:00
|
|
|
import IconOrAvatar from './IconOrAvatar';
|
2022-04-20 21:37:54 +00:00
|
|
|
import { IWrapperProps } from './interfaces';
|
2021-10-06 20:30:10 +00:00
|
|
|
import styles from './styles';
|
2021-09-13 20:41:05 +00:00
|
|
|
|
2022-04-20 21:37:54 +00:00
|
|
|
const Wrapper = ({ accessibilityLabel, theme, children, displayMode, ...props }: IWrapperProps): React.ReactElement => (
|
2021-10-06 20:30:10 +00:00
|
|
|
<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;
|