Skip to content

Commit e8b1d44

Browse files
committed
extract buttonTextStyle to variable
1 parent 975f8f9 commit e8b1d44

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

source/views/components/filter/filter-toolbar-button.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,26 +92,22 @@ export class FilterToolbarButton extends React.PureComponent<Props, State> {
9292
}
9393
}
9494

95+
const buttonTextStyle = [
96+
activeContentStyle,
97+
textWithIconStyle,
98+
activeTextStyle,
99+
buttonStyles.text,
100+
]
101+
95102
return (
96103
<React.Fragment>
97104
<TouchableOpacity
98105
ref={ref => (this.touchable = ref)}
99106
onPress={this.openPopover}
100107
style={[buttonStyles.button, activeButtonStyle, style]}
101108
>
102-
<Text
103-
style={[
104-
activeContentStyle,
105-
textWithIconStyle,
106-
activeTextStyle,
107-
buttonStyles.text,
108-
]}
109-
>
110-
{title}
111-
</Text>
112-
{icon ? (
113-
<Icon name={icon} size={18} style={activeContentStyle} />
114-
) : null}
109+
<Text style={buttonTextStyle}>{title}</Text>
110+
<Icon name={icon} size={18} style={activeContentStyle} />
115111
</TouchableOpacity>
116112
<FilterPopover
117113
anchor={this.touchable}

0 commit comments

Comments
 (0)