@times-components/ts-components 1.105.1-alpha.0 → 1.105.1-alpha.13

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,8 +1,6 @@
1
- import React, { useState } from 'react';
2
- import { Mutation } from 'react-apollo';
1
+ import React, { useMemo, useState } from 'react';
3
2
 
4
3
  import { GetNewsletter } from '@times-components/provider';
5
- import { subscribeNewsletter as subscribeNewsletterMutation } from '@times-components/provider-queries';
6
4
  import { Placeholder } from '@times-components/image';
7
5
  import { capitalise } from '@times-components/utils';
8
6
 
@@ -11,6 +9,8 @@ import { Newsletter } from './newsletter/Newsletter';
11
9
  import { TrackingContextProvider } from '../../helpers/tracking/TrackingContextProvider';
12
10
 
13
11
  import { InpContainer } from './styles';
12
+ import { FetchProvider } from '../../helpers/fetch/FetchProvider';
13
+ import { ContentProvider } from '../save-star/ContentProvider';
14
14
 
15
15
  type InlineNewsletterPuffProps = {
16
16
  copy: string;
@@ -25,8 +25,10 @@ export const InlineNewsletterPuff = ({
25
25
  headline,
26
26
  section
27
27
  }: InlineNewsletterPuffProps) => {
28
- const [justSubscribed, setJustSubscribed] = useState(false);
29
- const [justSubscribedError, setJustSubscribedError] = useState(false);
28
+ const [url, setUrl] = useState<string>(
29
+ `/api/is-subscribed-newsletter/${code}`
30
+ );
31
+ const fetchOptions = useMemo(() => ({ credentials: 'same-origin' }), []);
30
32
 
31
33
  return (
32
34
  <GetNewsletter code={code} ssr={false} debounceTimeMs={0}>
@@ -43,58 +45,44 @@ export const InlineNewsletterPuff = ({
43
45
  );
44
46
  }
45
47
 
46
- if (newsletter.isSubscribed && !justSubscribed) {
48
+ if (newsletter.isSubscribed) {
47
49
  return null;
48
50
  }
49
51
 
50
52
  return (
51
- <Mutation
52
- mutation={subscribeNewsletterMutation}
53
- onCompleted={({ subscribeNewsletter = {} }: any) => {
54
- setJustSubscribed(subscribeNewsletter.isSubscribed);
55
- }}
56
- onError={() => {
57
- setJustSubscribedError(true);
58
- }}
59
- >
60
- {(
61
- subscribeNewsletter: any,
62
- { loading: updatingSubscription }: any
63
- ) => (
64
- <TrackingContextProvider
65
- context={{
66
- object: 'InlineNewsletterPuff',
67
- attrs: {
68
- article_parent_name: newsletter.title,
69
- event_navigation_action: 'navigation'
70
- }
71
- }}
72
- scrolledEvent={{
73
- object: 'NewsletterPuffButton',
74
- attrs: {
75
- event_navigation_name:
76
- 'widget : puff : sign up now : displayed',
77
- event_navigation_browsing_method: 'automated',
78
- event_navigation_action: 'navigation'
79
- }
80
- }}
81
- >
82
- {({ intersectObserverRef }) => (
53
+ <FetchProvider url={url} options={fetchOptions}>
54
+ <TrackingContextProvider
55
+ context={{
56
+ object: 'InlineNewsletterPuff',
57
+ attrs: {
58
+ article_parent_name: newsletter.title,
59
+ event_navigation_action: 'navigation'
60
+ }
61
+ }}
62
+ scrolledEvent={{
63
+ object: 'NewsletterPuffButton',
64
+ attrs: {
65
+ event_navigation_name:
66
+ 'widget : puff : sign up now : displayed',
67
+ event_navigation_browsing_method: 'automated',
68
+ event_navigation_action: 'navigation'
69
+ }
70
+ }}
71
+ >
72
+ {({ intersectObserverRef }) => (
73
+ <ContentProvider>
83
74
  <Newsletter
84
75
  intersectObserverRef={intersectObserverRef}
85
76
  section={capitalise(section)}
86
- justSubscribed={justSubscribed}
87
- justSubscribedError={justSubscribedError}
88
77
  headline={headline}
89
- updatingSubscription={updatingSubscription}
90
78
  copy={copy}
91
79
  code={code}
92
- subscribeNewsletter={subscribeNewsletter}
80
+ subscribeNewsletter={setUrl}
93
81
  />
94
- )}
95
- </TrackingContextProvider>
96
- )}
97
- </Mutation>
82
+ </ContentProvider>
83
+ )}
84
+ </TrackingContextProvider>
85
+ </FetchProvider>
98
86
  );
99
87
  }}
100
88
  </GetNewsletter>
@@ -2,22 +2,17 @@ import React from 'react';
2
2
 
3
3
  import { delay } from '@times-components/test-utils';
4
4
 
5
- import { render, fireEvent, cleanup } from '@testing-library/react';
5
+ import { render, cleanup } from '@testing-library/react';
6
6
  import '@testing-library/jest-dom';
7
7
 
8
8
  import { MockedProvider } from '@times-components/provider-test-tools';
9
9
 
10
10
  import mockDate from 'mockdate';
11
11
 
12
- import {
13
- getNewsletter,
14
- subscribeNewsletter
15
- } from '@times-components/provider-queries';
12
+ import { getNewsletter } from '@times-components/provider-queries';
16
13
  import { InlineNewsletterPuff } from '../InlineNewsletterPuff';
17
14
  import { TrackingContextProvider } from '../../../helpers/tracking/TrackingContextProvider';
18
15
 
19
- import FakeIntersectionObserver from '../../../test-utils/FakeIntersectionObserver';
20
-
21
16
  const renderComponent = (
22
17
  analyticsStream?: () => void,
23
18
  mocks: any[] = [
@@ -38,25 +33,6 @@ const renderComponent = (
38
33
  }
39
34
  }
40
35
  }
41
- },
42
- {
43
- delay: 50,
44
- request: {
45
- query: subscribeNewsletter,
46
- variables: {
47
- code: 'TNL-119'
48
- }
49
- },
50
- result: {
51
- data: {
52
- subscribeNewsletter: {
53
- id: 'a2l6E000000CdHzQAK',
54
- isSubscribed: true,
55
- title: 'RED BOX',
56
- __typename: 'Newsletter'
57
- }
58
- }
59
- }
60
36
  }
61
37
  ]
62
38
  ) =>
@@ -95,22 +71,6 @@ describe('Inline Newsletter Puff', () => {
95
71
  expect(component.baseElement).toMatchSnapshot();
96
72
  });
97
73
 
98
- it('renders signup state', async () => {
99
- const component = renderComponent();
100
- await component.findAllByText('Sign up with one click');
101
- expect(component.baseElement).toMatchSnapshot();
102
- });
103
-
104
- it('renders loading state state', async () => {
105
- const component = renderComponent();
106
- const oneClickSignUp = await component.findAllByText(
107
- 'Sign up with one click'
108
- );
109
-
110
- fireEvent.click(oneClickSignUp[0]);
111
- expect(component.baseElement).toMatchSnapshot();
112
- });
113
-
114
74
  it('renders null when is already subscribed', async () => {
115
75
  const component = renderComponent(jest.fn(), [
116
76
  {
@@ -144,39 +104,4 @@ describe('Inline Newsletter Puff', () => {
144
104
 
145
105
  expect(component.baseElement).toMatchSnapshot();
146
106
  });
147
-
148
- describe('intersectionObserverTests', () => {
149
- let oldIntersectionObserver: typeof IntersectionObserver;
150
- beforeEach(() => {
151
- oldIntersectionObserver = window.IntersectionObserver;
152
- // @ts-ignore
153
- window.IntersectionObserver = FakeIntersectionObserver;
154
- });
155
-
156
- afterEach(() => {
157
- window.IntersectionObserver = oldIntersectionObserver;
158
- });
159
-
160
- it('Sign up with one click : displayed', async () => {
161
- const analyticsStream = jest.fn();
162
- const component = renderComponent(analyticsStream);
163
-
164
- await component.findAllByText('Sign up with one click');
165
-
166
- FakeIntersectionObserver.intersect();
167
-
168
- expect(analyticsStream).toHaveBeenCalledWith({
169
- action: 'Scrolled',
170
- component: 'ArticleSkeleton',
171
- object: 'NewsletterPuffButton',
172
- attrs: {
173
- article_parent_name: 'RED BOX',
174
- eventTime: '2021-05-03T00:00:00.000Z',
175
- event_navigation_action: 'navigation',
176
- event_navigation_browsing_method: 'automated',
177
- event_navigation_name: 'widget : puff : sign up now : displayed'
178
- }
179
- });
180
- });
181
- });
182
107
  });
@@ -1,66 +1,5 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Inline Newsletter Puff renders loading state state 1`] = `
4
- <body>
5
- <div>
6
- <div
7
- class="sc-htpNat sc-ifAKCX iWYiTB"
8
- >
9
- <div
10
- class="sc-htpNat sc-bZQynM fcQclH"
11
- >
12
- <div
13
- class="sc-htpNat sc-htoDjs bnLiNW"
14
- >
15
- <div
16
- class="sc-gzVnrw TDlzj"
17
- />
18
- <div
19
- class="sc-gzVnrw TDlzj"
20
- />
21
- <div
22
- class="sc-gzVnrw TDlzj"
23
- />
24
- </div>
25
- </div>
26
- <div
27
- class="sc-htpNat sc-iwsKbI cuimXU"
28
- >
29
- <div
30
- class="sc-bxivhb sc-gqjmRU kcwRFH"
31
- >
32
- <div
33
- class="sc-bxivhb sc-gZMcBi bklePC"
34
- >
35
- Politics. Explained.
36
-
37
- </div>
38
- Sign up to receive our brilliant Red Box newsletter, Matt Chorley\`s poke at politics delivered every weekday morning at 8am.
39
- <div
40
- class="sc-htpNat sc-VigVT cSaWjg"
41
- >
42
- <button
43
- class="sc-bwzfXH gHDjoa"
44
- >
45
- Sign up with one click
46
- </button>
47
- </div>
48
- </div>
49
- <div
50
- class="sc-htpNat sc-VigVT iWOUWL"
51
- >
52
- <button
53
- class="sc-bdVaJa knKdEu"
54
- >
55
- Sign up with one click
56
- </button>
57
- </div>
58
- </div>
59
- </div>
60
- </div>
61
- </body>
62
- `;
63
-
64
3
  exports[`Inline Newsletter Puff renders null when is already subscribed 1`] = `
65
4
  <body>
66
5
  <div />
@@ -105,50 +44,6 @@ exports[`Inline Newsletter Puff renders placeholder when loading 1`] = `
105
44
  </body>
106
45
  `;
107
46
 
108
- exports[`Inline Newsletter Puff renders signup state 1`] = `
109
- <body>
110
- <div>
111
- <div
112
- class="sc-htpNat sc-ifAKCX iWYiTB"
113
- >
114
- <div
115
- class="sc-htpNat sc-iwsKbI cuimXU"
116
- >
117
- <div
118
- class="sc-bxivhb sc-gqjmRU kcwRFH"
119
- >
120
- <div
121
- class="sc-bxivhb sc-gZMcBi bklePC"
122
- >
123
- Politics. Explained.
124
-
125
- </div>
126
- Sign up to receive our brilliant Red Box newsletter, Matt Chorley\`s poke at politics delivered every weekday morning at 8am.
127
- <div
128
- class="sc-htpNat sc-VigVT cSaWjg"
129
- >
130
- <button
131
- class="sc-bwzfXH gHDjoa"
132
- >
133
- Sign up with one click
134
- </button>
135
- </div>
136
- </div>
137
- <div
138
- class="sc-htpNat sc-VigVT iWOUWL"
139
- >
140
- <button
141
- class="sc-bdVaJa knKdEu"
142
- >
143
- Sign up with one click
144
- </button>
145
- </div>
146
- </div>
147
- </div>
148
- </div>
149
- </body>
150
- `;
151
-
152
47
  exports[`Inline Newsletter Puff renders signup view when not already subscribed 1`] = `
153
48
  <body>
154
49
  <div>
@@ -156,37 +51,30 @@ exports[`Inline Newsletter Puff renders signup view when not already subscribed
156
51
  class="sc-htpNat sc-ifAKCX iWYiTB"
157
52
  >
158
53
  <div
159
- class="sc-htpNat sc-iwsKbI cuimXU"
54
+ class="sc-htpNat sc-dnqmqq duLROv"
160
55
  >
161
56
  <div
162
57
  class="sc-bxivhb sc-gqjmRU kcwRFH"
163
58
  >
164
- <div
165
- class="sc-bxivhb sc-gZMcBi bklePC"
166
- >
167
- Politics. Explained.
168
-
169
- </div>
170
- Sign up to receive our brilliant Red Box newsletter, Matt Chorley\`s poke at politics delivered every weekday morning at 8am.
171
- <div
172
- class="sc-htpNat sc-VigVT cSaWjg"
59
+ An error occurred. Please use the link below.
60
+ <a
61
+ class="link__RespLink-sc-1ocvixa-0 dfMuic"
62
+ href="https://home.thetimes.co.uk/myNews"
173
63
  >
174
- <button
175
- class="sc-bwzfXH gHDjoa"
64
+ <div
65
+ class="hover-icon__HoverIcon-sc-1ge5rtz-0 jJVcIr"
176
66
  >
177
- Sign up with one click
178
- </button>
179
- </div>
67
+ <div
68
+ class="sc-bxivhb sc-EHOje jzxwzj"
69
+ >
70
+ Explore our newsletters
71
+ </div>
72
+ </div>
73
+ </a>
180
74
  </div>
181
75
  <div
182
- class="sc-htpNat sc-VigVT iWOUWL"
183
- >
184
- <button
185
- class="sc-bdVaJa knKdEu"
186
- >
187
- Sign up with one click
188
- </button>
189
- </div>
76
+ class="sc-htpNat sc-jTzLTM gzkEml"
77
+ />
190
78
  </div>
191
79
  </div>
192
80
  </div>
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
 
3
3
  import { NewsletterPuffButton } from '../newsletter-puff-button/NewsletterPuffButton';
4
4
  import { NewsletterPuffLink } from '../newsletter-puff-link/NewsletterPuffLink';
@@ -18,44 +18,44 @@ import { InpContainer } from '../styles';
18
18
  type NewsletterProps = {
19
19
  intersectObserverRef: (ref: HTMLElement | null) => void;
20
20
  section?: string;
21
- justSubscribed: boolean;
22
- justSubscribedError: boolean;
23
21
  headline: string;
24
- updatingSubscription: boolean;
25
22
  copy: string;
26
23
  code: string;
27
- subscribeNewsletter: ({}) => {};
24
+ subscribeNewsletter: any;
25
+ loading?: boolean;
26
+ error?: string;
27
+ data?: { isSubscribed: boolean };
28
28
  };
29
29
 
30
30
  export const Newsletter = ({
31
31
  intersectObserverRef,
32
32
  section,
33
- justSubscribed,
34
- justSubscribedError,
35
33
  headline,
36
- updatingSubscription,
37
34
  copy,
38
35
  code,
39
- subscribeNewsletter
36
+ subscribeNewsletter,
37
+ loading,
38
+ error
40
39
  }: NewsletterProps) => {
40
+ const [justSubscribed, setJustSubscribed] = useState(false);
41
41
  const PuffButton = (style: 'link' | 'button') => (
42
42
  <InpSignupCTAContainer ref={intersectObserverRef} childStyle={style}>
43
43
  <NewsletterPuffButton
44
44
  style={style}
45
- updatingSubscription={updatingSubscription}
45
+ updatingSubscription={loading}
46
46
  onPress={() => {
47
- if (!updatingSubscription) {
48
- subscribeNewsletter({ variables: { code } });
47
+ if (!loading) {
48
+ setJustSubscribed(true);
49
+ subscribeNewsletter(`/api/subscribe-newsletter/${code}`);
49
50
  }
50
51
  }}
51
52
  />
52
53
  </InpSignupCTAContainer>
53
54
  );
54
-
55
55
  return (
56
56
  <React.Fragment>
57
57
  <InpContainer section={section}>
58
- {updatingSubscription && <LoadingOverlay />}
58
+ {loading && <LoadingOverlay />}
59
59
  {justSubscribed && (
60
60
  <InpSubscribedContainer>
61
61
  <InpCopy>
@@ -66,7 +66,7 @@ export const Newsletter = ({
66
66
  <InpPreferencesContainer />
67
67
  </InpSubscribedContainer>
68
68
  )}
69
- {justSubscribedError && (
69
+ {error && (
70
70
  <InpSubscribedContainer>
71
71
  <InpCopy>
72
72
  An error occurred. Please use the link below.
@@ -76,7 +76,7 @@ export const Newsletter = ({
76
76
  </InpSubscribedContainer>
77
77
  )}
78
78
  {!justSubscribed &&
79
- !justSubscribedError && (
79
+ !error && (
80
80
  <InpSignupContainer>
81
81
  <InpCopy>
82
82
  <InpSignupHeadline>{headline} </InpSignupHeadline>
@@ -57,7 +57,7 @@ export const OptaCricketScorecard: React.FC<{
57
57
  show_bowling: true,
58
58
  show_economy: true,
59
59
  show_fow: true,
60
- player_naming: 'last_name',
60
+ player_naming: 'full',
61
61
  breakpoints: '520'
62
62
  }).outerHTML;
63
63
 
@@ -25,7 +25,7 @@ storiesOf('Typescript Component/In Article/Football/Fixtures', module)
25
25
  const selComp = select('Competition', competitons, '8');
26
26
  return (
27
27
  <OptaFootballFixturesTicker
28
- season={text('season', '2023')}
28
+ season={text('season', '2024')}
29
29
  competition={selComp}
30
30
  date_from=""
31
31
  date_to=""
@@ -42,7 +42,7 @@ storiesOf('Typescript Component/In Article/Football/Fixtures', module)
42
42
  const selComp = select('Competition', competitons, '8');
43
43
  return (
44
44
  <OptaFootballFixturesTicker
45
- season={text('season', '2023')}
45
+ season={text('season', '2024')}
46
46
  competition={selComp}
47
47
  date_from=""
48
48
  date_to=""
@@ -6,7 +6,7 @@ exports[`OptaFootballFixturesTicker with flags should render correctly 1`] = `
6
6
  class="sc-bxivhb dBqngZ"
7
7
  >
8
8
  <div
9
- class="sc-htpNat sc-EHOje iKoDpo"
9
+ class="sc-htpNat sc-EHOje gQHnKF"
10
10
  />
11
11
  <div
12
12
  class="sc-bwzfXH uxFfR"
@@ -24,7 +24,7 @@ exports[`OptaFootballFixturesTicker with flags should render correctly 2`] = `
24
24
  class="sc-bxivhb dBqngZ"
25
25
  >
26
26
  <div
27
- class="sc-htpNat sc-EHOje iKoDpo"
27
+ class="sc-htpNat sc-EHOje gQHnKF"
28
28
  >
29
29
  <div>
30
30
  Widget
@@ -40,7 +40,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly 1`] =
40
40
  class="sc-bxivhb dBqngZ"
41
41
  >
42
42
  <div
43
- class="sc-htpNat sc-EHOje iKoDpo"
43
+ class="sc-htpNat sc-EHOje gQHnKF"
44
44
  />
45
45
  <div
46
46
  class="sc-bwzfXH uxFfR"
@@ -58,7 +58,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly 2`] =
58
58
  class="sc-bxivhb dBqngZ"
59
59
  >
60
60
  <div
61
- class="sc-htpNat sc-EHOje iKoDpo"
61
+ class="sc-htpNat sc-EHOje gQHnKF"
62
62
  >
63
63
  <div>
64
64
  Widget
@@ -74,7 +74,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly with f
74
74
  class="sc-bxivhb dBqngZ"
75
75
  >
76
76
  <div
77
- class="sc-htpNat sc-EHOje iKoDpo"
77
+ class="sc-htpNat sc-EHOje gQHnKF"
78
78
  />
79
79
  <div
80
80
  class="sc-bwzfXH uxFfR"
@@ -92,7 +92,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly with f
92
92
  class="sc-bxivhb dBqngZ"
93
93
  >
94
94
  <div
95
- class="sc-htpNat sc-EHOje iKoDpo"
95
+ class="sc-htpNat sc-EHOje gQHnKF"
96
96
  >
97
97
  <div>
98
98
  Widget
@@ -108,7 +108,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly with i
108
108
  class="sc-bxivhb dBqngZ"
109
109
  >
110
110
  <div
111
- class="sc-htpNat sc-EHOje eZPTBn"
111
+ class="sc-htpNat sc-EHOje cjTULJ"
112
112
  />
113
113
  <div
114
114
  class="sc-bwzfXH uxFfR"
@@ -126,7 +126,7 @@ exports[`OptaFootballFixturesTicker without flags should render correctly with i
126
126
  class="sc-bxivhb dBqngZ"
127
127
  >
128
128
  <div
129
- class="sc-htpNat sc-EHOje eZPTBn"
129
+ class="sc-htpNat sc-EHOje cjTULJ"
130
130
  >
131
131
  <div>
132
132
  Widget
@@ -225,18 +225,26 @@ export const WidgetContainer = styled(WidgetContainerBase)<{
225
225
  border-start-start-radius: 4px;
226
226
  border-start-end-radius: 4px;
227
227
 
228
- @media (prefers-color-scheme: dark) {
229
- color: #e4e4e4 !important;
230
- }
228
+ ${({ isApp }) =>
229
+ isApp &&
230
+ `
231
+ @media (prefers-color-scheme: dark) {
232
+ color: #e4e4e4 !important;
233
+ }
234
+ `}
231
235
  }
232
236
 
233
237
  .Opta-timings .Opta-Time * {
234
238
  font-weight: 700;
235
239
  color: #01000d !important;
236
240
 
237
- @media (prefers-color-scheme: dark) {
238
- color: #fff !important;
239
- }
241
+ ${({ isApp }) =>
242
+ isApp &&
243
+ `
244
+ @media (prefers-color-scheme: dark) {
245
+ color: #fff !important;
246
+ }
247
+ `}
240
248
  }
241
249
 
242
250
  .Opta-TeamName,
@@ -244,9 +252,13 @@ export const WidgetContainer = styled(WidgetContainerBase)<{
244
252
  color: #01000d !important;
245
253
  font-family: 'Roboto-Medium' !important;
246
254
 
247
- @media (prefers-color-scheme: dark) {
248
- color: #fff !important;
249
- }
255
+ ${({ isApp }) =>
256
+ isApp &&
257
+ `
258
+ @media (prefers-color-scheme: dark) {
259
+ color: #fff !important;
260
+ }
261
+ `}
250
262
  }
251
263
 
252
264
  .Opta-Away {
@@ -259,9 +271,13 @@ export const WidgetContainer = styled(WidgetContainerBase)<{
259
271
  > div {
260
272
  background-color: #f5f5f5 !important;
261
273
 
262
- @media (prefers-color-scheme: dark) {
263
- background-color: #333 !important;
264
- }
274
+ ${({ isApp }) =>
275
+ isApp &&
276
+ `
277
+ @media (prefers-color-scheme: dark) {
278
+ background-color: #333 !important;
279
+ }
280
+ `}
265
281
  }
266
282
  .Opta-Team-Score::after {
267
283
  content: '-';
@@ -275,10 +291,14 @@ export const WidgetContainer = styled(WidgetContainerBase)<{
275
291
  &.Opta-result > div {
276
292
  border: 1px solid #ccc !important;
277
293
 
278
- @media (prefers-color-scheme: dark) {
279
- background-color: #1d1d1b !important;
280
- border: 1px solid #333 !important;
281
- }
294
+ ${({ isApp }) =>
295
+ isApp &&
296
+ `
297
+ @media (prefers-color-scheme: dark) {
298
+ background-color: #1d1d1b !important;
299
+ border: 1px solid #333 !important;
300
+ }
301
+ `}
282
302
 
283
303
  &.Opta-timings {
284
304
  border-bottom: none !important;
@@ -294,10 +314,14 @@ export const WidgetContainer = styled(WidgetContainerBase)<{
294
314
  &.Opta-live > div {
295
315
  border: 1px solid #01000d !important;
296
316
 
297
- @media (prefers-color-scheme: dark) {
298
- background-color: #121212 !important;
299
- border: 1px solid #e4e4e4 !important;
300
- }
317
+ ${({ isApp }) =>
318
+ isApp &&
319
+ `
320
+ @media (prefers-color-scheme: dark) {
321
+ background-color: #121212 !important;
322
+ border: 1px solid #e4e4e4 !important;
323
+ }
324
+ `}
301
325
 
302
326
  &.Opta-timings {
303
327
  border-bottom: none !important;