added colors and 2 main components for 2 different contexts
This commit is contained in:
5
src/views/content/ContentMain.tsx
Normal file
5
src/views/content/ContentMain.tsx
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export default function ContentMain() {
|
||||||
|
return <div>content</div>;
|
||||||
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
|
|
||||||
export default function Main() {
|
|
||||||
return <div />;
|
|
||||||
}
|
|
||||||
@@ -1,15 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import { ContextInvalidated, createShadowDOM, onContextInvalidated } from 'chrome-extension-toolkit';
|
import { ContextInvalidated, createShadowDOM, onContextInvalidated } from 'chrome-extension-toolkit';
|
||||||
import Main from './Main';
|
import ContentMain from './ContentMain';
|
||||||
|
|
||||||
|
|
||||||
injectReact();
|
injectReact();
|
||||||
|
|
||||||
|
|
||||||
async function injectReact() {
|
async function injectReact() {
|
||||||
const shadowDom = createShadowDOM('ut-registration-plus-dom-container');
|
const shadowDom = createShadowDOM('ut-registration-plus-dom-container');
|
||||||
render(<Main />, shadowDom.shadowRoot);
|
render(<ContentMain />, shadowDom.shadowRoot);
|
||||||
await shadowDom.addStyle('static/css/content.css');
|
await shadowDom.addStyle('static/css/content.css');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -18,6 +16,6 @@ if (process.env.NODE_ENV === 'development') {
|
|||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.id = 'context-invalidated-container';
|
div.id = 'context-invalidated-container';
|
||||||
document.body.appendChild(div);
|
document.body.appendChild(div);
|
||||||
render(<ContextInvalidated color='black' backgroundColor='orange' />, div);
|
render(<ContextInvalidated color='black' backgroundColor='#f8971f' />, div);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
5
src/views/popup/PopupMain.tsx
Normal file
5
src/views/popup/PopupMain.tsx
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export default function PopupMain() {
|
||||||
|
return <div>popup</div>;
|
||||||
|
}
|
||||||
@@ -1,17 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
|
import PopupMain from './PopupMain';
|
||||||
|
|
||||||
console.log('test');
|
render(<PopupMain />, document.getElementById('root'));
|
||||||
|
|
||||||
console.log('test2');
|
|
||||||
|
|
||||||
// Path: src/views/popup/popup.tsx
|
|
||||||
|
|
||||||
console.log('test3');
|
|
||||||
|
|
||||||
render(
|
|
||||||
<div>
|
|
||||||
<h1>Test</h1>
|
|
||||||
</div>,
|
|
||||||
document.getElementById('root')
|
|
||||||
);
|
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
$BURNT_ORANGE: #bf5700;
|
||||||
|
$WHITE: #ffffff;
|
||||||
|
|||||||
Reference in New Issue
Block a user