Skip to content

Commit

Permalink
Merge pull request #1 from SanyaPillai/fontScaling_support
Browse files Browse the repository at this point in the history
feat: Added prop for fontScaling for allowing font scale (stephy#358 & stephy#349)
  • Loading branch information
SanyaPillai authored Jan 18, 2024
2 parents 68baad1 + 84cd4c7 commit 15e1d13
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CalendarPicker/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import { View, Dimensions } from 'react-native';
import { View, Dimensions, Text } from 'react-native';
import { makeStyles } from './makeStyles';
import { Utils } from './Utils';
import HeaderControls from './HeaderControls';
Expand Down Expand Up @@ -39,6 +39,10 @@ export default class CalendarPicker extends Component {
...this.createMonths(props, {}),
};
this.state.renderMonthParams = this.createMonthProps(this.state);
Text.defaultProps = {
...(Text.defaultProps || {}),
allowFontScaling: props.fontScaling,
};
}

static defaultProps = {
Expand All @@ -61,6 +65,7 @@ export default class CalendarPicker extends Component {
selectedRangeStartStyle: null,
selectedRangeEndStyle: null,
selectedRangeStyle: null,
fontScaling: true,
};

componentDidUpdate(prevProps) {
Expand Down Expand Up @@ -408,6 +413,7 @@ export default class CalendarPicker extends Component {
selectedRangeStyle: this.props.selectedRangeStyle,
selectedRangeEndStyle: this.props.selectedRangeEndStyle,
customDatesStyles: this.props.customDatesStyles,
fontScaling: this.props.fontScaling,
};
}

Expand Down

0 comments on commit 15e1d13

Please sign in to comment.