Skip to content

Commit

Permalink
feat: remove export as file button
Browse files Browse the repository at this point in the history
  • Loading branch information
jsun969 committed Dec 4, 2024
1 parent 54f8a7f commit beb1a30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
16 changes: 2 additions & 14 deletions src/components/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const EndButtons = () => {
onOpen: onReadyModalOpen,
onOpenChange: onReadyModalOpenChange,
} = useDisclosure();
const { copy, exportFile } = useExportCalendar();
const { copyText } = useExportCalendar();

return (
<div
Expand All @@ -199,7 +199,7 @@ const EndButtons = () => {
size="lg"
isIconOnly
className="text-2xl"
onPress={copy}
onPress={copyText}
>
📋
</Button>
Expand All @@ -216,18 +216,6 @@ const EndButtons = () => {
isOpen={isReadyModalOpen}
onOpenChange={onReadyModalOpenChange}
/>
<Tooltip content="Export as file">
<Button
variant="flat"
color="primary"
size="lg"
isIconOnly
className="text-2xl"
onPress={exportFile}
>
💾
</Button>
</Tooltip>
</div>
);
};
Expand Down
5 changes: 2 additions & 3 deletions src/helpers/export-calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 };
};

0 comments on commit beb1a30

Please sign in to comment.