renderEmptySessionsList()

in js/tabs/schedule/MyScheduleView.js [258:313]


  renderEmptySessionsList(day: number, containerHeight: number) {
    if (!this.props.user.isLoggedIn) {
      return this.renderNotLoggedIn(containerHeight);
    }

    const todaySessions = this.props.sessions.filter(s => s.day === day);
    const todayIncomplete = FilterSessions.byCompleted(
      todaySessions,
      this.props.now
    );

    if (todaySessions.length > 0 && todayIncomplete.length === 0) {
      // there are sessions but they're complete
      return (
        <EmptySchedule
          style={containerHeight > 0 ? { height: containerHeight } : null}
          key="schedule"
          text={`Your Day ${day} sessions have completed.\nThanks for joining us!`}
        />
      );
    } else if (day === 1) {
      return (
        <EmptySchedule
          style={containerHeight > 0 ? { height: containerHeight } : null}
          key="schedule"
          image={require("./img/empty-header-1.png")}
          text={`You haven’t added\nany Day ${day} sessions yet.`}
        >
          <F8Button
            theme="bordered"
            fontSize={13}
            opacity={0.6}
            caption={`See the day ${day} schedule`}
            onPress={_ => this.props.jumpToSchedule(1)}
          />
        </EmptySchedule>
      );
    } else {
      return (
        <EmptySchedule
          style={containerHeight > 0 ? { height: containerHeight } : null}
          key="schedule"
          image={require("./img/empty-header-2.png")}
          text={"Sessions you add\nwill appear here."}
        >
          <F8Button
            theme="bordered"
            fontSize={13}
            opacity={0.6}
            caption={`See the day ${day} schedule`}
            onPress={_ => this.props.jumpToSchedule(2)}
          />
        </EmptySchedule>
      );
    }
  }