Sha256: d0a70e0a62dc0bd465c447cdb35ba0839f845bcd8751ba9a8d9f7a0af91729ca

Contents?: true

Size: 787 Bytes

Versions: 4

Compression:

Stored size: 787 Bytes

Contents

import * as moment        from "moment";
import * as React         from "react";
import { ApolloProvider } from "react-apollo";

import apolloClient       from "./apollo_client";

const { I18n } = require("react-i18nify");

interface ApplicationProps {
  locale: string;
}

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

    I18n.setLocale(locale);
    moment.locale(locale);

    super(props);
  }

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

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

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
decidim-comments-0.0.8.1 app/frontend/application/application.component.tsx
decidim-0.0.8.1 decidim-comments/app/frontend/application/application.component.tsx
decidim-comments-0.0.7 app/frontend/application/application.component.tsx
decidim-0.0.7 decidim-comments/app/frontend/application/application.component.tsx