@@ -11,7 +11,11 @@ import type { SpecificIconType } from './Icons';
11
11
import globalStyles , { ThemeContext , createStyleSheet } from '../styles' ;
12
12
13
13
type Props = $ReadOnly < { |
14
- Icon ?: SpecificIconType ,
14
+ icon ?: { |
15
+ + Component : SpecificIconType ,
16
+ + color ? : string ,
17
+ | } ,
18
+
15
19
label : LocalizableReactText ,
16
20
17
21
// TODO: Should we make this unconfigurable? Should we have two reusable
@@ -29,7 +33,7 @@ type Props = $ReadOnly<{|
29
33
* selectable option row instead, use `SelectableOptionRow`.
30
34
*/
31
35
export default function NestedNavRow ( props : Props ) : Node {
32
- const { label, labelBoldUppercase, onPress, Icon } = props ;
36
+ const { label, labelBoldUppercase, onPress, icon } = props ;
33
37
34
38
const themeContext = useContext ( ThemeContext ) ;
35
39
@@ -49,7 +53,7 @@ export default function NestedNavRow(props: Props): Node {
49
53
iconFromProps : {
50
54
textAlign : 'center' ,
51
55
marginRight : 8 ,
52
- color : themeContext . color ,
56
+ color : icon ?. color ?? themeContext . color ,
53
57
} ,
54
58
label : {
55
59
...( labelBoldUppercase ? { textTransform : 'uppercase' , fontWeight : '500' } : undefined ) ,
@@ -60,13 +64,13 @@ export default function NestedNavRow(props: Props): Node {
60
64
color : themeContext . color ,
61
65
} ,
62
66
} ) ,
63
- [ themeContext , labelBoldUppercase ] ,
67
+ [ themeContext , icon , labelBoldUppercase ] ,
64
68
) ;
65
69
66
70
return (
67
71
< Touchable onPress = { onPress } >
68
72
< View style = { styles . container } >
69
- { ! ! Icon && < Icon size = { 24 } style = { styles . iconFromProps } /> }
73
+ { ! ! icon && < icon . Component size = { 24 } style = { styles . iconFromProps } /> }
70
74
< ZulipTextIntl style = { styles . label } text = { label } />
71
75
< View style = { globalStyles . rightItem } >
72
76
< IconRight size = { 24 } style = { styles . iconRightFacingArrow } />
0 commit comments