Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add container styles for prev and next components as props #308

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 5 additions & 3 deletions CalendarPicker/HeaderControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default function HeaderControls(props) {
minDate,
headingLevel,
monthYearHeaderWrapperStyle,
headerWrapperStyle
headerWrapperStyle,
previousContainerStyle,
nextContainerStyle,
} = props;
const MONTHS = months || Utils.MONTHS; // English Month Array
const monthName = MONTHS[currentMonth];
Expand All @@ -54,7 +56,7 @@ export default function HeaderControls(props) {
label={previousTitle}
component={previousComponent}
onPressControl={onPressPrevious}
styles={styles.previousContainer}
styles={[styles.previousContainer,previousContainerStyle]}
textStyles={[styles.navButtonText, textStyle, previousTitleStyle]}
/>
<View style={[styles.monthYearHeaderWrapper,monthYearHeaderWrapperStyle]}>
Expand All @@ -74,7 +76,7 @@ export default function HeaderControls(props) {
label={nextTitle}
component={nextComponent}
onPressControl={onPressNext}
styles={styles.nextContainer}
styles={[styles.nextContainer,nextContainerStyle]}
textStyles={[styles.navButtonText, textStyle, nextTitleStyle]}
/>
</View>
Expand Down
4 changes: 4 additions & 0 deletions CalendarPicker/YearSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export default class YearSelector extends Component {
nextTitleStyle,
headingLevel,
onSelectYear,
previousContainerStyle,
nextContainerStyle
} = this.props;

return (
Expand All @@ -66,6 +68,8 @@ export default class YearSelector extends Component {
nextTitleStyle={nextTitleStyle}
onYearViewPrevious={this.handleOnYearViewPrevious}
onYearViewNext={this.handleOnYearViewNext}
previousContainerStyle={previousContainerStyle}
nextContainerStyle={nextContainerStyle}
/>
<YearsGridView
intialYear={this.state.initialYear}
Expand Down
6 changes: 4 additions & 2 deletions CalendarPicker/YearsHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export default function YearsHeader(props) {
onYearViewPrevious,
onYearViewNext,
headingLevel,
previousContainerStyle,
nextContainerStyle
} = props;

const disablePrevious = restrictNavigation && minDate && (minDate.year() >= year);
Expand All @@ -43,7 +45,7 @@ export default function YearsHeader(props) {
label={previousTitle}
component={previousComponent}
onPressControl={onYearViewPrevious}
styles={styles.previousContainer}
styles={[styles.previousContainer,previousContainerStyle]}
textStyles={[styles.navButtonText, textStyle, previousTitleStyle]}
/>
<Text style={[styles.yearsHeaderText, textStyle]} {...accessibilityProps}>
Expand All @@ -54,7 +56,7 @@ export default function YearsHeader(props) {
label={nextTitle}
component={nextComponent}
onPressControl={onYearViewNext}
styles={styles.nextContainer}
styles={[styles.nextContainer,nextContainerStyle]}
textStyles={[styles.navButtonText, textStyle, nextTitleStyle]}
/>
</View>
Expand Down
6 changes: 6 additions & 0 deletions CalendarPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,8 @@ export default class CalendarPicker extends Component {
onMonthChange,
scrollable,
horizontal,
previousContainerStyle,
nextContainerStyle,
} = this.props;

let content;
Expand Down Expand Up @@ -523,6 +525,8 @@ export default class CalendarPicker extends Component {
nextTitleStyle={nextTitleStyle}
onSelectYear={this.handleOnSelectMonthYear}
headingLevel={headingLevel}
previousContainerStyle={previousContainerStyle}
nextContainerStyle={nextContainerStyle}
/>
);
break;
Expand Down Expand Up @@ -554,6 +558,8 @@ export default class CalendarPicker extends Component {
headingLevel={headingLevel}
monthYearHeaderWrapperStyle={monthYearHeaderWrapperStyle}
headerWrapperStyle={headerWrapperStyle}
previousContainerStyle={previousContainerStyle}
nextContainerStyle={nextContainerStyle}
/>
<Weekdays
styles={styles}
Expand Down