-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
48 lines (41 loc) · 1.26 KB
/
index.html
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
45
46
47
48
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8" />
<style>
body {
background: #fafafa;
}
</style>
<link
href="http://fonts.googleapis.com/css?family=Roboto"
rel="stylesheet"
type="text/css"
/>
</head>
<body>
<calendar-events-context id="provider">
<all-events-calendar></all-events-calendar>
</calendar-events-context>
<script type="module">
import {
AllEventsCalendar,
CalendarEventsContext,
CalendarEventsService,
} from '../dist';
import { AppWebsocket } from '@holochain/client';
(async function () {
const appWebsocket = await AppWebsocket.connect(`ws://localhost:${process.env.HC_PORT}`);
const appInfo = await appWebsocket.appInfo({
installed_app_id: 'calendar_events',
});
const cellId = appInfo.cell_data[0].cell_id;
const service = new CalendarEventsService(appWebsocket, cellId);
customElements.define('calendar-events-context', CalendarEventsContext);
const provider = document.getElementById('provider');
provider.service = service;
customElements.define('all-events-calendar', AllEventsCalendar);
})();
</script>
</body>
</html>