import * as React from 'react'; import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { downloadFile } from '../util/utilities'; interface ExportModalProps { isModalOpen: boolean; toggleModal: () => void; calendarUrl: () => string; openCalendarAsWebcal: () => void; downloadIcs: () => Promise; } /** * Modal view that contains buttons for exporting your schedule as * well as instructions for importing your schedule into different * calendar managers */ const ExportModal = ({ isModalOpen, toggleModal, calendarUrl, openCalendarAsWebcal, downloadIcs, }: ExportModalProps) => ( Your calendar has been generated!
Apple Calendar
To add your schedule to Apple Calendar, click the "Add to calendar" button below. If you are on a device running macOS or iOS, this will open a dialogue which will walk you through adding the calendar.
Google Calendar
On desktop:
Open your Google Calendar. Click the "Settings" button in the top right, and then click the Settings tab. In the menu on the left, click "Add calendar" and "From URL". Now, paste the following link inside the text box:
{calendarUrl()}
On mobile (Android only):
Click the "Download calendar file" button. This will download the calendar file which you may then open and add to your calendar.
.ics file
To download a .ics file containing your schedule, click the "Download calendar file" button below.
{' '}
); export default ExportModal;