Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const propTypes = {
cancelStyle: View.propTypes.style,
cancelTextStyle: Text.propTypes.style,
overlayStyle: View.propTypes.style,
cancelText: PropTypes.string
cancelText: PropTypes.string,
allowFontScaling: PropTypes.bool
};

const defaultProps = {
Expand All @@ -49,7 +50,8 @@ const defaultProps = {
cancelStyle: {},
cancelTextStyle: {},
overlayStyle: {},
cancelText: 'cancel'
cancelText: 'cancel',
allowFontScaling: true
};

export default class ModalPicker extends BaseComponent {
Expand Down Expand Up @@ -105,7 +107,10 @@ export default class ModalPicker extends BaseComponent {
renderSection(section) {
return (
<View key={section.key} style={[styles.sectionStyle,this.props.sectionStyle]}>
<Text style={[styles.sectionTextStyle,this.props.sectionTextStyle]}>{section.label}</Text>
<Text
allowFontScaling={this.props.allowFontScaling}
style={[styles.sectionTextStyle,this.props.sectionTextStyle]}
>{section.label}</Text>
</View>
);
}
Expand All @@ -114,7 +119,10 @@ export default class ModalPicker extends BaseComponent {
return (
<TouchableOpacity key={option.key} onPress={()=>this.onChange(option)}>
<View style={[styles.optionStyle, this.props.optionStyle]}>
<Text style={[styles.optionTextStyle,this.props.optionTextStyle]}>{option.label}</Text>
<Text
allowFontScaling={this.props.allowFontScaling}
style={[styles.optionTextStyle,this.props.optionTextStyle]}
>{option.label}</Text>
</View>
</TouchableOpacity>)
}
Expand All @@ -140,7 +148,10 @@ export default class ModalPicker extends BaseComponent {
<View style={styles.cancelContainer}>
<TouchableOpacity onPress={this.close}>
<View style={[styles.cancelStyle, this.props.cancelStyle]}>
<Text style={[styles.cancelTextStyle,this.props.cancelTextStyle]}>{this.props.cancelText}</Text>
<Text
allowFontScaling={this.props.allowFontScaling}
style={[styles.cancelTextStyle,this.props.cancelTextStyle]}
>{this.props.cancelText}</Text>
</View>
</TouchableOpacity>
</View>
Expand All @@ -155,7 +166,10 @@ export default class ModalPicker extends BaseComponent {
}
return (
<View style={[styles.selectStyle, this.props.selectStyle]}>
<Text style={[styles.selectTextStyle, this.props.selectTextStyle]}>{this.state.selected}</Text>
<Text
allowFontScaling={this.props.allowFontScaling}
style={[styles.selectTextStyle, this.props.selectTextStyle]}
>{this.state.selected}</Text>
</View>
);
}
Expand Down