2021-09-13 20:41:05 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View } from 'react-native';
|
|
|
|
|
2022-06-27 18:23:43 +00:00
|
|
|
import { DisplayMode } from '../../lib/constants';
|
|
|
|
import { useTheme } from '../../theme';
|
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-06-27 18:23:43 +00:00
|
|
|
const Wrapper = ({ accessibilityLabel, children, displayMode, ...props }: IWrapperProps): React.ReactElement => {
|
|
|
|
const { colors } = useTheme();
|
|
|
|
return (
|
2021-09-13 20:41:05 +00:00
|
|
|
<View
|
2022-06-27 18:23:43 +00:00
|
|
|
style={[styles.container, displayMode === DisplayMode.Condensed && styles.containerCondensed]}
|
2022-08-08 21:02:08 +00:00
|
|
|
accessibilityLabel={accessibilityLabel}
|
|
|
|
>
|
2022-06-27 18:23:43 +00:00
|
|
|
<IconOrAvatar displayMode={displayMode} {...props} />
|
|
|
|
<View
|
|
|
|
style={[
|
|
|
|
styles.centerContainer,
|
|
|
|
{
|
|
|
|
borderColor: colors.separatorColor
|
|
|
|
}
|
2022-08-08 21:02:08 +00:00
|
|
|
]}
|
|
|
|
>
|
2022-06-27 18:23:43 +00:00
|
|
|
{children}
|
|
|
|
</View>
|
2021-09-13 20:41:05 +00:00
|
|
|
</View>
|
2022-06-27 18:23:43 +00:00
|
|
|
);
|
|
|
|
};
|
2021-09-13 20:41:05 +00:00
|
|
|
|
|
|
|
export default Wrapper;
|