import * as React from 'react'; import { Button, Card, CardBody, CardTitle, Collapse, Row } from 'reactstrap'; import CourseSection from '../util/CourseSection'; import CourseSectionList from './CourseSectionList'; import ExportModal from './ExportModal'; interface ScheduleBadgeProps { schedule: CourseSection[]; removeCourseSection: (courseSection: CourseSection) => void; generateCalendarUrl: () => string; openCalendarAsWebcal: () => void; downloadIcs: () => Promise; } interface State { collapse: boolean; isModalOpen: boolean; } require('../css/icon-badge.css'); /** * Contains all functionality for viewing your schedule, such as the * shopping cart, list of course sections, and the generate calendar modal. * * TODO: Split this component up */ class ScheduleBadge extends React.Component { constructor(props: ScheduleBadgeProps) { super(props); this.state = { collapse: false, isModalOpen: false }; } toggleCollapse = () => this.setState({ collapse: !this.state.collapse }); toggleModal = () => this.setState({ isModalOpen: !this.state.isModalOpen }); render() { const { schedule, removeCourseSection, generateCalendarUrl, openCalendarAsWebcal, downloadIcs } = this.props; return (
); } } export default ScheduleBadge;