File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ import Text from '../text';
10
10
import Image from '../image' ;
11
11
import AnimatedImage from '../../animations/animatedImage' ;
12
12
13
+ const BADGE_SIZE = 13.5 ;
14
+
13
15
export const STATUS_MODES = {
14
16
ONLINE : 'ONLINE' ,
15
17
OFFLINE : 'OFFLINE' ,
@@ -142,11 +144,10 @@ export default class Avatar extends BaseComponent {
142
144
143
145
getBadgePosition ( ) {
144
146
const { size} = this . props ;
145
- const badgeSize = 13.5 ;
146
147
const radius = size / 2 ;
147
148
const x = Math . sqrt ( radius ** 2 * 2 ) ;
148
149
const y = x - radius ;
149
- const shift = Math . sqrt ( y ** 2 / 2 ) - badgeSize / 2 ;
150
+ const shift = Math . sqrt ( y ** 2 / 2 ) - BADGE_SIZE / 2 ;
150
151
return { top : shift , right : shift } ;
151
152
}
152
153
@@ -272,8 +273,8 @@ function createStyles({size, labelColor}) {
272
273
borderRadius,
273
274
} ,
274
275
onlineBadge : {
275
- height : 13.5 ,
276
- width : 13.5 ,
276
+ height : BADGE_SIZE ,
277
+ width : BADGE_SIZE ,
277
278
padding : 1.5 ,
278
279
borderRadius : 999 ,
279
280
backgroundColor : Colors . white ,
You can’t perform that action at this time.
0 commit comments