Fix mention badge (#1382)
This commit is contained in:
parent
a6d9632cad
commit
e43c7d8cbf
1 changed files with 7 additions and 8 deletions
|
|
@ -74,8 +74,6 @@ export default class Badge extends PureComponent {
|
|||
|
||||
onLayout = (e) => {
|
||||
if (!this.layoutReady) {
|
||||
const height = Math.max(e.nativeEvent.layout.height, this.props.minHeight);
|
||||
const borderRadius = height / 2;
|
||||
let width;
|
||||
|
||||
if (e.nativeEvent.layout.width <= e.nativeEvent.layout.height) {
|
||||
|
|
@ -83,11 +81,11 @@ export default class Badge extends PureComponent {
|
|||
} else {
|
||||
width = e.nativeEvent.layout.width + this.props.extraPaddingHorizontal;
|
||||
}
|
||||
width = Math.max(width, this.props.minWidth);
|
||||
width = Math.max(width + 10, this.props.minWidth);
|
||||
const borderRadius = width / 2;
|
||||
this.setNativeProps({
|
||||
style: {
|
||||
width,
|
||||
height,
|
||||
borderRadius,
|
||||
opacity: 1
|
||||
}
|
||||
|
|
@ -141,14 +139,15 @@ export default class Badge extends PureComponent {
|
|||
|
||||
const styles = StyleSheet.create({
|
||||
badge: {
|
||||
top: 2,
|
||||
backgroundColor: '#444',
|
||||
borderRadius: 20,
|
||||
height: 20,
|
||||
padding: 12,
|
||||
paddingTop: 3,
|
||||
paddingBottom: 3,
|
||||
backgroundColor: '#444',
|
||||
borderRadius: 20,
|
||||
position: 'absolute',
|
||||
right: 30
|
||||
right: 30,
|
||||
top: 2
|
||||
},
|
||||
wrapper: {
|
||||
alignItems: 'center',
|
||||
|
|
|
|||
Loading…
Reference in a new issue