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

fix: refresh issue on calendar #846

Merged
merged 4 commits into from
Dec 17, 2024
Merged
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
5 changes: 5 additions & 0 deletions changelogs/unreleased/88597.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "Agenda: patch package to restore load of items on component layout",
"type": "fix",
"packages": "core"
}
57 changes: 57 additions & 0 deletions patches/react-native-calendars+1.1306.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff --git a/node_modules/react-native-calendars/src/agenda/index.js b/node_modules/react-native-calendars/src/agenda/index.js
index 973e34c..3215e07 100644
--- a/node_modules/react-native-calendars/src/agenda/index.js
+++ b/node_modules/react-native-calendars/src/agenda/index.js
@@ -4,9 +4,9 @@ import XDate from 'xdate';
import memoize from 'memoize-one';
import React, { Component } from 'react';
import { View, Dimensions, Animated } from 'react-native';
-import { extractCalendarListProps, extractReservationListProps } from '../componentUpdater';
import { xdateToData, toMarkingFormat } from '../interface';
import { sameDate, sameMonth } from '../dateutils';
+// @ts-expect-error
import { AGENDA_CALENDAR_KNOB } from '../testIDs';
import { VelocityTracker } from '../velocityTracker';
import { getCalendarDateString } from '../services';
@@ -14,6 +14,7 @@ import styleConstructor from './style';
import WeekDaysNames from '../commons/WeekDaysNames';
import CalendarList from '../calendar-list';
import ReservationList from './reservation-list';
+import {extractComponentProps,extractCalendarListProps, extractReservationListProps} from '../componentUpdater';
const HEADER_HEIGHT = 104;
const KNOB_HEIGHT = 24;
/**
@@ -238,20 +239,25 @@ export default class Agenda extends Component {
renderReservations() {
const reservationListProps = extractReservationListProps(this.props);
if (isFunction(this.props.renderList)) {
- return this.props.renderList({
- ...reservationListProps,
- selectedDay: this.state.selectedDay,
- topDay: this.state.topDay,
- onDayChange: this.onDayChange,
- });
+ return this.props.renderList({
+ ...reservationListProps,
+ selectedDay: this.state.selectedDay,
+ topDay: this.state.topDay,
+ onDayChange: this.onDayChange,
+ });
}
+
return (<ReservationList {...reservationListProps} ref={this.list} selectedDay={this.state.selectedDay} topDay={this.state.topDay} onDayChange={this.onDayChange}/>);
}
renderCalendarList() {
const { markedDates, items } = this.props;
const shouldHideExtraDays = this.state.calendarScrollable ? this.props.hideExtraDays : false;
- const calendarListProps = extractCalendarListProps(this.props);
- return (<CalendarList {...calendarListProps} ref={this.calendar} current={getCalendarDateString(this.currentMonth.toString())} markedDates={this.generateMarkings(this.state.selectedDay, markedDates, items)} calendarWidth={this.viewWidth} scrollEnabled={this.state.calendarScrollable} hideExtraDays={shouldHideExtraDays} onLayout={this.onCalendarListLayout} onDayPress={this.onDayPress} onVisibleMonthsChange={this.onVisibleMonthsChange}/>);
+ const calendarListProps = extractComponentProps(CalendarList, this.props)
+
+ return (<CalendarList
+ theme={this.props.theme}
+ style={this.props.style}
+ {...calendarListProps} ref={this.calendar} current={getCalendarDateString(this.currentMonth.toString())} markedDates={this.generateMarkings(this.state.selectedDay, markedDates, items)} calendarWidth={this.viewWidth} scrollEnabled={this.state.calendarScrollable} hideExtraDays={shouldHideExtraDays} onLayout={this.onCalendarListLayout} onDayPress={this.onDayPress} onVisibleMonthsChange={this.onVisibleMonthsChange}/>);
}
renderKnob() {
const { showClosingKnob, hideKnob, renderKnob } = this.props;
Loading