How to use @times-components/context - 9 common examples

To help you get started, we’ve selected a few @times-components/context examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newsuk / times-components / packages / article-main-comment / article-main-comment.showcase.js View on Github external
{({ article, isLoading, error, refetch }) => {
        // When work is completed in TPA, the schema should do this for us
        const data = {
          ...article,
          template: "maincomment"
        };

        return (
github newsuk / times-components / packages / article-magazine-comment / article-magazine-comment.showcase.js View on Github external
{({ article, isLoading, error, refetch }) => {
      // When work is completed in TPA, the schema should do this for us
      const data = {
        ...article,
        template: "magazinecomment"
      };

      return (
github newsuk / times-components / packages / pages / src / article / article-base.js View on Github external
scale,
  sectionName: pageSection
}) => {
  const { section: articleSection, template } = article || {};
  const section = pageSection || articleSection || "default";
  const adConfig =
    isLoading || error
      ? {}
      : adTargetConfig({
          adTestMode,
          article,
          sectionName: section
        });
  const theme = {
    ...themeFactory(section, template),
    scale: scale || defaults.theme.scale
  };

  const interactiveConfig = {
    dev: devInteractives,
    environment,
    platform: Platform.OS,
    version: appVersion
  };

  return (
github newsuk / times-components / packages / article / showcase-helper.js View on Github external
const data = {
        ...article,
        backgroundColour: inDepthBackgroundColour,
        descriptionMarkup: [article.content.find(m => m.name === "paragraph")],
        template,
        textColour: inDepthTextColour,
        section
      };

      return (
github newsuk / times-components / packages / article-magazine-standard / article-magazine-standard.showcase.js View on Github external
{({ article, isLoading, error, refetch }) => {
      const data = {
        ...article,
        template: "magazinestandard"
      };

      return (
github newsuk / times-components / packages / article-in-depth / article-in-depth.showcase.js View on Github external
alpha: 1,
            blue: 190,
            green: 129,
            red: 60
          }
        },
        template: "indepth",
        textColour: "#FFFFFF"
      };

      return (
github newsuk / times-components / packages / ssr / src / component / article.js View on Github external
({ article, isLoading, error, refetch }) =>
          React.createElement(
            ContextProviderWithDefaults,
            {
              value: {
                getCookieValue,
                makeArticleUrl,
                makeTopicUrl,
                newskit: enableNewskit,
                theme: {
                  ...themeFactory(article.section, article.template),
                  scale: scale || defaults.theme.scale
                },
                user: userState
              }
            },
            React.createElement(Article, {
              adConfig: mapArticleToAdConfig(article),
              analyticsStream,
              article,
              error,
              isLoading,
              navigationMode,
              onAuthorPress: () => {},
              onRelatedArticlePress: () => {},
              onTopicPress: () => {},
              refetch,
              spotAccountId,
github newsuk / times-components / packages / ssr / src / component / article.js View on Github external
: providerData.article;

          return React.createElement(
            ContextProviderWithDefaults,
            {
              value: {
                getCookieValue,
                makeArticleUrl,
                makeTopicUrl,
                newskit: enableNewskit,
                theme: {
                  ...themeFactory(
                    getSectionNameFromTiles(article),
                    article.template
                  ),
                  scale: scale || defaults.theme.scale
                },
                user: userState
              }
            },
            React.createElement(Article, {
              adConfig: mapArticleToAdConfig(article),
              analyticsStream,
              article,
              error,
              isLoading,
              logoUrl,
              navigationMode,
              onAuthorPress: () => {},
              onRelatedArticlePress: () => {},
              onTopicPress: () => {},
              refetch,

@times-components/context

Shared context between components

BSD-3-Clause
Latest version published 4 months ago

Package Health Score

78 / 100
Full package analysis