From e43c7d8cbfc827ee090528b67e659ccd5fe3fb49 Mon Sep 17 00:00:00 2001 From: enahum Date: Fri, 26 Jan 2018 14:08:49 -0300 Subject: [PATCH] Fix mention badge (#1382) --- app/components/badge.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/components/badge.js b/app/components/badge.js index 54782a2b6..d5af6312b 100644 --- a/app/components/badge.js +++ b/app/components/badge.js @@ -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',