From beb1a30269fde3ae7978986586a2c5e16d0d93c3 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Thu, 5 Dec 2024 01:29:24 +1030 Subject: [PATCH] feat: remove export as file button --- src/components/Calendar.tsx | 16 ++-------------- src/helpers/export-calendar.ts | 5 ++--- 2 files changed, 4 insertions(+), 17 deletions(-) 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 }; };