diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index eb47506..d9e8145 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -185,7 +185,7 @@ const EndButtons = () => { onOpen: onReadyModalOpen, onOpenChange: onReadyModalOpenChange, } = useDisclosure(); - const { copy, exportFile } = useExportCalendar(); + const { copyText } = useExportCalendar(); return (
{ size="lg" isIconOnly className="text-2xl" - onPress={copy} + onPress={copyText} > 📋 @@ -216,18 +216,6 @@ const EndButtons = () => { isOpen={isReadyModalOpen} onOpenChange={onReadyModalOpenChange} /> - - -
); }; diff --git a/src/helpers/export-calendar.ts b/src/helpers/export-calendar.ts index e6d7003..21ac071 100644 --- a/src/helpers/export-calendar.ts +++ b/src/helpers/export-calendar.ts @@ -4,7 +4,7 @@ import { useDetailedEnrolledCourses } from '../data/enrolled-courses'; export const useExportCalendar = () => { const enrolledCourses = useDetailedEnrolledCourses(); - const copy = async () => { + const copyText = async () => { const res = enrolledCourses.map((c) => ({ name: c.name.title + '\n' + c.name.subject + ' ' + c.name.code, classes: c.classes @@ -17,6 +17,5 @@ export const useExportCalendar = () => { await navigator.clipboard.writeText(resStr + '\n\n\n' + advertisement); toast.success('Copied to clipboard!'); }; - const exportFile = () => {}; - return { copy, exportFile }; + return { copyText }; };