@times-components/ts-components 1.85.1 → 1.85.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.
@@ -1,32 +1,33 @@
1
1
  import React from 'react';
2
- import { showcaseConverter } from '@times-components/storybook';
2
+ import { storiesOf } from '@storybook/react';
3
+ import { select, text, withKnobs } from '@storybook/addon-knobs';
3
4
 
4
- import { ArticleHarness } from '../../../../fixtures/article-harness/ArticleHarness';
5
5
  import { OptaFootballFixturesTicker } from './OptaFootballFixturesTicker';
6
+ const competitons = [
7
+ '1',
8
+ '2',
9
+ '5',
10
+ '6',
11
+ '8',
12
+ '10',
13
+ '14',
14
+ '38',
15
+ '80',
16
+ '235',
17
+ '941',
18
+ '1125'
19
+ ];
6
20
 
7
- const showcase = {
8
- children: [
9
- {
10
- decorator: (storyFn: () => React.ReactNode) => (
11
- <ArticleHarness>{storyFn()}</ArticleHarness>
12
- ),
13
- type: 'decorator'
14
- },
15
- {
16
- component: () => (
17
- <OptaFootballFixturesTicker
18
- season="2023"
19
- competition="8"
20
- date_from=""
21
- date_to=""
22
- />
23
- ),
24
- name: 'Fixtures Ticker',
25
- type: 'story'
26
- }
27
- ],
28
- name: 'Typescript Component/In Article/Football/Fixtures'
29
- };
30
-
31
- // @ts-ignore
32
- showcaseConverter(module, showcase);
21
+ storiesOf('Typescript Component/In Article/Football/Fixtures', module)
22
+ .addDecorator(withKnobs)
23
+ .add('Fixtures Ticker', () => {
24
+ const selComp = select('Competition', competitons, '8');
25
+ return (
26
+ <OptaFootballFixturesTicker
27
+ season={text('season', '2023')}
28
+ competition={selComp}
29
+ date_from=""
30
+ date_to=""
31
+ />
32
+ );
33
+ });
@@ -10,7 +10,7 @@ import {
10
10
  initComponent
11
11
  } from '../../utils/config';
12
12
 
13
- import { Container, PlaceholderContainer } from '../shared-styles';
13
+ import { PlaceholderContainer } from '../shared-styles';
14
14
  import { WidgetContainer } from './styles';
15
15
 
16
16
  export const OptaFootballFixturesTicker: React.FC<{
@@ -18,8 +18,7 @@ export const OptaFootballFixturesTicker: React.FC<{
18
18
  competition: string;
19
19
  date_from?: string;
20
20
  date_to?: string;
21
- full_width?: boolean;
22
- }> = React.memo(({ season, competition, date_from, date_to, full_width }) => {
21
+ }> = React.memo(({ season, competition, date_from, date_to }) => {
23
22
  const ref = React.createRef<HTMLDivElement>();
24
23
 
25
24
  const [isReady, setIsReady] = useState<boolean>(false);
@@ -58,14 +57,14 @@ export const OptaFootballFixturesTicker: React.FC<{
58
57
  }, []);
59
58
 
60
59
  return (
61
- <Container border={false} fullWidth={full_width}>
60
+ <>
62
61
  <WidgetContainer ref={ref} />
63
62
 
64
63
  {!isReady && (
65
- <PlaceholderContainer>
64
+ <PlaceholderContainer height={100}>
66
65
  <Placeholder />
67
66
  </PlaceholderContainer>
68
67
  )}
69
- </Container>
68
+ </>
70
69
  );
71
70
  });
@@ -3,16 +3,13 @@
3
3
  exports[`OptaFootballFixturesTicker should render correctly 1`] = `
4
4
  <DocumentFragment>
5
5
  <div
6
- class="sc-bdVaJa giUBsz"
6
+ class="sc-htpNat sc-ifAKCX elhfwo"
7
+ />
8
+ <div
9
+ class="sc-bwzfXH eLGWmp"
10
+ height="100"
7
11
  >
8
- <div
9
- class="sc-htpNat sc-ifAKCX gxAjSa"
10
- />
11
- <div
12
- class="sc-bwzfXH kVYHKf"
13
- >
14
- Placeholder
15
- </div>
12
+ Placeholder
16
13
  </div>
17
14
  </DocumentFragment>
18
15
  `;
@@ -20,14 +17,10 @@ exports[`OptaFootballFixturesTicker should render correctly 1`] = `
20
17
  exports[`OptaFootballFixturesTicker should render correctly 2`] = `
21
18
  <DocumentFragment>
22
19
  <div
23
- class="sc-bdVaJa giUBsz"
20
+ class="sc-htpNat sc-ifAKCX elhfwo"
24
21
  >
25
- <div
26
- class="sc-htpNat sc-ifAKCX gxAjSa"
27
- >
28
- <div>
29
- Widget
30
- </div>
22
+ <div>
23
+ Widget
31
24
  </div>
32
25
  </div>
33
26
  </DocumentFragment>
@@ -42,7 +42,7 @@ export const WidgetContainerOverride = styled(WidgetContainerBase)`
42
42
  export const WidgetContainer = styled(WidgetContainerBase)`
43
43
  @media (max-width: ${breakpoints.small}px) {
44
44
  .Opta-Window {
45
- left: 20px !important;
45
+ left: 0 !important;
46
46
  right: 0 !important;
47
47
  }
48
48
  }
@@ -75,12 +75,7 @@ export const WidgetContainer = styled(WidgetContainerBase)`
75
75
  }
76
76
 
77
77
  @media (max-width: ${breakpoints.small}px) {
78
- opacity: 0 !important;
79
- transition-duration: 0.2s;
80
-
81
- &:hover {
82
- opacity: 1 !important;
83
- }
78
+ display: none !important;
84
79
  }
85
80
  }
86
81
 
@@ -21,9 +21,9 @@ export const Container = styled.div<{ border: boolean; fullWidth?: boolean }>`
21
21
  }
22
22
  `;
23
23
 
24
- export const PlaceholderContainer = styled.div`
24
+ export const PlaceholderContainer = styled.div<{ height?: number }>`
25
25
  position: relative;
26
- height: 200px;
26
+ height: ${({ height }) => height || '200'}px;
27
27
  `;
28
28
 
29
29
  export const WidgetContainerBase = styled.div`