forked from gitpoint/git-point
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinline-label.component.js
More file actions
44 lines (39 loc) · 891 Bytes
/
Copy pathinline-label.component.js
File metadata and controls
44 lines (39 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React, { Component } from 'react';
import { StyleSheet, Text } from 'react-native';
import { fonts, normalize } from 'config';
import { getFontColorByBackground } from 'utils';
const styles = StyleSheet.create({
inlineLabel: {
fontSize: normalize(10),
...fonts.fontPrimarySemiBold,
paddingHorizontal: 5,
margin: 2,
borderWidth: 1,
overflow: 'hidden',
borderRadius: 3,
minWidth: 50,
textAlign: 'center',
},
});
export class InlineLabel extends Component {
props: {
label: Object,
};
render() {
const { color, name } = this.props.label;
return (
<Text
style={[
styles.inlineLabel,
{
backgroundColor: `#${color}`,
color: getFontColorByBackground(color),
borderColor: `#${color}`,
},
]}
>
{name}
</Text>
);
}
}