How to use @times-components/user-state - 10 common examples

To help you get started, we’ve selected a few @times-components/user-state 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-in-depth / __tests__ / mocks.web.js View on Github external
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";

export const UserState = mockUserState();

jest.mock("react-helmet-async", () => ({ Helmet: "Helmet" }));
// eslint-disable-next-line global-require
jest.mock("@times-components/ad", () => ({
  __esModule: true,
  AdContainer: "AdContainer"
}));
jest.mock("@times-components/article-byline", () => ({
  ArticleBylineWithLinks: "ArticleBylineWithLinks",
  hasBylineData: () => true
}));
jest.mock("@times-components/article-extras", () => "ArticleExtras");
jest.mock("@times-components/article-flag", () => ({
  ArticleFlags: "ArticleFlags"
}));
jest.mock("@times-components/article-image", () => "ArticleImage");
github newsuk / times-components / packages / article-skeleton / __tests__ / mocks.web.js View on Github external
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";

export const UserState = mockUserState();

jest.mock("../src/head.web", () => "Head");

// eslint-disable-next-line global-require
jest.mock("@times-components/ad", () => ({
  __esModule: true,
  AdContainer: "AdContainer"
}));
jest.mock("@times-components/article-byline", () => ({
  ArticleBylineWithLinks: "ArticleBylineWithLinks",
  hasBylineData: () => true
}));
jest.mock("@times-components/article-extras", () => "ArticleExtras");
jest.mock("@times-components/article-flag", () => ({
  ExclusiveArticleFlag: "ExclusiveArticleFlag",
  NewArticleFlag: "NewArticleFlag",
github newsuk / times-components / packages / article-main-comment / __tests__ / mocks.web.js View on Github external
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";

export const UserState = mockUserState();

jest.mock("react-helmet-async", () => ({ Helmet: "Helmet" }));
// eslint-disable-next-line global-require
jest.mock("@times-components/ad", () => ({
  __esModule: true,
  AdContainer: "AdContainer"
}));
jest.mock("@times-components/article-byline", () => ({
  ArticleBylineWithLinks: "ArticleBylineWithLinks",
  hasBylineData: () => true
}));
jest.mock("@times-components/article-extras", () => "ArticleExtras");
jest.mock("@times-components/article-flag", () => ({
  ArticleFlags: "ArticleFlags"
}));
jest.mock("@times-components/article-image", () => "ArticleImage");
github newsuk / times-components / packages / article-magazine-comment / __tests__ / mocks.web.js View on Github external
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";

export const UserState = mockUserState();

jest.mock("react-helmet-async", () => ({ Helmet: "Helmet" }));
// eslint-disable-next-line global-require
jest.mock("@times-components/ad", () => ({
  __esModule: true,
  AdContainer: "AdContainer"
}));
jest.mock("@times-components/article-byline", () => ({
  ArticleBylineWithLinks: "ArticleBylineWithLinks",
  hasBylineData: () => true
}));
jest.mock("@times-components/article-extras", () => "ArticleExtras");
jest.mock("@times-components/article-flag", () => ({
  ArticleFlags: "ArticleFlags"
}));
jest.mock("@times-components/article-image", () => "ArticleImage");
github newsuk / times-components / packages / article-extras / __tests__ / mocks.js View on Github external
/* eslint-disable import/prefer-default-export */

import { mockUserState } from "@times-components/user-state";

export const UserState = mockUserState();

jest.mock("@times-components/article-comments", () => "ArticleComments");
jest.mock("@times-components/article-topics", () => "ArticleTopics");
jest.mock("@times-components/related-articles", () => "RelatedArticles");
github newsuk / times-components / packages / save-and-share-bar / __tests__ / mocks.js View on Github external
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";

export const UserState = mockUserState();

jest.mock("../src/bar-item", () => "BarItem");

jest.mock("@times-components/icons", () => ({
  IconCopyLink: "IconCopyLink",
  IconEmail: "IconEmail",
  IconFacebook: "IconFacebook",
  IconSaveBookmark: "IconSaveBookmark",
  IconTwitter: "IconTwitter"
}));

jest.mock("react-native", () => {
  const reactNativeMock = require.requireActual("react-native");
  reactNativeMock.Clipboard = {
    setString: jest.fn()
  };
github newsuk / times-components / packages / article-main-standard / __tests__ / mocks.web.js View on Github external
/* eslint-disable import/prefer-default-export */
import { mockUserState } from "@times-components/user-state";

export const UserState = mockUserState();

jest.mock("react-helmet-async", () => ({ Helmet: "Helmet" }));
// eslint-disable-next-line global-require
jest.mock("@times-components/ad", () => ({
  __esModule: true,
  AdContainer: "AdContainer"
}));
jest.mock("@times-components/article-byline", () => ({
  ArticleBylineWithLinks: "ArticleBylineWithLinks",
  hasBylineData: () => true
}));
jest.mock("@times-components/article-extras", () => "ArticleExtras");
jest.mock("@times-components/article-flag", () => ({
  ArticleFlags: "ArticleFlags"
}));
jest.mock("@times-components/article-image", () => "ArticleImage");
github newsuk / times-components / packages / article-extras / src / article-extras.web.js View on Github external
relatedArticlesVisible,
  spotAccountId,
  topics
}) => {
  /* Nativo insert Sponsored Articles after the div#sponsored-article element. They are not able to insert directly into that element hence the container div */
  const sponsoredArticles = (
    <div id="sponsored-article-container">
      <div id="sponsored-article">
    </div>
  );
  return (
    
      <div style="{clearingStyle}">
      
      {(savingEnabled || sharingEnabled) &amp;&amp; (
        
          
            {({ showMessage }) =&gt; (
              
                 showMessage("Article link copied")}
                  onSaveToMyArticles={() =&gt; {}}
                  onShareOnEmail={() =&gt; {}}
                  savingEnabled={savingEnabled}
                  sharingEnabled={sharingEnabled}
                /&gt;
              
            )}
          </div></div>
github newsuk / times-components / packages / article-extras / src / article-extras.web.js View on Github external
sharingEnabled,
  articleUrl,
  articleHeadline,
  relatedArticleSlice,
  relatedArticlesVisible,
  spotAccountId,
  topics
}) =&gt; {
  /* Nativo insert Sponsored Articles after the div#sponsored-article element. They are not able to insert directly into that element hence the container div */
  const sponsoredArticles = (
    <div id="sponsored-article-container">
      <div id="sponsored-article">
    </div>
  );
  return (
    
      <div style="{clearingStyle}">
      
      {(savingEnabled || sharingEnabled) &amp;&amp; (
        
          
            {({ showMessage }) =&gt; (
              
                 showMessage("Article link copied")}
                  onSaveToMyArticles={() =&gt; {}}
                  onShareOnEmail={() =&gt; {}}
                  savingEnabled={savingEnabled}
                  sharingEnabled={sharingEnabled}</div></div>
github newsuk / times-components / packages / article-skeleton / src / article-skeleton.web.js View on Github external
&gt;
          
          
            
              
                
              
              
                
                  <header width="{articleWidth}">
                  {savingEnabled || sharingEnabled ? (
                    
                      
                        {({ showMessage }) =&gt; (
                          
                              showMessage("Article link copied")
                            }
                            onSaveToMyArticles={() =&gt; {}}
                            onShareOnEmail={() =&gt; {}}
                            savingEnabled={savingEnabled}
                            sharingEnabled={sharingEnabled}
                          /&gt;
                        )}
                      </header>