-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
Copy pathListItemRightCaretWithLabel.tsx
35 lines (30 loc) · 1.13 KB
/
ListItemRightCaretWithLabel.tsx
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
import React from 'react';
import {View} from 'react-native';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import Text from '@components/Text';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
type ListItemRightCaretWithLabelProps = {
labelText?: string;
shouldShowCaret?: boolean;
};
function ListItemRightCaretWithLabel({labelText, shouldShowCaret = true}: ListItemRightCaretWithLabelProps) {
const styles = useThemeStyles();
const theme = useTheme();
return (
<View style={styles.flexRow}>
{!!labelText && <Text style={[styles.alignSelfCenter, styles.textSupporting, styles.pl2, styles.label]}>{labelText}</Text>}
{shouldShowCaret && (
<View style={[styles.pl2]}>
<Icon
src={Expensicons.ArrowRight}
fill={theme.icon}
/>
</View>
)}
</View>
);
}
ListItemRightCaretWithLabel.displayName = 'ListItemRightCaretWithLabel';
export default ListItemRightCaretWithLabel;