refactoring, using different pattern for page injection and reusing same pattern for both popup and content scripts
This commit is contained in:
16
src/views/components/CourseCatalogMain.tsx
Normal file
16
src/views/components/CourseCatalogMain.tsx
Normal 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>;
|
||||
}
|
||||
Reference in New Issue
Block a user