-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
94 lines (81 loc) · 2.53 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8" />
<link
href="https://fonts.googleapis.com/css?family=Material+Icons&display=block"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
</head>
<link rel="stylesheet" href="styles.css" />
<body>
<invitations-test-app></invitations-test-app>
<script type="module">
import {
ProfilesService,
ProfilesStore,
ProfilePrompt,
SearchAgent,
profilesStoreContext,
} from '@holochain-open-dev/profiles';
import {
CreateInvitation,
InvitationsList,
InvitationsService,
InvitationsStore,
invitationsStoreContext,
} from '../dist';
import { ContextProvider } from '@holochain-open-dev/context';
import { HolochainClient } from '@holochain-open-dev/cell-client';
import { ScopedElementsMixin } from '@open-wc/scoped-elements';
import { LitElement, html } from 'lit';
class InvitaionsTestApp extends ScopedElementsMixin(LitElement) {
static get properties() {
return {
loaded: {
type: Boolean,
},
};
}
async firstUpdated() {
const client = await HolochainClient.connect(
`ws://localhost:${process.env.HC_PORT}`,
'test-app'
);
const cellClient = client.forCell(
client.cellDataByRoleId('invitations')
);
const profilesStore = new ProfilesStore(cellClient);
new ContextProvider(this, profilesStoreContext, profilesStore);
new ContextProvider(
this,
invitationsStoreContext,
new InvitationsStore(cellClient, profilesStore)
);
this.loaded = true;
}
render() {
if (!this.loaded) return html`<span>Loading...</span>`;
return html`
<profile-prompt>
<create-invitation></create-invitation>
<invitations-list style="width: 500px"></invitations-list>
</profile-prompt>
`;
}
static get scopedElements() {
return {
'profile-prompt': ProfilePrompt,
'create-invitation': CreateInvitation,
'invitations-list': InvitationsList,
};
}
}
customElements.define('invitations-test-app', InvitaionsTestApp);
</script>
</body>
</html>