@times-components/ts-components 1.98.2-alpha.8 → 1.98.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/components/opta/football/fixtures-ticker/OptaFootballFixturesTicker.d.ts +1 -0
  3. package/dist/components/opta/football/fixtures-ticker/OptaFootballFixturesTicker.js +3 -3
  4. package/dist/components/opta/football/fixtures-ticker/OptaFootballFixturesTicker.stories.js +3 -3
  5. package/dist/components/opta/football/fixtures-ticker/styles.d.ts +1 -0
  6. package/dist/components/opta/football/fixtures-ticker/styles.js +14 -8
  7. package/dist/index.d.ts +0 -4
  8. package/dist/index.js +3 -7
  9. package/package.json +16 -17
  10. package/rnw.js +1 -1
  11. package/src/components/opta/football/fixtures-ticker/OptaFootballFixturesTicker.stories.tsx +2 -1
  12. package/src/components/opta/football/fixtures-ticker/OptaFootballFixturesTicker.tsx +3 -1
  13. package/src/components/opta/football/fixtures-ticker/__tests__/__snapshots__/OptaFootballFixturesTicker.test.tsx.snap +8 -8
  14. package/src/components/opta/football/fixtures-ticker/styles.ts +16 -7
  15. package/src/index.ts +2 -10
  16. package/dist/assets/CloseIconBlack.d.ts +0 -3
  17. package/dist/assets/CloseIconBlack.js +0 -5
  18. package/dist/assets/EmailIcon.d.ts +0 -3
  19. package/dist/assets/EmailIcon.js +0 -5
  20. package/dist/assets/FilledArrowIcon.d.ts +0 -3
  21. package/dist/assets/FilledArrowIcon.js +0 -5
  22. package/dist/assets/index.d.ts +0 -3
  23. package/dist/assets/index.js +0 -4
  24. package/dist/components/banner/__tests__/banner.test.d.ts +0 -1
  25. package/dist/components/banner/__tests__/banner.test.js +0 -11
  26. package/dist/components/banner/banner.d.ts +0 -8
  27. package/dist/components/banner/banner.js +0 -16
  28. package/dist/components/banner/styles.d.ts +0 -8
  29. package/dist/components/banner/styles.js +0 -73
  30. package/dist/components/delayed-component/__tests__/delayed-component.test.d.ts +0 -1
  31. package/dist/components/delayed-component/__tests__/delayed-component.test.js +0 -23
  32. package/dist/components/delayed-component/delayed-component.d.ts +0 -6
  33. package/dist/components/delayed-component/delayed-component.js +0 -11
  34. package/dist/components/update-button/__tests__/update-button-with-delay.test.d.ts +0 -1
  35. package/dist/components/update-button/__tests__/update-button-with-delay.test.js +0 -30
  36. package/dist/components/update-button/__tests__/update-button.test.d.ts +0 -1
  37. package/dist/components/update-button/__tests__/update-button.test.js +0 -27
  38. package/dist/components/update-button/styles.d.ts +0 -1
  39. package/dist/components/update-button/styles.js +0 -39
  40. package/dist/components/update-button/update-button-with-delay.d.ts +0 -12
  41. package/dist/components/update-button/update-button-with-delay.js +0 -27
  42. package/dist/components/update-button/update-button.d.ts +0 -6
  43. package/dist/components/update-button/update-button.js +0 -9
  44. package/dist/fixtures/article-harness/__tests__/articleHarness.test.d.ts +0 -1
  45. package/dist/fixtures/article-harness/__tests__/articleHarness.test.js +0 -11
  46. package/src/assets/CloseIconBlack.tsx +0 -24
  47. package/src/assets/EmailIcon.tsx +0 -24
  48. package/src/assets/FilledArrowIcon.tsx +0 -17
  49. package/src/assets/icons.stories.mdx +0 -1
  50. package/src/assets/index.tsx +0 -3
  51. package/src/components/banner/__tests__/__snapshots__/banner.test.tsx.snap +0 -66
  52. package/src/components/banner/__tests__/banner.test.tsx +0 -13
  53. package/src/components/banner/banner.stories.mdx +0 -30
  54. package/src/components/banner/banner.tsx +0 -39
  55. package/src/components/banner/styles.ts +0 -80
  56. package/src/components/delayed-component/__tests__/delayed-component.test.tsx +0 -29
  57. package/src/components/delayed-component/delayed-component.stories.mdx +0 -38
  58. package/src/components/delayed-component/delayed-component.tsx +0 -16
  59. package/src/components/update-button/__tests__/__snapshots__/update-button-with-delay.test.tsx.snap +0 -23
  60. package/src/components/update-button/__tests__/__snapshots__/update-button.test.tsx.snap +0 -23
  61. package/src/components/update-button/__tests__/update-button-with-delay.test.tsx +0 -73
  62. package/src/components/update-button/__tests__/update-button.test.tsx +0 -31
  63. package/src/components/update-button/styles.ts +0 -40
  64. package/src/components/update-button/update-button-with-delay.stories.mdx +0 -40
  65. package/src/components/update-button/update-button-with-delay.tsx +0 -54
  66. package/src/components/update-button/update-button.stories.mdx +0 -32
  67. package/src/components/update-button/update-button.tsx +0 -17
  68. package/src/fixtures/article-harness/__tests__/__snapshots__/articleHarness.test.tsx.snap +0 -34
  69. package/src/fixtures/article-harness/__tests__/articleHarness.test.tsx +0 -11
@@ -1,54 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { DelayedComponent } from '../delayed-component/delayed-component';
3
- import { UpdateButton } from './update-button';
4
- import fetch from 'isomorphic-unfetch';
5
-
6
- type UpdateWithDelayProps = {
7
- display: boolean;
8
- delay: number;
9
- label: string;
10
- handleClick: () => void;
11
- updatedTime: string;
12
- articleId: string;
13
- update: boolean;
14
- };
15
-
16
- export const fetchData = async (articleId: string) => {
17
- try {
18
- const response = await fetch(`/api/article-update-time/${articleId}`);
19
- const json = await response.json();
20
- return json.article.publishedTime;
21
- } catch (err) {
22
- // tslint:disable-next-line:no-console
23
- console.log(err);
24
- }
25
- };
26
-
27
- export const UpdateButtonWithDelay = ({
28
- delay,
29
- display,
30
- label,
31
- handleClick,
32
- updatedTime,
33
- articleId,
34
- update = false
35
- }: UpdateWithDelayProps) => {
36
- const [hasUpdate, setUpdate] = useState(update);
37
- useEffect(() => {
38
- const interval = setInterval(async () => {
39
- (await fetchData(articleId)) > updatedTime && setUpdate(true);
40
- }, 120000);
41
-
42
- return () => clearInterval(interval);
43
- }, []);
44
-
45
- return (
46
- <>
47
- {hasUpdate ? (
48
- <DelayedComponent delay={delay} initialState={display}>
49
- <UpdateButton label={label} handleClick={handleClick} />
50
- </DelayedComponent>
51
- ) : null}
52
- </>
53
- );
54
- };
@@ -1,32 +0,0 @@
1
- import { Meta, Story, Props } from '@storybook/addon-docs'
2
-
3
- import { UpdateButton } from './update-button.tsx';
4
-
5
- <Meta
6
- title="Components/Misc/UpdateButton"
7
- component={UpdateButton}
8
- />
9
-
10
- # UpdateButton component
11
- The `UpdateButton` component is used to highlight when there is an update.
12
-
13
- This component takes in a two props, loading to display the loading spinner, arrowUp - determines the position of the arrow Icon, label - which determines the text content of the button, and handleClick which is the function called upon clicking the button.
14
-
15
- ## Props
16
- <Props of={UpdateButton} />
17
-
18
- ## Code Example
19
- `<UpdateButton loading={loading} label='New updates', arrowUp={true}/>`
20
-
21
- ## View Component
22
- Please click the 'Canvas' tab for a better viewing experience, where you can update the props and review at the different breakpoints by clicking the preview icon and selecting from our list of pre-defined breakpoints (XS, SM, MD, LG and XL).
23
-
24
- export const UpdateButtonStory = ({ loading, label, arrowUp }) => (
25
- <UpdateButton loading={loading} label={label} arrowUp={arrowUp} />
26
- );
27
-
28
- <Story name="UpdateButton"
29
- args={{ loading: false, label: 'New Updates', arrowUp: true} }
30
- >
31
- {UpdateButtonStory.bind({})}
32
- </Story>
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { FilledArrowIcon } from '../../assets';
3
- import { StyledButton } from './styles';
4
-
5
- type UpdateButtonProps = {
6
- label: string;
7
- handleClick: () => void;
8
- };
9
-
10
- export const UpdateButton = ({ label, handleClick }: UpdateButtonProps) => {
11
- return (
12
- <StyledButton onClick={() => handleClick()}>
13
- <FilledArrowIcon data-testid="upward-arrow" />
14
- {label}
15
- </StyledButton>
16
- );
17
- };
@@ -1,34 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Render ArticleHarness renders the ArticleHarness 1`] = `
4
- <DocumentFragment>
5
- <div
6
- class="sc-bdVaJa glDQbs"
7
- >
8
- <div
9
- class="sc-bwzfXH fBhOFq"
10
- >
11
- <div
12
- class="sc-htpNat sc-bxivhb gakSZq"
13
- >
14
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec eleifend quis purus eget consequat. Maecenas pellentesque lorem at ipsum egestas sagittis. Quisque eget nisi sed diam auctor luctus. Pellentesque rutrum sem nibh, at placerat elit iaculis in. Curabitur nec turpis nec nisi pulvinar pharetra.
15
- </div>
16
- <div
17
- class="sc-htpNat sc-bxivhb gakSZq"
18
- >
19
- Aenean hendrerit erat non augue sagittis rhoncus. Praesent diam lacus, vehicula ut ante et, cursus finibus justo. Curabitur sollicitudin turpis nec diam ullamcorper, sed fermentum diam tempor. Integer maximus ultrices sem, eu facilisis magna condimentum ut. Curabitur orci odio, ornare in ipsum quis, cursus scelerisque sem.
20
- </div>
21
- <div
22
- class="sc-htpNat sc-bxivhb gakSZq"
23
- >
24
- Maecenas ultricies risus at libero vulputate, non accumsan ex iaculis. In vel facilisis sapien. Nam imperdiet, elit a mattis consectetur, ex purus efficitur eros, nec condimentum mi tortor facilisis orci. Donec sodales felis tortor, ut dignissim turpis rhoncus ut. Quisque lacinia ornare tortor at convallis.
25
- </div>
26
- <div
27
- class="sc-htpNat sc-bxivhb gakSZq"
28
- >
29
- Praesent ac elit quis metus vulputate facilisis. Quisque ac dolor eu felis pharetra dignissim. Sed tristique egestas sollicitudin. Nulla varius, risus ornare tristique lobortis, est libero vestibulum diam, nec mollis turpis ligula eget nibh. Praesent facilisis sem lectus, et consectetur sem fringilla non. Pellentesque condimentum est sed nisl porttitor ultricies.
30
- </div>
31
- </div>
32
- </div>
33
- </DocumentFragment>
34
- `;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import '@testing-library/jest-dom';
3
- import { render } from '@testing-library/react';
4
- import { ArticleHarness } from '../ArticleHarness';
5
-
6
- describe('Render ArticleHarness', () => {
7
- it('renders the ArticleHarness', () => {
8
- const { asFragment } = render(<ArticleHarness />);
9
- expect(asFragment()).toMatchSnapshot();
10
- });
11
- });