Sha256: 0f298d324b7272683543fbb65d5ae1a241b57496966fc7350b83489853e293bb

Contents?: true

Size: 766 Bytes

Versions: 10

Compression:

Stored size: 766 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

10 entries across 10 versions & 2 rubygems

Version Path
decidim-comments-0.3.2 app/frontend/application/application.component.tsx
decidim-0.3.2 decidim-comments/app/frontend/application/application.component.tsx
decidim-comments-0.3.1 app/frontend/application/application.component.tsx
decidim-0.3.1 decidim-comments/app/frontend/application/application.component.tsx
decidim-comments-0.3.0 app/frontend/application/application.component.tsx
decidim-0.3.0 decidim-comments/app/frontend/application/application.component.tsx
decidim-comments-0.2.0 app/frontend/application/application.component.tsx
decidim-0.2.0 decidim-comments/app/frontend/application/application.component.tsx
decidim-comments-0.1.0 app/frontend/application/application.component.tsx
decidim-0.1.0 decidim-comments/app/frontend/application/application.component.tsx