From 7f904bf68cb121601f4f60097b423231c3c86313 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Thu, 28 Nov 2024 03:44:36 +1030 Subject: [PATCH 01/12] feat: copy calendar to clipboard --- src/components/Calendar.tsx | 43 ++++++++++++++++++++++++++++++++++ src/components/ExportModal.tsx | 0 src/helpers/export-calendar.ts | 20 ++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 src/components/ExportModal.tsx create mode 100644 src/helpers/export-calendar.ts diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index 212df35..21a7efb 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -9,6 +9,7 @@ import { YEAR } from '../constants/year'; import { useCourseColor, useEnrolledCourse } from '../data/enrolled-courses'; import { useCalendar, useOtherWeekCourseTimes } from '../helpers/calendar'; import { useCalendarHourHeight } from '../helpers/calendar-hour-height'; +import { useExportCalendar } from '../helpers/export-calendar'; import { calcHoursDuration } from '../helpers/hours-duration'; import { useZoom } from '../helpers/zoom'; import type dayjs from '../lib/dayjs'; @@ -175,6 +176,47 @@ const CalendarHeader = ({ ); }; +const EndButtons = () => { + const blockHeight = useCalendarHourHeight((s) => s.height); + + const { copy, exportFile } = useExportCalendar(); + + return ( +
+ + + + + + + +
+ ); +}; + const CalendarBg = ({ currentWeek }: { currentWeek: dayjs.Dayjs }) => { const { t } = useTranslation(); @@ -384,6 +426,7 @@ export const Calendar = () => { {isDragging && } + ); diff --git a/src/components/ExportModal.tsx b/src/components/ExportModal.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/helpers/export-calendar.ts b/src/helpers/export-calendar.ts new file mode 100644 index 0000000..7c9ec64 --- /dev/null +++ b/src/helpers/export-calendar.ts @@ -0,0 +1,20 @@ +import { toast } from 'sonner'; + +import { useDetailedEnrolledCourses } from '../data/enrolled-courses'; + +export const useExportCalendar = () => { + const enrolledCourses = useDetailedEnrolledCourses(); + const copy = async () => { + const res = enrolledCourses.map((c) => ({ + name: c.name.title + '\n' + c.name.subject + ' ' + c.name.code, + classes: c.classes + .map(({ type, classNumber }) => type + ': ' + classNumber) + .join('\n'), + })); + const resStr = res.map((d) => d.name + '\n\n' + d.classes).join('\n\n\n'); + await navigator.clipboard.writeText(resStr); + toast.success('Copied to clipboard!'); + }; + const exportFile = () => {}; + return { copy, exportFile }; +}; From 11d319b929d0126a6e28457dca8a5038c3472319 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Thu, 28 Nov 2024 23:31:07 +1030 Subject: [PATCH 02/12] feat: ready for enrolment modal --- src/components/Calendar.tsx | 21 +++++++-- src/components/EnrolmentModal.tsx | 71 +++++++++++++++++++++++++++++++ src/components/ExportModal.tsx | 0 3 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 src/components/EnrolmentModal.tsx delete mode 100644 src/components/ExportModal.tsx diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index 21a7efb..eb47506 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -1,4 +1,4 @@ -import { Button, Tooltip } from '@nextui-org/react'; +import { Button, Tooltip, useDisclosure } from '@nextui-org/react'; import clsx from 'clsx'; import { useRef, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -16,6 +16,7 @@ import type dayjs from '../lib/dayjs'; import type { DateTimeRange, WeekCourse, WeekCourses } from '../types/course'; import { timeToDayjs } from '../utils/date'; import { useDrag, useDrop } from '../utils/dnd'; +import { EnrolmentModal } from './EnrolmentModal'; type DraggingCourseState = { isDragging: boolean; @@ -179,6 +180,11 @@ const CalendarHeader = ({ const EndButtons = () => { const blockHeight = useCalendarHourHeight((s) => s.height); + const { + isOpen: isReadyModalOpen, + onOpen: onReadyModalOpen, + onOpenChange: onReadyModalOpenChange, + } = useDisclosure(); const { copy, exportFile } = useExportCalendar(); return ( @@ -198,9 +204,18 @@ const EndButtons = () => { 📋 - + + + + + ); +}; diff --git a/src/components/ExportModal.tsx b/src/components/ExportModal.tsx deleted file mode 100644 index e69de29..0000000 From fe05aebeae7f1e30dbf69d141d85a21e148b507d Mon Sep 17 00:00:00 2001 From: jsun969 Date: Sat, 30 Nov 2024 15:10:46 +1030 Subject: [PATCH 03/12] feat: add ad for copy sharing --- src/helpers/export-calendar.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/helpers/export-calendar.ts b/src/helpers/export-calendar.ts index 7c9ec64..7811804 100644 --- a/src/helpers/export-calendar.ts +++ b/src/helpers/export-calendar.ts @@ -11,8 +11,10 @@ export const useExportCalendar = () => { .map(({ type, classNumber }) => type + ': ' + classNumber) .join('\n'), })); - const resStr = res.map((d) => d.name + '\n\n' + d.classes).join('\n\n\n'); - await navigator.clipboard.writeText(resStr); + const resStr = res.map((d) => d.name + '\n\n' + d.classes).join('\n\n'); + const advertisement = + 'Planned with MyTimeTable\nhttps://mytimetable.csclub.org.au/'; + await navigator.clipboard.writeText(resStr + '\n\n\n' + advertisement); toast.success('Copied to clipboard!'); }; const exportFile = () => {}; From 54f8a7fb0520561bcd11950a60d0a64a13702cae Mon Sep 17 00:00:00 2001 From: jsun969 Date: Sat, 30 Nov 2024 15:11:31 +1030 Subject: [PATCH 04/12] fix: typo --- src/helpers/export-calendar.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/export-calendar.ts b/src/helpers/export-calendar.ts index 7811804..e6d7003 100644 --- a/src/helpers/export-calendar.ts +++ b/src/helpers/export-calendar.ts @@ -13,7 +13,7 @@ export const useExportCalendar = () => { })); const resStr = res.map((d) => d.name + '\n\n' + d.classes).join('\n\n'); const advertisement = - 'Planned with MyTimeTable\nhttps://mytimetable.csclub.org.au/'; + 'Planned with MyTimetable\nhttps://mytimetable.csclub.org.au/'; await navigator.clipboard.writeText(resStr + '\n\n\n' + advertisement); toast.success('Copied to clipboard!'); }; From beb1a30269fde3ae7978986586a2c5e16d0d93c3 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Thu, 5 Dec 2024 01:29:24 +1030 Subject: [PATCH 05/12] 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 }; }; From 333bc01117ba0e2e303721e910bf38573194d8f7 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Thu, 5 Dec 2024 02:37:10 +1030 Subject: [PATCH 06/12] feat: i18n --- src/components/Calendar.tsx | 10 ++++++---- src/components/EnrolmentModal.tsx | 5 ++++- src/helpers/export-calendar.ts | 5 ++++- src/locales/en-au.json | 7 ++++++- src/locales/zh-cn.json | 7 ++++++- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index d9e8145..0f06015 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -177,7 +177,9 @@ const CalendarHeader = ({ ); }; -const EndButtons = () => { +const EndActions = () => { + const { t } = useTranslation(); + const blockHeight = useCalendarHourHeight((s) => s.height); const { @@ -192,7 +194,7 @@ const EndButtons = () => { className="absolute -bottom-[0.5rem] left-0 flex w-full items-center justify-center gap-4" style={{ height: blockHeight + 'rem' }} > - + { {isDragging && } - + ); diff --git a/src/components/EnrolmentModal.tsx b/src/components/EnrolmentModal.tsx index 646cd6f..cf3aae4 100644 --- a/src/components/EnrolmentModal.tsx +++ b/src/components/EnrolmentModal.tsx @@ -12,6 +12,7 @@ import { ModalHeader, } from '@nextui-org/react'; import clsx from 'clsx'; +import { useTranslation } from 'react-i18next'; import { useDetailedEnrolledCourses } from '../data/enrolled-courses'; @@ -20,6 +21,8 @@ type ReadyModalProps = { onOpenChange: (isOpen: boolean) => void; }; export const EnrolmentModal = ({ isOpen, onOpenChange }: ReadyModalProps) => { + const { t } = useTranslation(); + const enrolledCourses = useDetailedEnrolledCourses(); const isOnlyCourse = enrolledCourses.length === 1; @@ -30,7 +33,7 @@ export const EnrolmentModal = ({ isOpen, onOpenChange }: ReadyModalProps) => { size={isOnlyCourse ? 'xs' : '2xl'} > - Ready for Enrolment + {t('calendar.end-actions.ready')} {enrolledCourses.map((c) => ( diff --git a/src/helpers/export-calendar.ts b/src/helpers/export-calendar.ts index 21ac071..b3d432d 100644 --- a/src/helpers/export-calendar.ts +++ b/src/helpers/export-calendar.ts @@ -1,8 +1,11 @@ +import { useTranslation } from 'react-i18next'; import { toast } from 'sonner'; import { useDetailedEnrolledCourses } from '../data/enrolled-courses'; export const useExportCalendar = () => { + const { t } = useTranslation(); + const enrolledCourses = useDetailedEnrolledCourses(); const copyText = async () => { const res = enrolledCourses.map((c) => ({ @@ -15,7 +18,7 @@ export const useExportCalendar = () => { const advertisement = 'Planned with MyTimetable\nhttps://mytimetable.csclub.org.au/'; await navigator.clipboard.writeText(resStr + '\n\n\n' + advertisement); - toast.success('Copied to clipboard!'); + toast.success(t('calendar.end-actions.copy-success')); }; return { copyText }; }; diff --git a/src/locales/en-au.json b/src/locales/en-au.json index 00f6d64..84c83e2 100644 --- a/src/locales/en-au.json +++ b/src/locales/en-au.json @@ -39,7 +39,12 @@ "November", "December" ], - "immoveable-course": "Immoveable course" + "immoveable-course": "Immoveable course", + "end-actions": { + "copy": "Copy to clipboard", + "ready": "Ready for Enrolment", + "copy-success": "Copied to clipboard!" + } }, "help": { "title": "How to use MyTimetable", diff --git a/src/locales/zh-cn.json b/src/locales/zh-cn.json index d9e410d..74040a2 100644 --- a/src/locales/zh-cn.json +++ b/src/locales/zh-cn.json @@ -39,7 +39,12 @@ "十一月", "十二月" ], - "immoveable-course": "此课程无法移动" + "immoveable-course": "此课程无法移动", + "end-actions": { + "copy": "复制到剪切板", + "ready": "准备选课", + "copy-success": "已成功复制到剪切板!" + } }, "help": { "title": "如何使用 MyTimetable", From f276609de7632e012214bf26dcbf9b5464b04644 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Sat, 7 Dec 2024 13:43:17 +1030 Subject: [PATCH 07/12] feat(help): add ready button --- public/help/ready-button.webp | Bin 0 -> 9246 bytes src/components/HelpModal.tsx | 7 +++++++ src/locales/en-au.json | 3 ++- src/locales/zh-cn.json | 3 ++- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 public/help/ready-button.webp diff --git a/public/help/ready-button.webp b/public/help/ready-button.webp new file mode 100644 index 0000000000000000000000000000000000000000..c9a40c881665a995e8f48bf911d626db94c891b0 GIT binary patch literal 9246 zcmZ8`Wl$Z=vhBv*-6goYOK^904ekU91SfbP8x0%VxVw9BcX!`NaChE!?s@Otd)}X^ zt~E2&J-t?Sb=PPr$jai=004S2lIptZ0+h)A*uOdeSx`)e;Q;H(oc7t+;yN2GwUMSAh2CLV)S3ka8W9+%)1|@#5e2~4hKbVCkx`;{y*gey~ zx?WQ3i_{18-Ljui)L`7WUSy{SEnKF*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nZ5ZWa5LyoLud@#gEU~Knerix%63mw!YOSO|ym96J894tB`p_sI literal 0 HcmV?d00001 diff --git a/src/components/HelpModal.tsx b/src/components/HelpModal.tsx index 1b67bb7..cdc909a 100644 --- a/src/components/HelpModal.tsx +++ b/src/components/HelpModal.tsx @@ -66,6 +66,13 @@ export const HelpModal = () => { alt: 'Course modal to change class time', }, }, + { + content: t('help.steps.ready-button'), + image: { + path: '/help/ready-button.webp', + alt: 'Ready button at bottom', + }, + }, { content: t('help.steps.access-adelaide'), image: { diff --git a/src/locales/en-au.json b/src/locales/en-au.json index 84c83e2..59758d0 100644 --- a/src/locales/en-au.json +++ b/src/locales/en-au.json @@ -56,7 +56,8 @@ "change-week": "Change the calendar week to see more classes.", "course-details": "Click your enrolled course to see details of your enrolled classes.", "course-modal": "If you encounter any class clashes when using MyTimetable, you can open the modal to change the class.", - "access-adelaide": "You can enrol for courses in Access Adelaide by using the class numbers, once you are happy with your class times." + "ready-button": "Once you are satisfied with your class times, click the \"Ready for Enrollment\" button at the bottom of the calendar.", + "access-adelaide": "You can easily enroll in courses on Access Adelaide using the class numbers shown in the modal." }, "actions": { "next-step": "Next Step", diff --git a/src/locales/zh-cn.json b/src/locales/zh-cn.json index 74040a2..ff5288d 100644 --- a/src/locales/zh-cn.json +++ b/src/locales/zh-cn.json @@ -56,7 +56,8 @@ "change-week": "切换周数查看更多课程", "course-details": "点击你的选课查看详情", "course-modal": "如果在使用 MyTimetable 时遇到任何课程冲突,可以随时打开详情弹窗来更改课程", - "access-adelaide": "课程调整完毕后,可以使用详情中的 Class Number 在 Access Adelaide 中进行选课" + "ready-button": "课程调整完毕后,点击日历底部的“准备选课”按钮", + "access-adelaide": "你可以用弹窗中的 Class Number 在 Access Adelaide 中进行选课" }, "actions": { "next-step": "下一步", From 1e888fccbbb4b985e9b99992106fe659f395d036 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Sat, 7 Dec 2024 13:45:57 +1030 Subject: [PATCH 08/12] feat(tip): abbreviation --- src/components/Tips.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Tips.tsx b/src/components/Tips.tsx index a30bea6..154230d 100644 --- a/src/components/Tips.tsx +++ b/src/components/Tips.tsx @@ -44,6 +44,7 @@ const TIPS = [ CS Club Open Source Team to work on projects like this! , + <>You can search for courses using abbreviations, ]; const tips = shuffle(TIPS); From 6e40df8a2c0b0dd1d7970d53315c88793a225580 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Sat, 7 Dec 2024 23:17:31 +1030 Subject: [PATCH 09/12] feat(calendar): hide bottom actions if no courses enrolled --- src/components/Calendar.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index 0f06015..2337420 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -6,7 +6,11 @@ import { create } from 'zustand'; import { WEEK_DAYS } from '../constants/week-days'; import { YEAR } from '../constants/year'; -import { useCourseColor, useEnrolledCourse } from '../data/enrolled-courses'; +import { + useCourseColor, + useEnrolledCourse, + useEnrolledCourses, +} from '../data/enrolled-courses'; import { useCalendar, useOtherWeekCourseTimes } from '../helpers/calendar'; import { useCalendarHourHeight } from '../helpers/calendar-hour-height'; import { useExportCalendar } from '../helpers/export-calendar'; @@ -420,6 +424,8 @@ export const Calendar = () => { }, }); + const noCourses = useEnrolledCourses((s) => s.courses.length === 0); + return (
{ {isDragging && } - + {!noCourses && }
); From f27b96bace505099f159849141643ab809680296 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Sun, 8 Dec 2024 13:44:40 +1030 Subject: [PATCH 10/12] feat: move copy button to ready modal --- src/components/Calendar.tsx | 13 +------------ src/components/EnrolmentModal.tsx | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/components/Calendar.tsx b/src/components/Calendar.tsx index 2337420..0c15af4 100644 --- a/src/components/Calendar.tsx +++ b/src/components/Calendar.tsx @@ -198,18 +198,7 @@ const EndActions = () => { className="absolute -bottom-[0.5rem] left-0 flex w-full items-center justify-center gap-4" style={{ height: blockHeight + 'rem' }} > - - - + {/* TODO: Share Button */} +