...
|
...
|
@@ -26,8 +26,8 @@ class ContentMessageTabItemView extends Component { |
|
|
onImageLayout(event) {
|
|
|
let imageLayout = event.nativeEvent.layout
|
|
|
this.setState({
|
|
|
badgeY: imageLayout.y + 1,
|
|
|
badgeX: imageLayout.x + imageLayout.width / 2 + 14,
|
|
|
badgeY: imageLayout.y - 4,
|
|
|
badgeX: imageLayout.x + imageLayout.width / 2 + 17,
|
|
|
})
|
|
|
}
|
|
|
|
...
|
...
|
@@ -49,7 +49,7 @@ class ContentMessageTabItemView extends Component { |
|
|
return <View style={styles.surfaceContainer}>
|
|
|
<Surface width={width} height={height}>
|
|
|
<Group>
|
|
|
<Shape d={path} stroke={'white'} fill={'#CE0824'} strokeWidth={strokeWidth}/>
|
|
|
<Shape d={path} stroke={'#FB2330'} fill={'#FB2330'} strokeWidth={strokeWidth}/>
|
|
|
</Group>
|
|
|
</Surface>
|
|
|
</View>
|
...
|
...
|
@@ -59,9 +59,7 @@ class ContentMessageTabItemView extends Component { |
|
|
|
|
|
render() {
|
|
|
return <View style={[styles.container, this.props.style]}>
|
|
|
<YH_Image style={styles.icon}
|
|
|
onLayout={this.onImageLayout}
|
|
|
url={YH_Image.getSlicedUrl(this.props.icon, IMAGE_WIDTH, IMAGE_HEIGHT, 2)}/>
|
|
|
<Image style={styles.icon} source={this.props.icon} onLayout={this.onImageLayout}/>
|
|
|
<Text style={styles.title}>{this.props.title}</Text>
|
|
|
{this.props.badge > 0 && this.state.badgeX != INVALID_POSITION && this.state.badgeY != INVALID_POSITION &&
|
|
|
<View style={[styles.badgeContainer, {left: this.state.badgeX, top: this.state.badgeY}]}
|
...
|
...
|
@@ -108,7 +106,7 @@ let styles = StyleSheet.create({ |
|
|
left: 0,
|
|
|
top: 0,
|
|
|
right: 0,
|
|
|
bottom: 0
|
|
|
bottom: 0,
|
|
|
},
|
|
|
badgeTitle: {
|
|
|
marginLeft: 5,
|
...
|
...
|
|