* feat: wip add course by url * chore: update imports * feat: add useCourseFromUrl hook * chore: extract logic into async function * feat: add checkLoginStatus.ts * feat: add useCourseMigration hook * feat: working course migration * fix: active schedule bug * feat: refactor logic and add to onUpdate * feat: update ui style * feat: add changelog functionality to settings * chore: update packages * feat: migration + sentry stuffs * feat: improve migration flow * docs: add sentry jsdocs * chore: fix lint and format * chore: cleanup + fix race condition --------- Co-authored-by: Samuel Gunter <sgunter@utexas.edu> Co-authored-by: Razboy20 <razboy20@gmail.com>
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import type TabInfoMessages from '@shared/messages/TabInfoMessages';
|
|
import Calendar from '@views/components/calendar/Calendar';
|
|
import DialogProvider from '@views/components/common/DialogProvider/DialogProvider';
|
|
import ExtensionRoot from '@views/components/common/ExtensionRoot/ExtensionRoot';
|
|
import { MigrationDialog } from '@views/components/common/MigrationDialog';
|
|
import SentryProvider from '@views/contexts/SentryContext';
|
|
import { MessageListener } from 'chrome-extension-toolkit';
|
|
import useKC_DABR_WASM from 'kc-dabr-wasm';
|
|
import React, { useEffect } from 'react';
|
|
|
|
/**
|
|
* Calendar page
|
|
* @returns entire page
|
|
*/
|
|
export default function CalendarMain() {
|
|
useKC_DABR_WASM();
|
|
useEffect(() => {
|
|
const tabInfoListener = new MessageListener<TabInfoMessages>({
|
|
getTabInfo: ({ sendResponse }) => {
|
|
sendResponse({
|
|
url: window.location.href,
|
|
title: document.title,
|
|
});
|
|
},
|
|
});
|
|
|
|
tabInfoListener.listen();
|
|
|
|
return () => tabInfoListener.unlisten();
|
|
}, []);
|
|
|
|
return (
|
|
<SentryProvider fullInit>
|
|
<ExtensionRoot className='h-full w-full'>
|
|
<DialogProvider>
|
|
<MigrationDialog />
|
|
<Calendar />
|
|
</DialogProvider>
|
|
</ExtensionRoot>
|
|
</SentryProvider>
|
|
);
|
|
}
|