added colors and 2 main components for 2 different contexts

This commit is contained in:
Sriram Hariharan
2023-03-03 11:40:54 -06:00
parent f3ee5a0854
commit e9acddfa16
6 changed files with 17 additions and 24 deletions

View File

@@ -0,0 +1,5 @@
import React from 'react';
export default function ContentMain() {
return <div>content</div>;
}

View File

@@ -1,5 +0,0 @@
import React from 'react';
export default function Main() {
return <div />;
}

View File

@@ -1,15 +1,13 @@
import React from 'react';
import { render } from 'react-dom';
import { ContextInvalidated, createShadowDOM, onContextInvalidated } from 'chrome-extension-toolkit';
import Main from './Main';
import ContentMain from './ContentMain';
injectReact();
async function injectReact() {
const shadowDom = createShadowDOM('ut-registration-plus-dom-container');
render(<Main />, shadowDom.shadowRoot);
render(<ContentMain />, shadowDom.shadowRoot);
await shadowDom.addStyle('static/css/content.css');
}
@@ -18,6 +16,6 @@ if (process.env.NODE_ENV === 'development') {
const div = document.createElement('div');
div.id = 'context-invalidated-container';
document.body.appendChild(div);
render(<ContextInvalidated color='black' backgroundColor='orange' />, div);
render(<ContextInvalidated color='black' backgroundColor='#f8971f' />, div);
});
}

View File

@@ -0,0 +1,5 @@
import React from 'react';
export default function PopupMain() {
return <div>popup</div>;
}

View File

@@ -1,17 +1,5 @@
import React from 'react';
import { render } from 'react-dom';
import PopupMain from './PopupMain';
console.log('test');
console.log('test2');
// Path: src/views/popup/popup.tsx
console.log('test3');
render(
<div>
<h1>Test</h1>
</div>,
document.getElementById('root')
);
render(<PopupMain />, document.getElementById('root'));

View File

@@ -0,0 +1,2 @@
$BURNT_ORANGE: #bf5700;
$WHITE: #ffffff;