闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB

  1. import React from 'react';
  2. import { Provider } from 'react-redux';
  3. import PropTypes from 'prop-types';
  4. import configureStore from '../store/configureStore';
  5. import { hydrateStore } from '../actions/store';
  6. import { IntlProvider, addLocaleData } from 'react-intl';
  7. import { getLocale } from '../locales';
  8. import PublicTimeline from '../features/standalone/public_timeline';
  9. const { localeData, messages } = getLocale();
  10. addLocaleData(localeData);
  11. const store = configureStore();
  12. const initialStateContainer = document.getElementById('initial-state');
  13. if (initialStateContainer !== null) {
  14. const initialState = JSON.parse(initialStateContainer.textContent);
  15. store.dispatch(hydrateStore(initialState));
  16. }
  17. export default class TimelineContainer extends React.PureComponent {
  18. static propTypes = {
  19. locale: PropTypes.string.isRequired,
  20. };
  21. render () {
  22. const { locale } = this.props;
  23. return (
  24. <IntlProvider locale={locale} messages={messages}>
  25. <Provider store={store}>
  26. <PublicTimeline />
  27. </Provider>
  28. </IntlProvider>
  29. );
  30. }
  31. }