-
Notifications
You must be signed in to change notification settings - Fork 785
/
Copy pathlabel-list-item.component.js
49 lines (41 loc) · 1.07 KB
/
label-list-item.component.js
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
45
46
47
48
49
import React from 'react';
import styled from 'styled-components';
import { Icon } from 'react-native-elements';
import { LabelButton } from 'components';
import { colors } from 'config';
type Props = {
label: Object,
removeLabel: Function,
};
const LabelListItemContainer = styled.View`
border-bottom-color: ${colors.greyLight};
border-bottom-width: 1;
`;
const Wrapper = styled.View`
padding: 10px;
margin-left: 5;
flex-direction: row;
`;
const LabelInfo = styled.View`
flex: 1;
flex-direction: row;
align-items: center;
`;
const IconContainer = styled.TouchableOpacity`
flex: 0.15;
align-items: flex-end;
justify-content: center;
`;
IconContainer.displayName = 'IconContainer';
export const LabelListItem = ({ label, removeLabel }: Props) => (
<LabelListItemContainer>
<Wrapper>
<LabelInfo>
<LabelButton label={label} largeWithTag />
</LabelInfo>
<IconContainer onPress={() => removeLabel(label)}>
<Icon color={colors.grey} name="x" type="octicon" />
</IconContainer>
</Wrapper>
</LabelListItemContainer>
);