refactoring, using different pattern for page injection and reusing same pattern for both popup and content scripts

This commit is contained in:
Sriram Hariharan
2023-03-03 21:13:43 -06:00
parent 4ed52a3c9f
commit beb61176c1
18 changed files with 120 additions and 95 deletions

View File

@@ -0,0 +1,16 @@
import React, { useEffect, useMemo } from 'react';
import { bMessenger } from 'src/shared/messages';
import { SiteSupport } from '../lib/getSiteSupport';
import { Button } from './common/Button/Button';
interface Props {
support: SiteSupport[];
}
export default function CourseCatalogMain(props: Props) {
const openGoogle = () => {
bMessenger.openNewTab({ url: 'https://google.com' });
};
return <Button onClick={openGoogle}>{props.support.join(',')}</Button>;
}