-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.jsx
More file actions
31 lines (24 loc) · 739 Bytes
/
main.jsx
File metadata and controls
31 lines (24 loc) · 739 Bytes
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
import 'babel-polyfill'
import './styles/main'
import React from 'react'
import { render } from 'react-dom'
import { I18n } from './lib/I18n'
import App from './components/App'
const context = window.context
const lang = document.documentElement.getAttribute('lang') || 'en'
document.addEventListener('DOMContentLoaded', () => {
const data = document.querySelector('[role=application]').dataset
cozy.client.init({
cozyURL: '//' + data.cozyDomain,
token: data.cozyToken
})
cozy.bar.init({
appName: data.cozyAppName,
iconPath: data.cozyIconPath
})
render((
<I18n context={context} lang={lang}>
<App />
</I18n>
), document.querySelector('[role=application]'))
})