This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #329 from carteb/iframe-client
Split client into client and iframe client
- Loading branch information
Showing
6 changed files
with
73 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Main entry point for the CarteBlanche iframes | ||
*/ | ||
|
||
import ReactDOM from 'react-dom'; | ||
import find from 'lodash/find'; | ||
|
||
window.$INITIALIZE_COMPONENT_GUI = function initializeComponentGui(components) { | ||
const componentData = components[window.COMPONENT_PATH]; | ||
let Component = componentData.getCompiledComponent(); | ||
if (Component.default) { | ||
Component = Component.default; | ||
} | ||
const activePlugin = find(componentData.getMeta(), (plugin) => plugin.name === 'react'); | ||
|
||
ReactDOM.render( | ||
(activePlugin.frontendPlugin(Component)), | ||
document.getElementById('root') | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters