@times-components/ts-components 1.91.0 → 1.91.1-alpha.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.
- package/dist/components/newsletter-puff/InlineNewsletterPuff.js +5 -2
- package/dist/components/newsletter-puff/newsletter/Newsletter.d.ts +2 -1
- package/dist/components/newsletter-puff/newsletter/Newsletter.js +11 -4
- package/dist/components/opta/football/fixtures-ticker/OptaFootballFixturesTicker.js +3 -2
- package/dist/components/opta/football/fixtures-ticker/styles.js +1 -50
- package/package.json +16 -16
- package/rnw.js +1 -1
- package/src/components/newsletter-puff/InlineNewsletterPuff.tsx +5 -0
- package/src/components/newsletter-puff/newsletter/Newsletter.tsx +20 -8
- package/src/components/opta/football/fixtures-ticker/OptaFootballFixturesTicker.tsx +2 -1
- package/src/components/opta/football/fixtures-ticker/__tests__/__snapshots__/OptaFootballFixturesTicker.test.tsx.snap +8 -8
- package/src/components/opta/football/fixtures-ticker/styles.ts +0 -50
|
@@ -26,6 +26,7 @@ export const InlineNewsletterPuff = ({
|
|
|
26
26
|
section
|
|
27
27
|
}: InlineNewsletterPuffProps) => {
|
|
28
28
|
const [justSubscribed, setJustSubscribed] = useState(false);
|
|
29
|
+
const [justSubscribedError, setJustSubscribedError] = useState(false);
|
|
29
30
|
|
|
30
31
|
return (
|
|
31
32
|
<GetNewsletter code={code} ssr={false} debounceTimeMs={0}>
|
|
@@ -52,6 +53,9 @@ export const InlineNewsletterPuff = ({
|
|
|
52
53
|
onCompleted={({ subscribeNewsletter = {} }: any) => {
|
|
53
54
|
setJustSubscribed(subscribeNewsletter.isSubscribed);
|
|
54
55
|
}}
|
|
56
|
+
onError={() => {
|
|
57
|
+
setJustSubscribedError(true);
|
|
58
|
+
}}
|
|
55
59
|
>
|
|
56
60
|
{(
|
|
57
61
|
subscribeNewsletter: any,
|
|
@@ -80,6 +84,7 @@ export const InlineNewsletterPuff = ({
|
|
|
80
84
|
intersectObserverRef={intersectObserverRef}
|
|
81
85
|
section={capitalise(section)}
|
|
82
86
|
justSubscribed={justSubscribed}
|
|
87
|
+
justSubscribedError={justSubscribedError}
|
|
83
88
|
headline={headline}
|
|
84
89
|
updatingSubscription={updatingSubscription}
|
|
85
90
|
copy={copy}
|
|
@@ -19,6 +19,7 @@ type NewsletterProps = {
|
|
|
19
19
|
intersectObserverRef: (ref: HTMLElement | null) => void;
|
|
20
20
|
section?: string;
|
|
21
21
|
justSubscribed: boolean;
|
|
22
|
+
justSubscribedError: boolean;
|
|
22
23
|
headline: string;
|
|
23
24
|
updatingSubscription: boolean;
|
|
24
25
|
copy: string;
|
|
@@ -30,6 +31,7 @@ export const Newsletter = ({
|
|
|
30
31
|
intersectObserverRef,
|
|
31
32
|
section,
|
|
32
33
|
justSubscribed,
|
|
34
|
+
justSubscribedError,
|
|
33
35
|
headline,
|
|
34
36
|
updatingSubscription,
|
|
35
37
|
copy,
|
|
@@ -54,7 +56,7 @@ export const Newsletter = ({
|
|
|
54
56
|
<React.Fragment>
|
|
55
57
|
<InpContainer section={section}>
|
|
56
58
|
{updatingSubscription && <LoadingOverlay />}
|
|
57
|
-
{justSubscribed
|
|
59
|
+
{justSubscribed && (
|
|
58
60
|
<InpSubscribedContainer>
|
|
59
61
|
<InpCopy>
|
|
60
62
|
You've succesfully signed up to{' '}
|
|
@@ -63,16 +65,26 @@ export const Newsletter = ({
|
|
|
63
65
|
</InpCopy>
|
|
64
66
|
<InpPreferencesContainer />
|
|
65
67
|
</InpSubscribedContainer>
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
+
)}
|
|
69
|
+
{justSubscribedError && (
|
|
70
|
+
<InpSubscribedContainer>
|
|
68
71
|
<InpCopy>
|
|
69
|
-
<
|
|
70
|
-
{`${copy} `}
|
|
71
|
-
{PuffButton('link')}
|
|
72
|
+
An error occurred! Please sign up using - <NewsletterPuffLink />
|
|
72
73
|
</InpCopy>
|
|
73
|
-
|
|
74
|
-
</
|
|
74
|
+
<InpPreferencesContainer />
|
|
75
|
+
</InpSubscribedContainer>
|
|
75
76
|
)}
|
|
77
|
+
{!justSubscribed &&
|
|
78
|
+
!justSubscribedError && (
|
|
79
|
+
<InpSignupContainer>
|
|
80
|
+
<InpCopy>
|
|
81
|
+
<InpSignupHeadline>{headline} </InpSignupHeadline>
|
|
82
|
+
{`${copy} `}
|
|
83
|
+
{PuffButton('link')}
|
|
84
|
+
</InpCopy>
|
|
85
|
+
{PuffButton('button')}
|
|
86
|
+
</InpSignupContainer>
|
|
87
|
+
)}
|
|
76
88
|
</InpContainer>
|
|
77
89
|
</React.Fragment>
|
|
78
90
|
);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`OptaFootballFixturesTicker with flags should render correctly 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="sc-htpNat sc-ifAKCX
|
|
6
|
+
class="sc-htpNat sc-ifAKCX kbwAVa"
|
|
7
7
|
/>
|
|
8
8
|
<div
|
|
9
9
|
class="sc-bwzfXH uxFfR"
|
|
@@ -17,7 +17,7 @@ exports[`OptaFootballFixturesTicker with flags should render correctly 1`] = `
|
|
|
17
17
|
exports[`OptaFootballFixturesTicker with flags should render correctly 2`] = `
|
|
18
18
|
<DocumentFragment>
|
|
19
19
|
<div
|
|
20
|
-
class="sc-htpNat sc-ifAKCX
|
|
20
|
+
class="sc-htpNat sc-ifAKCX kbwAVa"
|
|
21
21
|
>
|
|
22
22
|
<div>
|
|
23
23
|
Widget
|
|
@@ -29,7 +29,7 @@ exports[`OptaFootballFixturesTicker with flags should render correctly 2`] = `
|
|
|
29
29
|
exports[`OptaFootballFixturesTicker without flags should render correctly 1`] = `
|
|
30
30
|
<DocumentFragment>
|
|
31
31
|
<div
|
|
32
|
-
class="sc-htpNat sc-ifAKCX
|
|
32
|
+
class="sc-htpNat sc-ifAKCX kbwAVa"
|
|
33
33
|
/>
|
|
34
34
|
<div
|
|
35
35
|
class="sc-bwzfXH uxFfR"
|
|
@@ -43,7 +43,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly 1`] =
|
|
|
43
43
|
exports[`OptaFootballFixturesTicker without flags should render correctly 2`] = `
|
|
44
44
|
<DocumentFragment>
|
|
45
45
|
<div
|
|
46
|
-
class="sc-htpNat sc-ifAKCX
|
|
46
|
+
class="sc-htpNat sc-ifAKCX kbwAVa"
|
|
47
47
|
>
|
|
48
48
|
<div>
|
|
49
49
|
Widget
|
|
@@ -55,7 +55,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly 2`] =
|
|
|
55
55
|
exports[`OptaFootballFixturesTicker without flags should render correctly with fixturesPageUrl 1`] = `
|
|
56
56
|
<DocumentFragment>
|
|
57
57
|
<div
|
|
58
|
-
class="sc-htpNat sc-ifAKCX
|
|
58
|
+
class="sc-htpNat sc-ifAKCX kbwAVa"
|
|
59
59
|
/>
|
|
60
60
|
<div
|
|
61
61
|
class="sc-bwzfXH uxFfR"
|
|
@@ -69,7 +69,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly with f
|
|
|
69
69
|
exports[`OptaFootballFixturesTicker without flags should render correctly with fixturesPageUrl 2`] = `
|
|
70
70
|
<DocumentFragment>
|
|
71
71
|
<div
|
|
72
|
-
class="sc-htpNat sc-ifAKCX
|
|
72
|
+
class="sc-htpNat sc-ifAKCX kbwAVa"
|
|
73
73
|
>
|
|
74
74
|
<div>
|
|
75
75
|
Widget
|
|
@@ -81,7 +81,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly with f
|
|
|
81
81
|
exports[`OptaFootballFixturesTicker without flags should render correctly with isApp property 1`] = `
|
|
82
82
|
<DocumentFragment>
|
|
83
83
|
<div
|
|
84
|
-
class="sc-htpNat sc-ifAKCX
|
|
84
|
+
class="sc-htpNat sc-ifAKCX ftpdln"
|
|
85
85
|
/>
|
|
86
86
|
<div
|
|
87
87
|
class="sc-bwzfXH uxFfR"
|
|
@@ -95,7 +95,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly with i
|
|
|
95
95
|
exports[`OptaFootballFixturesTicker without flags should render correctly with isApp property 2`] = `
|
|
96
96
|
<DocumentFragment>
|
|
97
97
|
<div
|
|
98
|
-
class="sc-htpNat sc-ifAKCX
|
|
98
|
+
class="sc-htpNat sc-ifAKCX ftpdln"
|
|
99
99
|
>
|
|
100
100
|
<div>
|
|
101
101
|
Widget
|
|
@@ -51,55 +51,6 @@ export const WidgetContainer = styled(WidgetContainerBase)<{
|
|
|
51
51
|
height: 80px !important;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
@media (max-width: ${breakpoints.small}px) {
|
|
55
|
-
.Opta-Scroll {
|
|
56
|
-
&::before,
|
|
57
|
-
&::after {
|
|
58
|
-
content: '';
|
|
59
|
-
pointer-events: none;
|
|
60
|
-
position: absolute;
|
|
61
|
-
z-index: 15;
|
|
62
|
-
transition: all 0.3s linear 0s;
|
|
63
|
-
background-image: linear-gradient(
|
|
64
|
-
-90deg,
|
|
65
|
-
rgba(255, 255, 255, 0) 0%,
|
|
66
|
-
rgb(255, 255, 255) 100%
|
|
67
|
-
);
|
|
68
|
-
width: 64px;
|
|
69
|
-
height: 100%;
|
|
70
|
-
bottom: 0px;
|
|
71
|
-
left: 0;
|
|
72
|
-
visibility: hidden;
|
|
73
|
-
|
|
74
|
-
${({ isApp }) =>
|
|
75
|
-
isApp &&
|
|
76
|
-
`
|
|
77
|
-
@media (prefers-color-scheme: dark) {
|
|
78
|
-
background-image: linear-gradient(
|
|
79
|
-
-90deg,
|
|
80
|
-
rgba(0, 0, 0, 0) 0%,
|
|
81
|
-
rgb(0, 0, 0) 100%
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
`};
|
|
85
|
-
}
|
|
86
|
-
&::after {
|
|
87
|
-
left: unset;
|
|
88
|
-
right: 0px;
|
|
89
|
-
transform: rotate(180deg);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
.Opta-Scroll:has(.Opta-Previous.Opta-Active) {
|
|
93
|
-
&::before {
|
|
94
|
-
visibility: visible;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
.Opta-Scroll:has(.Opta-Next.Opta-Active) {
|
|
98
|
-
&::after {
|
|
99
|
-
visibility: visible;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
54
|
@media (max-width: ${breakpoints.small}px) {
|
|
104
55
|
.Opta-Scroller {
|
|
105
56
|
display: ${({ isApp }) => (isApp ? 'block' : 'none')} !important;
|
|
@@ -244,7 +195,6 @@ export const WidgetContainer = styled(WidgetContainerBase)<{
|
|
|
244
195
|
border-radius: 4px;
|
|
245
196
|
box-sizing: border-box;
|
|
246
197
|
height: 80px;
|
|
247
|
-
width: 160px !important;
|
|
248
198
|
margin-inline: 4px;
|
|
249
199
|
display: flex;
|
|
250
200
|
flex-direction: column;
|