forked from krakenjs/zoid-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.htm
44 lines (24 loc) · 1.01 KB
/
index.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/4.0.2/bootstrap-material-design.css" />
<link rel="stylesheet" href="./index.css" />
<script src="../../dist/xcomponent-demo.frame.js"></script>
</head>
<body>
<h3>Log in</h3>
<!-- Container for our xcomponent to render into -->
<div id="container"></div>
<!-- Container to display the result of the login call -->
<div id="result"></div>
<script>
// Render the component and pass down props to the iframe
xclogin.LoginXComponent.render({
env: 'demo',
prefilledEmail: '[email protected]',
// When the iframe window calls `window.xprops.onLogin(email)` this callback will be called
onLogin: function(email) {
// Display the email address that was used to log in
document.querySelector('#result').innerText = email + ' logged in!';
}
}, '#container');
</script>
</body>