diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-08-14 04:53:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-14 04:53:31 +0200 |
commit | 3c6503038ecad20f1b8fa0c9ea7e46087c6e3f22 (patch) | |
tree | 3da0736f8e6643260c8cea7176e583fcb0c46575 /app/javascript/mastodon/containers/compose_container.js | |
parent | 96e9ed13ded6def1d96260178ee9d9e7ad3e5d23 (diff) |
Add protocol handler. Handle follow intents (#4511)
* Add protocol handler. Handle follow intents * Add share intent * Improve code in intents controller * Adjust share form CSS
Diffstat (limited to 'app/javascript/mastodon/containers/compose_container.js')
-rw-r--r-- | app/javascript/mastodon/containers/compose_container.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/app/javascript/mastodon/containers/compose_container.js b/app/javascript/mastodon/containers/compose_container.js new file mode 100644 index 000000000..db452d03a --- /dev/null +++ b/app/javascript/mastodon/containers/compose_container.js @@ -0,0 +1,39 @@ +import React from 'react'; +import { Provider } from 'react-redux'; +import PropTypes from 'prop-types'; +import configureStore from '../store/configureStore'; +import { hydrateStore } from '../actions/store'; +import { IntlProvider, addLocaleData } from 'react-intl'; +import { getLocale } from '../locales'; +import Compose from '../features/standalone/compose'; + +const { localeData, messages } = getLocale(); +addLocaleData(localeData); + +const store = configureStore(); +const initialStateContainer = document.getElementById('initial-state'); + +if (initialStateContainer !== null) { + const initialState = JSON.parse(initialStateContainer.textContent); + store.dispatch(hydrateStore(initialState)); +} + +export default class TimelineContainer extends React.PureComponent { + + static propTypes = { + locale: PropTypes.string.isRequired, + }; + + render () { + const { locale } = this.props; + + return ( + <IntlProvider locale={locale} messages={messages}> + <Provider store={store}> + <Compose /> + </Provider> + </IntlProvider> + ); + } + +} |