diff --git a/widgets/ErrorsWidget.js b/widgets/ErrorsWidget.js index e02fa8f..b7e674d 100644 --- a/widgets/ErrorsWidget.js +++ b/widgets/ErrorsWidget.js @@ -10,6 +10,12 @@ const WidgetMixin = require('../mixins/WidgetMixin.js'); module.exports = React.createClass({ mixins: [WidgetMixin], + getDefaultProps() { + return { + allowTextFontScaling: true, + }; + }, + render() { var errors = this.props.form.state.errors; if (errors.length > 0) { @@ -18,6 +24,7 @@ module.exports = React.createClass({ style={this.getStyle('errorContainer')} > {errors.join('\n')} diff --git a/widgets/GroupWidget.js b/widgets/GroupWidget.js index 8738913..a289c44 100644 --- a/widgets/GroupWidget.js +++ b/widgets/GroupWidget.js @@ -12,6 +12,7 @@ module.exports = React.createClass({ getDefaultProps() { return { type: 'GroupWidget', + allowTextFontScaling: true, // @todo proptypes }; }, @@ -35,6 +36,7 @@ module.exports = React.createClass({ return ( diff --git a/widgets/NoticeWidget.js b/widgets/NoticeWidget.js index 0caeeba..1a79f22 100644 --- a/widgets/NoticeWidget.js +++ b/widgets/NoticeWidget.js @@ -10,18 +10,20 @@ var WidgetMixin = require('../mixins/WidgetMixin.js'); module.exports = React.createClass({ mixins: [WidgetMixin], - + getDefaultProps() { return { type: 'NoticeWidget', + allowTextFontScaling: true, }; }, - + render() { return ( @@ -31,7 +33,7 @@ module.exports = React.createClass({ ); }, - + defaultStyles: { noticeRow: { paddingBottom: 10, @@ -42,7 +44,6 @@ module.exports = React.createClass({ noticeTitle: { fontSize: 13, color: '#9b9b9b', - }, + }, }, }); - diff --git a/widgets/OptionWidget.js b/widgets/OptionWidget.js index d93e21c..b175bd7 100644 --- a/widgets/OptionWidget.js +++ b/widgets/OptionWidget.js @@ -13,14 +13,15 @@ var WidgetMixin = require('../mixins/WidgetMixin.js'); module.exports = React.createClass({ mixins: [WidgetMixin], - + getDefaultProps() { return ({ // onChange: null, type: 'OptionWidget', + allowTextFontScaling: true, }); }, - + _renderCheckmark() { if (this.state.value === true) { return ( @@ -33,17 +34,17 @@ module.exports = React.createClass({ } return null; }, - + _onClose() { if (this.props.multiple === false) { this.props.unSelectAll(); this._onChange(true); - + if (typeof this.props.onSelect === 'function') { // console.log('onSelect'); this.props.onSelect(this.props.value); } - + if (typeof this.props.onClose === 'function') { this.props.onClose(this.props.title, this.props.navigator); } @@ -51,7 +52,7 @@ module.exports = React.createClass({ this._onChange(!this.state.value) } }, - + render() { return ( @@ -62,16 +63,20 @@ module.exports = React.createClass({ > {this._renderImage()} - + {this.props.title} {this._renderCheckmark()} - + ); }, - + defaultStyles: { rowImage: { height: 20, @@ -102,4 +107,3 @@ module.exports = React.createClass({ }, }, }); - diff --git a/widgets/RowValueWidget.js b/widgets/RowValueWidget.js index 192efcc..f3ef822 100644 --- a/widgets/RowValueWidget.js +++ b/widgets/RowValueWidget.js @@ -13,15 +13,16 @@ var TimerMixin = require('react-timer-mixin'); module.exports = React.createClass({ mixins: [TimerMixin, WidgetMixin], - + getDefaultProps() { return { type: 'RowValueWidget', onPress: () => {}, disclosure: true, + allowTextFontScaling: true, }; }, - + render() { return ( @@ -36,16 +37,24 @@ module.exports = React.createClass({ > {this._renderImage()} - {this.props.title} + {this.props.title} - {this.state.value} + {this.state.value} ); }, - + defaultStyles: { rowImage: { height: 20, diff --git a/widgets/RowWidget.js b/widgets/RowWidget.js index fd46e2b..247b732 100644 --- a/widgets/RowWidget.js +++ b/widgets/RowWidget.js @@ -13,15 +13,16 @@ var TimerMixin = require('react-timer-mixin'); module.exports = React.createClass({ mixins: [TimerMixin, WidgetMixin], - + getDefaultProps() { return { type: 'RowWidget', onPress: () => {}, disclosure: true, + allowTextFontScaling: true, }; }, - + _renderDisclosure() { if (this.props.disclosure === true) { return ( @@ -34,7 +35,7 @@ module.exports = React.createClass({ } return null; }, - + render() { return ( @@ -49,14 +50,18 @@ module.exports = React.createClass({ > {this._renderImage()} - {this.props.title} + {this.props.title} {this._renderDisclosure()} ); }, - + defaultStyles: { rowImage: { height: 20, diff --git a/widgets/SelectCountryWidget.js b/widgets/SelectCountryWidget.js index 6de5d9a..3113c43 100644 --- a/widgets/SelectCountryWidget.js +++ b/widgets/SelectCountryWidget.js @@ -1039,6 +1039,7 @@ module.exports = React.createClass({ onClose: () => {}, code: 'alpha2', autoFocus: false, + allowTextFontScaling: true, }; }, @@ -1834,9 +1835,11 @@ module.exports = React.createClass({ }} /> - {rowData.name} + {rowData.name} ); @@ -1865,9 +1868,11 @@ module.exports = React.createClass({ marginRight: 10, }} /> - {rowData.name} + {rowData.name} ); diff --git a/widgets/SwitchWidget.js b/widgets/SwitchWidget.js index 5e7f403..e371364 100644 --- a/widgets/SwitchWidget.js +++ b/widgets/SwitchWidget.js @@ -34,6 +34,7 @@ module.exports = React.createClass({ getDefaultProps() { return { type: 'SwitchWidget', + allowTextFontScaling: true, }; }, @@ -43,7 +44,11 @@ module.exports = React.createClass({ {this._renderImage()} - {this.props.title} + {this.props.title} value, onTextInputBlur: (value) => value + allowTextFontScaling: true, } }, - + getInitialState() { return { focused: false, } }, - + _renderTitle() { if (this.props.title !== '') { return ( - {this.props.title} - ); + ); } return ( @@ -46,25 +48,29 @@ module.exports = React.createClass({ }, _renderRow() { - + if (this.props.inline === false) { return ( {this._renderImage()} - {this.props.title} + {this.props.title} - + @@ -72,7 +78,7 @@ module.exports = React.createClass({ {this._renderUnderline()} ); - } + } return ( @@ -83,10 +89,10 @@ module.exports = React.createClass({ style={this.getStyle(['textInputInline'])} {...this.props} - + onFocus={this.onFocus} onBlur={this.onBlur} - + onChangeText={this._onChange} value={this.state.value} /> @@ -97,7 +103,7 @@ module.exports = React.createClass({ ); }, - + onFocus() { this.setState({ focused: true, @@ -108,19 +114,19 @@ module.exports = React.createClass({ if (newText !== oldText) { this._onChange(newText); } - + }, - + onBlur() { this.setState({ focused: false, - }); + }); this.props.onBlur(); this.props.onTextInputBlur(this.state.value); }, - - - + + + _renderUnderline() { if (this.props.underlined === true) { if (this.state.focused === false) { @@ -128,7 +134,7 @@ module.exports = React.createClass({ - ); + ); } return ( @@ -31,7 +33,7 @@ module.exports = React.createClass({ ); }, - + defaultStyles: { validationErrorRow: { @@ -44,5 +46,5 @@ module.exports = React.createClass({ color: '#ff001A', }, }, - -}); \ No newline at end of file + +});