@times-components/ts-components 1.129.6 → 1.130.0
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.
- package/CHANGELOG.md +16 -0
- package/dist/components/opta/cricket/scorecard/OptaCricketScorecard.d.ts +3 -1
- package/dist/components/opta/cricket/scorecard/OptaCricketScorecard.js +6 -5
- package/dist/components/opta/cricket/scorecard/OptaCricketScorecard.stories.js +2 -2
- package/dist/components/opta/cricket/shared-styles.d.ts +0 -8
- package/dist/components/opta/cricket/shared-styles.js +2 -24
- package/dist/components/opta/football/fixtures/OptaFootballFixtures.d.ts +3 -0
- package/dist/components/opta/football/fixtures/OptaFootballFixtures.js +5 -4
- package/dist/components/opta/football/fixtures-tournament/OptaFootballFixturesTournament.d.ts +3 -0
- package/dist/components/opta/football/fixtures-tournament/OptaFootballFixturesTournament.js +5 -4
- package/dist/components/opta/football/match-stats/OptaFootballMatchStats.d.ts +3 -1
- package/dist/components/opta/football/match-stats/OptaFootballMatchStats.js +5 -4
- package/dist/components/opta/football/player-stats/OptaFootballPlayerStats.d.ts +3 -1
- package/dist/components/opta/football/player-stats/OptaFootballPlayerStats.js +5 -4
- package/dist/components/opta/football/standings/OptaFootballStandings.d.ts +3 -1
- package/dist/components/opta/football/standings/OptaFootballStandings.js +5 -4
- package/dist/components/opta/football/standings/OptaFootballStandings.stories.js +2 -2
- package/dist/components/opta/football/summary/OptaFootballSummary.d.ts +3 -0
- package/dist/components/opta/football/summary/OptaFootballSummary.js +5 -4
- package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.d.ts +3 -0
- package/dist/components/opta/rugby/fixtures/OptaRugbyFixtures.js +6 -5
- package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.d.ts +3 -0
- package/dist/components/opta/rugby/match-stats/OptaRugbyMatchStats.js +6 -5
- package/dist/components/opta/rugby/shared-styles.d.ts +0 -5
- package/dist/components/opta/rugby/shared-styles.js +2 -24
- package/dist/components/opta/rugby/standings/OptaRugbyStandings.d.ts +3 -0
- package/dist/components/opta/rugby/standings/OptaRugbyStandings.js +6 -5
- package/dist/components/opta/rugby/summary/OptaRugbySummary.d.ts +3 -0
- package/dist/components/opta/rugby/summary/OptaRugbySummary.js +6 -5
- package/dist/components/opta/shared/fixtures-ticker/OptaFixturesTicker.js +2 -2
- package/dist/components/opta/shared/fixtures-ticker/styles.js +3 -3
- package/dist/components/opta/shared/shared-styles.d.ts +4 -2
- package/dist/components/opta/shared/shared-styles.js +6 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -3
- package/package.json +4 -4
- package/rnw.js +1 -1
- package/src/components/opta/cricket/scorecard/OptaCricketScorecard.stories.tsx +1 -1
- package/src/components/opta/cricket/scorecard/OptaCricketScorecard.tsx +69 -58
- package/src/components/opta/cricket/scorecard/__tests__/__snapshots__/OptaCricketScorecard.test.tsx.snap +5 -5
- package/src/components/opta/cricket/shared-styles.ts +1 -31
- package/src/components/opta/football/fixtures/OptaFootballFixtures.tsx +76 -54
- package/src/components/opta/football/fixtures/__tests__/__snapshots__/OptaFootballFixtures.test.tsx.snap +2 -2
- package/src/components/opta/football/fixtures-tournament/OptaFootballFixturesTournament.tsx +17 -3
- package/src/components/opta/football/fixtures-tournament/__tests__/__snapshots__/OptaFootballFixturesTournament.test.tsx.snap +8 -8
- package/src/components/opta/football/match-stats/OptaFootballMatchStats.tsx +64 -45
- package/src/components/opta/football/match-stats/__tests__/__snapshots__/OptaFootballMatchStats.test.tsx.snap +3 -4
- package/src/components/opta/football/player-stats/OptaFootballPlayerStats.tsx +11 -4
- package/src/components/opta/football/player-stats/__tests__/__snapshots__/OptaFootballPlayerStats.test.tsx.snap +2 -2
- package/src/components/opta/football/standings/OptaFootballStandings.stories.tsx +1 -1
- package/src/components/opta/football/standings/OptaFootballStandings.tsx +11 -4
- package/src/components/opta/football/standings/__tests__/__snapshots__/OptaFootballStandings.test.tsx.snap +4 -4
- package/src/components/opta/football/summary/OptaFootballSummary.tsx +62 -42
- package/src/components/opta/football/summary/__tests__/__snapshots__/OptaFootballSummary.test.tsx.snap +2 -2
- package/src/components/opta/rugby/fixtures/OptaRugbyFixtures.tsx +80 -59
- package/src/components/opta/rugby/fixtures/__tests__/__snapshots__/OptaRugbyFixtures.test.tsx.snap +4 -4
- package/src/components/opta/rugby/match-stats/OptaRugbyMatchStats.tsx +65 -45
- package/src/components/opta/rugby/match-stats/__tests__/__snapshots__/OptaRugbyMatchStats.test.tsx.snap +4 -4
- package/src/components/opta/rugby/shared-styles.ts +1 -26
- package/src/components/opta/rugby/standings/OptaRugbyStandings.tsx +23 -4
- package/src/components/opta/rugby/standings/__tests__/__snapshots__/OptaRugbyStandings.test.tsx.snap +4 -4
- package/src/components/opta/rugby/summary/OptaRugbySummary.tsx +65 -45
- package/src/components/opta/rugby/summary/__tests__/__snapshots__/OptaRugbySummary.test.tsx.snap +4 -4
- package/src/components/opta/shared/fixtures-ticker/OptaFixturesTicker.tsx +1 -1
- package/src/components/opta/shared/fixtures-ticker/__tests__/__snapshots__/OptaFixturesTicker.test.tsx.snap +25 -30
- package/src/components/opta/shared/fixtures-ticker/styles.ts +3 -3
- package/src/components/opta/shared/shared-styles.ts +11 -5
- package/src/index.ts +0 -3
- package/dist/components/palin-polls/PalinPolls.d.ts +0 -6
- package/dist/components/palin-polls/PalinPolls.js +0 -24
- package/dist/components/palin-polls/__tests__/PalinPolls.test.d.ts +0 -1
- package/dist/components/palin-polls/__tests__/PalinPolls.test.js +0 -47
- package/src/components/palin-polls/PalinPolls.tsx +0 -35
- package/src/components/palin-polls/__tests__/PalinPolls.test.tsx +0 -59
|
@@ -21,7 +21,7 @@ const showcase = {
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
component: () => (
|
|
24
|
-
<OptaCricketScorecard competition="3071" match="55391"
|
|
24
|
+
<OptaCricketScorecard competition="3071" match="55391" heightSm={905} />
|
|
25
25
|
),
|
|
26
26
|
name: 'Scorecard (1st inns) with set height',
|
|
27
27
|
type: 'story'
|
|
@@ -9,74 +9,85 @@ import {
|
|
|
9
9
|
initElement,
|
|
10
10
|
initComponent
|
|
11
11
|
} from '../../utils/config';
|
|
12
|
-
|
|
13
|
-
import { Container, PlaceholderContainer } from '../shared-styles';
|
|
12
|
+
import { Container, PlaceholderContainer } from '../../shared/shared-styles';
|
|
14
13
|
import { WidgetContainer } from './styles';
|
|
15
14
|
|
|
16
15
|
export const OptaCricketScorecard: React.FC<{
|
|
17
16
|
competition: string;
|
|
18
17
|
match: string;
|
|
19
18
|
full_width?: boolean;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
heightSm?: number;
|
|
20
|
+
heightMd?: number;
|
|
21
|
+
heightLg?: number;
|
|
22
|
+
}> = React.memo(
|
|
23
|
+
({ competition, match, full_width, heightSm, heightMd, heightLg }) => {
|
|
24
|
+
const ref = React.createRef<HTMLDivElement>();
|
|
25
|
+
|
|
26
|
+
const [isReady, setIsReady] = useState<boolean>(false);
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
const isHeight = heightSm || heightMd || heightLg;
|
|
25
29
|
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
const sport = 'cricket';
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
initSettings();
|
|
34
|
+
initStyleSheet(sport);
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
36
|
+
initScript().then(() => {
|
|
37
|
+
if (ref.current) {
|
|
38
|
+
ref.current.innerHTML = initElement('opta-widget', {
|
|
39
|
+
sport,
|
|
40
|
+
widget: 'score_card',
|
|
41
|
+
season: '0',
|
|
42
|
+
competition,
|
|
43
|
+
match,
|
|
44
|
+
template: 'normal',
|
|
45
|
+
live: true,
|
|
46
|
+
show_match_header: true,
|
|
47
|
+
show_crests: true,
|
|
48
|
+
show_competition_name: true,
|
|
49
|
+
show_match_description: true,
|
|
50
|
+
show_date: true,
|
|
51
|
+
date_format: 'DD/MM/YYYY',
|
|
52
|
+
show_venue: true,
|
|
53
|
+
show_officials: false,
|
|
54
|
+
show_toss: false,
|
|
55
|
+
show_state_of_play: true,
|
|
56
|
+
navigation: 'tabs',
|
|
57
|
+
show_batting: true,
|
|
58
|
+
show_mins_batted: false,
|
|
59
|
+
show_fours: true,
|
|
60
|
+
show_sixes: true,
|
|
61
|
+
show_strike_rate: true,
|
|
62
|
+
show_bowling: true,
|
|
63
|
+
show_economy: true,
|
|
64
|
+
show_fow: true,
|
|
65
|
+
player_naming: 'full',
|
|
66
|
+
breakpoints: '520'
|
|
67
|
+
}).outerHTML;
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
initComponent();
|
|
70
|
+
setIsReady(true);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}, []);
|
|
70
74
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
return (
|
|
76
|
+
<Container
|
|
77
|
+
border={isReady}
|
|
78
|
+
fullWidth={full_width}
|
|
79
|
+
heightSm={heightSm}
|
|
80
|
+
heightMd={heightMd}
|
|
81
|
+
heightLg={heightLg}
|
|
82
|
+
>
|
|
83
|
+
<WidgetContainer ref={ref} />
|
|
74
84
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
85
|
+
{!isReady && (
|
|
86
|
+
<PlaceholderContainer isHeight={!!isHeight}>
|
|
87
|
+
<Placeholder />
|
|
88
|
+
</PlaceholderContainer>
|
|
89
|
+
)}
|
|
90
|
+
</Container>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
);
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
exports[`OptaCricketScorecard should render correctly 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="sc-bdVaJa
|
|
6
|
+
class="sc-bdVaJa hOxnUM"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
|
-
class="sc-
|
|
9
|
+
class="sc-bxivhb sc-ifAKCX eulKbd"
|
|
10
10
|
/>
|
|
11
11
|
<div
|
|
12
|
-
class="sc-bwzfXH
|
|
12
|
+
class="sc-bwzfXH kVYHKf"
|
|
13
13
|
>
|
|
14
14
|
Placeholder
|
|
15
15
|
</div>
|
|
@@ -20,10 +20,10 @@ exports[`OptaCricketScorecard should render correctly 1`] = `
|
|
|
20
20
|
exports[`OptaCricketScorecard should render correctly 2`] = `
|
|
21
21
|
<DocumentFragment>
|
|
22
22
|
<div
|
|
23
|
-
class="sc-bdVaJa
|
|
23
|
+
class="sc-bdVaJa iGGGrD"
|
|
24
24
|
>
|
|
25
25
|
<div
|
|
26
|
-
class="sc-
|
|
26
|
+
class="sc-bxivhb sc-ifAKCX eulKbd"
|
|
27
27
|
>
|
|
28
28
|
<div>
|
|
29
29
|
Widget
|
|
@@ -1,35 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export const Container = styled.div<{
|
|
5
|
-
border: boolean;
|
|
6
|
-
fullWidth?: boolean;
|
|
7
|
-
$height?: number;
|
|
8
|
-
}>`
|
|
9
|
-
${({ $height }) =>
|
|
10
|
-
$height && `height: ${$height}px;`} margin: 0 auto 20px auto;
|
|
11
|
-
background-color: ${colours.functional.backgroundPrimary};
|
|
12
|
-
border-top: ${({ border }) =>
|
|
13
|
-
border ? `2px solid ${colours.section.sport}` : 'none'};
|
|
14
|
-
|
|
15
|
-
a {
|
|
16
|
-
text-decoration: none;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@media (min-width: ${breakpoints.medium}px) {
|
|
20
|
-
flex-direction: row;
|
|
21
|
-
width: ${({ fullWidth }) => (fullWidth ? '100%' : '80.8%')};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@media (min-width: ${breakpoints.wide}px) {
|
|
25
|
-
width: ${({ fullWidth }) => (fullWidth ? '100%' : '56.2%')};
|
|
26
|
-
}
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
export const PlaceholderContainer = styled.div<{ height?: number }>`
|
|
30
|
-
height: ${({ height }) => height || 200}px;
|
|
31
|
-
position: relative;
|
|
32
|
-
`;
|
|
2
|
+
import { colours, fonts } from '@times-components/ts-styleguide';
|
|
33
3
|
|
|
34
4
|
export const WidgetContainerBase = styled.div`
|
|
35
5
|
.Opta {
|
|
@@ -19,64 +19,86 @@ export const OptaFootballFixtures: React.FC<{
|
|
|
19
19
|
date_from: string;
|
|
20
20
|
date_to: string;
|
|
21
21
|
full_width?: boolean;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
heightSm?: number;
|
|
23
|
+
heightMd?: number;
|
|
24
|
+
heightLg?: number;
|
|
25
|
+
}> = React.memo(
|
|
26
|
+
({
|
|
27
|
+
season,
|
|
28
|
+
competition,
|
|
29
|
+
date_from,
|
|
30
|
+
date_to,
|
|
31
|
+
full_width,
|
|
32
|
+
heightSm,
|
|
33
|
+
heightMd,
|
|
34
|
+
heightLg
|
|
35
|
+
}) => {
|
|
36
|
+
const ref = React.createRef<HTMLDivElement>();
|
|
24
37
|
|
|
25
|
-
|
|
38
|
+
const [isReady, setIsReady] = useState<boolean>(false);
|
|
26
39
|
|
|
27
|
-
|
|
28
|
-
const sport = 'football';
|
|
40
|
+
const isHeight = heightSm || heightMd || heightLg;
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const sport = 'football';
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
ref.current.innerHTML = initElement(
|
|
36
|
-
'opta-widget',
|
|
37
|
-
{
|
|
38
|
-
sport,
|
|
39
|
-
widget: 'fixtures',
|
|
40
|
-
season,
|
|
41
|
-
competition,
|
|
42
|
-
date_from,
|
|
43
|
-
date_to,
|
|
44
|
-
live: true,
|
|
45
|
-
grouping: 'date',
|
|
46
|
-
show_grouping: true,
|
|
47
|
-
show_crests: true,
|
|
48
|
-
date_format: 'dddd MMMM D YYYY',
|
|
49
|
-
breakpoints: 520
|
|
50
|
-
},
|
|
51
|
-
initElement('opta-widget', {
|
|
52
|
-
sport,
|
|
53
|
-
widget: 'match_summary',
|
|
54
|
-
season: '',
|
|
55
|
-
competition: '',
|
|
56
|
-
match: '',
|
|
57
|
-
live: true,
|
|
58
|
-
show_crests: true,
|
|
59
|
-
show_goals: true,
|
|
60
|
-
show_cards: 'red',
|
|
61
|
-
breakpoints: '520'
|
|
62
|
-
})
|
|
63
|
-
).outerHTML;
|
|
45
|
+
initSettings();
|
|
46
|
+
initStyleSheet(sport);
|
|
64
47
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
48
|
+
initScript().then(() => {
|
|
49
|
+
if (ref.current) {
|
|
50
|
+
ref.current.innerHTML = initElement(
|
|
51
|
+
'opta-widget',
|
|
52
|
+
{
|
|
53
|
+
sport,
|
|
54
|
+
widget: 'fixtures',
|
|
55
|
+
season,
|
|
56
|
+
competition,
|
|
57
|
+
date_from,
|
|
58
|
+
date_to,
|
|
59
|
+
live: true,
|
|
60
|
+
grouping: 'date',
|
|
61
|
+
show_grouping: true,
|
|
62
|
+
show_crests: true,
|
|
63
|
+
date_format: 'dddd MMMM D YYYY',
|
|
64
|
+
breakpoints: 520
|
|
65
|
+
},
|
|
66
|
+
initElement('opta-widget', {
|
|
67
|
+
sport,
|
|
68
|
+
widget: 'match_summary',
|
|
69
|
+
season: '',
|
|
70
|
+
competition: '',
|
|
71
|
+
match: '',
|
|
72
|
+
live: true,
|
|
73
|
+
show_crests: true,
|
|
74
|
+
show_goals: true,
|
|
75
|
+
show_cards: 'red',
|
|
76
|
+
breakpoints: '520'
|
|
77
|
+
})
|
|
78
|
+
).outerHTML;
|
|
70
79
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
initComponent();
|
|
81
|
+
setIsReady(true);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}, []);
|
|
74
85
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
return (
|
|
87
|
+
<Container
|
|
88
|
+
border={isReady}
|
|
89
|
+
fullWidth={full_width}
|
|
90
|
+
heightSm={heightSm}
|
|
91
|
+
heightMd={heightMd}
|
|
92
|
+
heightLg={heightLg}
|
|
93
|
+
>
|
|
94
|
+
<WidgetContainer ref={ref} />
|
|
95
|
+
|
|
96
|
+
{!isReady && (
|
|
97
|
+
<PlaceholderContainer isHeight={!!isHeight}>
|
|
98
|
+
<Placeholder />
|
|
99
|
+
</PlaceholderContainer>
|
|
100
|
+
)}
|
|
101
|
+
</Container>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`OptaFootballFixtures should render correctly 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="sc-bdVaJa
|
|
6
|
+
class="sc-bdVaJa hOxnUM"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
class="sc-htpNat sc-ifAKCX kRuyQz"
|
|
@@ -20,7 +20,7 @@ exports[`OptaFootballFixtures should render correctly 1`] = `
|
|
|
20
20
|
exports[`OptaFootballFixtures should render correctly 2`] = `
|
|
21
21
|
<DocumentFragment>
|
|
22
22
|
<div
|
|
23
|
-
class="sc-bdVaJa
|
|
23
|
+
class="sc-bdVaJa iGGGrD"
|
|
24
24
|
>
|
|
25
25
|
<div
|
|
26
26
|
class="sc-htpNat sc-ifAKCX kRuyQz"
|
|
@@ -29,6 +29,9 @@ export const OptaFootballFixturesTournament: React.FC<{
|
|
|
29
29
|
hide_matchday?: boolean;
|
|
30
30
|
columns?: boolean;
|
|
31
31
|
full_width?: boolean;
|
|
32
|
+
heightSm?: number;
|
|
33
|
+
heightMd?: number;
|
|
34
|
+
heightLg?: number;
|
|
32
35
|
}> = React.memo(
|
|
33
36
|
({
|
|
34
37
|
season,
|
|
@@ -43,12 +46,16 @@ export const OptaFootballFixturesTournament: React.FC<{
|
|
|
43
46
|
hide_matchday,
|
|
44
47
|
show_title = true,
|
|
45
48
|
columns = true,
|
|
46
|
-
full_width
|
|
49
|
+
full_width,
|
|
50
|
+
heightSm,
|
|
51
|
+
heightMd,
|
|
52
|
+
heightLg
|
|
47
53
|
}) => {
|
|
48
54
|
const ref = React.createRef<HTMLDivElement>();
|
|
49
55
|
|
|
50
56
|
const [isReady, setIsReady] = useState<boolean>(false);
|
|
51
57
|
const isNationalComp = isNationalCompetition(competition);
|
|
58
|
+
const isHeight = heightSm || heightMd || heightLg;
|
|
52
59
|
|
|
53
60
|
useEffect(() => {
|
|
54
61
|
const sport = 'football';
|
|
@@ -104,7 +111,14 @@ export const OptaFootballFixturesTournament: React.FC<{
|
|
|
104
111
|
isNationalComp && useUpdateNationalTeamDetails(ref, 'Opta-Team');
|
|
105
112
|
|
|
106
113
|
return (
|
|
107
|
-
<Container
|
|
114
|
+
<Container
|
|
115
|
+
border={isReady}
|
|
116
|
+
fullWidth={full_width}
|
|
117
|
+
className={classes}
|
|
118
|
+
heightSm={heightSm}
|
|
119
|
+
heightMd={heightMd}
|
|
120
|
+
heightLg={heightLg}
|
|
121
|
+
>
|
|
108
122
|
<WidgetContainer
|
|
109
123
|
ref={ref}
|
|
110
124
|
isNationalComp={isNationalComp}
|
|
@@ -113,7 +127,7 @@ export const OptaFootballFixturesTournament: React.FC<{
|
|
|
113
127
|
/>
|
|
114
128
|
|
|
115
129
|
{!isReady && (
|
|
116
|
-
<PlaceholderContainer>
|
|
130
|
+
<PlaceholderContainer isHeight={!!isHeight}>
|
|
117
131
|
<Placeholder />
|
|
118
132
|
</PlaceholderContainer>
|
|
119
133
|
)}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`OptaFootballFixturesTournament should render full width correctly 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="sc-bdVaJa
|
|
6
|
+
class="sc-bdVaJa kYgBaB"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
class="sc-htpNat sc-ifAKCX dniyMN team-flags"
|
|
@@ -20,7 +20,7 @@ exports[`OptaFootballFixturesTournament should render full width correctly 1`] =
|
|
|
20
20
|
exports[`OptaFootballFixturesTournament should render full width correctly 2`] = `
|
|
21
21
|
<DocumentFragment>
|
|
22
22
|
<div
|
|
23
|
-
class="sc-bdVaJa
|
|
23
|
+
class="sc-bdVaJa hSmNfz"
|
|
24
24
|
>
|
|
25
25
|
<div
|
|
26
26
|
class="sc-htpNat sc-ifAKCX dniyMN team-flags"
|
|
@@ -36,7 +36,7 @@ exports[`OptaFootballFixturesTournament should render full width correctly 2`] =
|
|
|
36
36
|
exports[`OptaFootballFixturesTournament should render national competitions correctly 1`] = `
|
|
37
37
|
<DocumentFragment>
|
|
38
38
|
<div
|
|
39
|
-
class="sc-bdVaJa
|
|
39
|
+
class="sc-bdVaJa hOxnUM"
|
|
40
40
|
>
|
|
41
41
|
<div
|
|
42
42
|
class="sc-htpNat sc-ifAKCX dniyMN team-flags"
|
|
@@ -53,7 +53,7 @@ exports[`OptaFootballFixturesTournament should render national competitions corr
|
|
|
53
53
|
exports[`OptaFootballFixturesTournament should render national competitions correctly 2`] = `
|
|
54
54
|
<DocumentFragment>
|
|
55
55
|
<div
|
|
56
|
-
class="sc-bdVaJa
|
|
56
|
+
class="sc-bdVaJa iGGGrD"
|
|
57
57
|
>
|
|
58
58
|
<div
|
|
59
59
|
class="sc-htpNat sc-ifAKCX dniyMN team-flags"
|
|
@@ -69,7 +69,7 @@ exports[`OptaFootballFixturesTournament should render national competitions corr
|
|
|
69
69
|
exports[`OptaFootballFixturesTournament should render national competitions correctly with single column 1`] = `
|
|
70
70
|
<DocumentFragment>
|
|
71
71
|
<div
|
|
72
|
-
class="sc-bdVaJa
|
|
72
|
+
class="sc-bdVaJa hOxnUM"
|
|
73
73
|
>
|
|
74
74
|
<div
|
|
75
75
|
class="sc-htpNat sc-ifAKCX UELGY team-flags"
|
|
@@ -86,7 +86,7 @@ exports[`OptaFootballFixturesTournament should render national competitions corr
|
|
|
86
86
|
exports[`OptaFootballFixturesTournament should render national competitions correctly with single column 2`] = `
|
|
87
87
|
<DocumentFragment>
|
|
88
88
|
<div
|
|
89
|
-
class="sc-bdVaJa
|
|
89
|
+
class="sc-bdVaJa iGGGrD"
|
|
90
90
|
>
|
|
91
91
|
<div
|
|
92
92
|
class="sc-htpNat sc-ifAKCX UELGY team-flags"
|
|
@@ -102,7 +102,7 @@ exports[`OptaFootballFixturesTournament should render national competitions corr
|
|
|
102
102
|
exports[`OptaFootballFixturesTournament should render other competitions correctly 1`] = `
|
|
103
103
|
<DocumentFragment>
|
|
104
104
|
<div
|
|
105
|
-
class="sc-bdVaJa
|
|
105
|
+
class="sc-bdVaJa hOxnUM"
|
|
106
106
|
>
|
|
107
107
|
<div
|
|
108
108
|
class="sc-htpNat sc-ifAKCX bqOljm"
|
|
@@ -119,7 +119,7 @@ exports[`OptaFootballFixturesTournament should render other competitions correct
|
|
|
119
119
|
exports[`OptaFootballFixturesTournament should render other competitions correctly 2`] = `
|
|
120
120
|
<DocumentFragment>
|
|
121
121
|
<div
|
|
122
|
-
class="sc-bdVaJa
|
|
122
|
+
class="sc-bdVaJa iGGGrD"
|
|
123
123
|
>
|
|
124
124
|
<div
|
|
125
125
|
class="sc-htpNat sc-ifAKCX bqOljm"
|
|
@@ -18,55 +18,74 @@ export const OptaFootballMatchStats: React.FC<{
|
|
|
18
18
|
competition: string;
|
|
19
19
|
match: string;
|
|
20
20
|
full_width?: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
heightSm?: number;
|
|
22
|
+
heightMd?: number;
|
|
23
|
+
heightLg?: number;
|
|
24
|
+
}> = React.memo(
|
|
25
|
+
({
|
|
26
|
+
season,
|
|
27
|
+
competition,
|
|
28
|
+
match,
|
|
29
|
+
full_width,
|
|
30
|
+
heightSm = 640,
|
|
31
|
+
heightMd,
|
|
32
|
+
heightLg
|
|
33
|
+
}) => {
|
|
34
|
+
const ref = React.createRef<HTMLDivElement>();
|
|
24
35
|
|
|
25
|
-
|
|
36
|
+
const [isReady, setIsReady] = useState<boolean>(false);
|
|
37
|
+
const isHeight = heightSm || heightMd || heightLg;
|
|
26
38
|
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const sport = 'football';
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
|
|
42
|
+
initSettings();
|
|
43
|
+
initStyleSheet(sport);
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
45
|
+
initScript().then(() => {
|
|
46
|
+
if (ref.current) {
|
|
47
|
+
ref.current.innerHTML = initElement('opta-widget', {
|
|
48
|
+
sport,
|
|
49
|
+
widget: 'matchstats',
|
|
50
|
+
season,
|
|
51
|
+
competition,
|
|
52
|
+
match,
|
|
53
|
+
template: 'custom',
|
|
54
|
+
graph_style: 'relative',
|
|
55
|
+
stats_categories:
|
|
56
|
+
'Category 1|possession,shots,shots_on_target,passes,passes_accuracy,corners_won,fouls_conceded,cards_yellow,cards_red',
|
|
57
|
+
live: true,
|
|
58
|
+
show_match_header: true,
|
|
59
|
+
show_halftime_score: true,
|
|
60
|
+
show_competition_name: true,
|
|
61
|
+
show_date: true,
|
|
62
|
+
show_crests: true,
|
|
63
|
+
date_format: 'DD/MM/YYYY',
|
|
64
|
+
breakpoints: '520'
|
|
65
|
+
}).outerHTML;
|
|
54
66
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
67
|
+
initComponent();
|
|
68
|
+
setIsReady(true);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}, []);
|
|
60
72
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
73
|
+
return (
|
|
74
|
+
<Container
|
|
75
|
+
border={isReady}
|
|
76
|
+
fullWidth={full_width}
|
|
77
|
+
heightSm={heightSm}
|
|
78
|
+
heightMd={heightMd}
|
|
79
|
+
heightLg={heightLg}
|
|
80
|
+
>
|
|
81
|
+
<WidgetContainer ref={ref} />
|
|
64
82
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
83
|
+
{!isReady && (
|
|
84
|
+
<PlaceholderContainer isHeight={!!isHeight}>
|
|
85
|
+
<Placeholder />
|
|
86
|
+
</PlaceholderContainer>
|
|
87
|
+
)}
|
|
88
|
+
</Container>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
exports[`OptaFootballMatchStats should render correctly 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="sc-bdVaJa
|
|
6
|
+
class="sc-bdVaJa gVlQgL"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
class="sc-htpNat sc-bxivhb deUMuZ"
|
|
10
10
|
/>
|
|
11
11
|
<div
|
|
12
|
-
class="sc-bwzfXH
|
|
13
|
-
height="640"
|
|
12
|
+
class="sc-bwzfXH jStUkM"
|
|
14
13
|
>
|
|
15
14
|
Placeholder
|
|
16
15
|
</div>
|
|
@@ -21,7 +20,7 @@ exports[`OptaFootballMatchStats should render correctly 1`] = `
|
|
|
21
20
|
exports[`OptaFootballMatchStats should render correctly 2`] = `
|
|
22
21
|
<DocumentFragment>
|
|
23
22
|
<div
|
|
24
|
-
class="sc-bdVaJa
|
|
23
|
+
class="sc-bdVaJa eqKXku"
|
|
25
24
|
>
|
|
26
25
|
<div
|
|
27
26
|
class="sc-htpNat sc-bxivhb deUMuZ"
|