UNPKG

@dokuhero/react-native-components

Version:

Sets of React Native components that works with dokuhero/react-native-theme and react-i18next

24 lines 1.03 kB
import * as tslib_1 from "tslib"; import React from 'react'; import { Image, View } from 'react-native'; var ItemIdentity = /** @class */ (function (_super) { tslib_1.__extends(ItemIdentity, _super); function ItemIdentity() { return _super !== null && _super.apply(this, arguments) || this; } ItemIdentity.prototype.render = function () { var _a = this.props.avatar, isImage = _a.isImage, colorOrUri = _a.colorOrUri; var size = this.props.size || 40; var boxStyle = { width: size, height: size, opacity: 1 }; return (<View style={[boxStyle, this.props.containerStyle]}> {isImage ? (<Image style={boxStyle} source={typeof colorOrUri === 'string' ? { uri: colorOrUri } : colorOrUri}/>) : (<View style={tslib_1.__assign({}, boxStyle, { backgroundColor: colorOrUri })}/>)} </View>); }; return ItemIdentity; }(React.Component)); export { ItemIdentity }; //# sourceMappingURL=ItemIdentity.js.map