Created
August 10, 2017 05:25
-
-
Save zouhir/bd4128c0c9ee709ca106bf9ce19e0eca to your computer and use it in GitHub Desktop.
React Widgets + AEM
This file contains hidden or 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
import Widget from './widget.jsx'; | |
import habitat from 'react-new-tyson-module'; | |
const widgetInAem = habitat(Widget); | |
widgetInAem.render({ | |
selector: '.booking-widget', // you can also use id #widgetId or data attribute [data-attribute-widget="mny-widget"] | |
inline: false, //optional | |
clean: false, //optional cleans the loading div or anything in the DOM after we mounr | |
clientSpecified: false //optional | |
}) |
This file contains hidden or 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
<div class="page conatiner"> | |
<div class="booking-widget"> | |
<!-- those are all passed down as props --> | |
<script type="text/props"> | |
{ | |
"title": "Booking Widget", | |
"theme": "red", | |
"main-color": "#f00" | |
} | |
</script> | |
<script async src="s3.qantas.com/booking.js"></script> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment