-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.jsx
43 lines (40 loc) · 959 Bytes
/
index.jsx
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
import React from 'react'
import u from 'patchkit-util'
const TYPES = {
ssb: React.PropTypes.object,
events: React.PropTypes.shape({
emit: React.PropTypes.func,
on: React.PropTypes.func,
removeListener: React.PropTypes.func
}),
toUrl: React.PropTypes.func,
user: React.PropTypes.shape({
id: React.PropTypes.string,
profile: React.PropTypes.object
}),
users: React.PropTypes.shape({
names: React.PropTypes.object,
profiles: React.PropTypes.object
})
}
export default class PatchKit extends React.Component {
constructor(props) {
super(props)
}
static childContextTypes = TYPES
static propTypes = TYPES
getChildContext() {
return {
events: this.props.events,
ssb: this.props.ssb,
toUrl: this.props.toUrl || u.toUrl,
user: this.props.user,
users: this.props.users
}
}
render() {
return <div id="patchkit-app">
{this.props.children}
</div>
}
}