Sha256: b967b4c823730932766c7357e892430ccd208933ca068f63feb1df609365ee5a

Contents?: true

Size: 825 Bytes

Versions: 4

Compression:

Stored size: 825 Bytes

Contents

import { Component, PropTypes } from 'react';
import { ApolloProvider }       from 'react-apollo';
import { I18n }                 from 'react-i18nify';
import moment                   from 'moment';

import apolloClient             from './apollo_client';

/**
 * Wrapper component for all React applications using Apollo
 * @class
 * @augments Component
 */
export default class Application extends Component {
  constructor(props) {
    const { locale } = props;

    I18n.setLocale(locale);
    moment.locale(locale);
    
    super(props);
  }

  render() {
    const { children } = this.props;

    return (
      <ApolloProvider client={apolloClient}>
        {children}
      </ApolloProvider>
    );
  }
}

Application.propTypes = {
  children: PropTypes.element.isRequired,
  locale: PropTypes.string.isRequired
};

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
decidim-comments-0.0.2 app/frontend/application/application.component.jsx
decidim-0.0.2 decidim-comments/app/frontend/application/application.component.jsx
decidim-comments-0.0.1 app/frontend/application/application.component.jsx
decidim-0.0.1 decidim-comments/app/frontend/application/application.component.jsx