Skip to content

Commit 2e5ec1e

Browse files
authored
Fix Agenda's "renderEmptyData" not rendering and missing theme propType (#1366)
* Fix renderEmptyData not actually renders anything * Add missing 'theme' propType to Reservation component of the agenda
1 parent fcad36c commit 2e5ec1e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/agenda/reservation-list/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ class ReservationList extends Component {
221221
render() {
222222
const {reservations, selectedDay, theme, style} = this.props;
223223
if (!reservations || !reservations[selectedDay.toString('yyyy-MM-dd')]) {
224-
_.invoke(this.props, 'renderEmptyData');
224+
if (_.isFunction(this.props.renderEmptyData)) {
225+
return _.invoke(this.props, 'renderEmptyData');
226+
}
225227

226228
return <ActivityIndicator style={this.style.indicator} color={theme && theme.indicatorColor} />;
227229
}

src/agenda/reservation-list/reservation.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ class Reservation extends Component {
1313

1414
static propTypes = {
1515
item: PropTypes.any,
16+
/** Specify theme properties to override specific styles for reservation parts. Default = {} */
17+
theme: PropTypes.object,
1618
// specify your item comparison function for increased performance
1719
rowHasChanged: PropTypes.func,
1820
// specify how each date should be rendered. day can be undefined if the item is not first in that day.

0 commit comments

Comments
 (0)