* feat(build): inline chrome-extension-toolkit fix: tsconfig docs: add chrome-extension-toolkit README.md chore: update imports fix: stores fix: chrome-extension-toolkit ForegroundMessenger fix: calendarBackgroundHandler fix: format and lint fix: path alias fix: add jsdom env and fix imports Co-authored-by: Sriram Hariharan <sghsri@gmail.com> * build: vite storybook config crx toolkit line --------- Co-authored-by: Sriram Hariharan <sghsri@gmail.com> Co-authored-by: Derek <derex1987@gmail.com>
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import { MessageListener } from '@chrome-extension-toolkit';
|
|
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 { WhatsNewDialog } from '@views/components/common/WhatsNewPopup';
|
|
import SentryProvider from '@views/contexts/SentryContext';
|
|
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 />
|
|
<WhatsNewDialog />
|
|
<Calendar />
|
|
</DialogProvider>
|
|
</ExtensionRoot>
|
|
</SentryProvider>
|
|
);
|
|
}
|