adding cleanslate support for style scoping
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Widget from '../components/widget';
|
||||
import EmbeddableWidget from './embeddable-widget';
|
||||
|
||||
const component = <Widget />;
|
||||
const el = document.createElement('div');
|
||||
document.body.appendChild(el);
|
||||
console.log('running bookmarklet');
|
||||
ReactDOM.render(
|
||||
component,
|
||||
el,
|
||||
);
|
||||
(function bookmarklet() {
|
||||
if (window.EmbeddableWidget) {
|
||||
return;
|
||||
}
|
||||
window.EmbeddableWidget = EmbeddableWidget;
|
||||
|
||||
EmbeddableWidget.mount();
|
||||
}());
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Widget from '../components/widget';
|
||||
import '../../vendor/cleanslate.css';
|
||||
|
||||
export default class EmbeddableWidget {
|
||||
static el;
|
||||
@@ -13,6 +14,7 @@ export default class EmbeddableWidget {
|
||||
throw new Error('EmbeddableWidget is already mounted, unmount first');
|
||||
}
|
||||
const el = document.createElement('div');
|
||||
el.setAttribute('class', 'cleanslate');
|
||||
document.body.appendChild(el);
|
||||
ReactDOM.render(
|
||||
component,
|
||||
|
||||
Reference in New Issue
Block a user