Skip to content

Commit 1bc18b3

Browse files
authored
Merge branch 'latest' into WS-2627-my-news-page-front-end-improvements
2 parents 7986f99 + a12fd33 commit 1bc18b3

92 files changed

Lines changed: 3526 additions & 784 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Known Vulnerabilities](https://snyk.io/test/github/bbc/simorgh/badge.svg)](https://snyk.io/test/github/bbc/simorgh)
55
[![Storybook](https://cdn.jsdelivr.net/gh/storybooks/brand@master/badge/badge-storybook.svg)](https://bbc.github.io/simorgh/)
66

7-
BBC World Service News websites are rendered using Simorgh, a ReactJS based application. Simorgh also renders AMP news article pages for World Service and Public Service News.
7+
BBC World Service News websites are rendered using Simorgh, a ReactJS based application. Simorgh also renders AMP news article pages for World Service and Public Service News.
88

99
Simorgh provides a fast and accessible web experience used by millions of people around the world each month ([see list of websites using Simorgh](https://github.com/bbc/simorgh/blob/latest/docs/Simorgh-Release-Info.mdx)). It is regularly maintained and well documented, and we welcome open source contributors.
1010

src/app/components-webcore/SportDataHeader/head-to-head-v2/components/footer.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/app/components-webcore/SportDataHeader/head-to-head-v2/components/head-to-head-banner.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@ import Centre from './centre';
44
import MatchProgress from './match-progress';
55
import PenaltyScores from './penalty-scores';
66
import styles from '../index.styles';
7-
import type { HeadToHeadV2Data, BadgePlaceholderFallbackType } from '../types';
7+
import type { HeadToHeadV2Data } from '../types';
88

99
interface ItemWrapperProps {
1010
data: HeadToHeadV2Data;
1111
isConciseView: boolean;
1212
shouldHideBadges: boolean;
1313
maxScoreLength?: number;
14-
teamBadgePlaceholderFallbackType?: BadgePlaceholderFallbackType;
1514
}
1615

1716
const ItemWrapper = ({
1817
data,
1918
isConciseView,
2019
shouldHideBadges,
2120
maxScoreLength,
22-
teamBadgePlaceholderFallbackType,
2321
}: ItemWrapperProps) => {
2422
const shouldDisplayPenScores =
2523
data.home.runningScores?.penaltyShootout &&
2624
data.away.runningScores?.penaltyShootout;
25+
2726
return (
2827
<>
2928
<div
@@ -32,13 +31,13 @@ const ItemWrapper = ({
3231
>
3332
<div css={styles.teamHome} data-participant-id={data.home.id}>
3433
<Team
34+
urn={data.home.urn}
3535
alignment="home"
3636
name={data.home.fullName}
3737
shortName={data.home.shortName}
38-
urn={data.home.urn}
3938
isConciseView={isConciseView}
40-
shouldHideBadges={shouldHideBadges}
41-
badgePlaceholderFallbackType={teamBadgePlaceholderFallbackType}
39+
imageUrl={data.home.imageSrc}
40+
hideBadges={shouldHideBadges}
4241
/>
4342
</div>
4443
<div css={styles.scores}>
@@ -49,13 +48,13 @@ const ItemWrapper = ({
4948
</div>
5049
<div css={styles.teamAway} data-participant-id={data.away.id}>
5150
<Team
51+
urn={data.away.urn}
5252
alignment="away"
5353
name={data.away.fullName}
5454
shortName={data.away.shortName}
55-
urn={data.away.urn}
5655
isConciseView={isConciseView}
57-
shouldHideBadges={shouldHideBadges}
58-
badgePlaceholderFallbackType={teamBadgePlaceholderFallbackType}
56+
imageUrl={data.away.imageSrc}
57+
hideBadges={shouldHideBadges}
5958
/>
6059
</div>
6160
<div css={styles.matchProgressContainer}>
@@ -73,7 +72,6 @@ interface HeadToHeadBannerProps {
7372
eventSummary: string;
7473
shouldHideBadges: boolean;
7574
maxScoreLength?: number;
76-
teamBadgePlaceholderFallbackType?: BadgePlaceholderFallbackType;
7775
}
7876

7977
export const HeadToHeadBanner = ({
@@ -82,7 +80,6 @@ export const HeadToHeadBanner = ({
8280
eventSummary,
8381
shouldHideBadges,
8482
maxScoreLength,
85-
teamBadgePlaceholderFallbackType,
8683
}: HeadToHeadBannerProps) => (
8784
<>
8885
<VisuallyHiddenText>{eventSummary}</VisuallyHiddenText>
@@ -91,7 +88,6 @@ export const HeadToHeadBanner = ({
9188
isConciseView={isConciseView}
9289
shouldHideBadges={shouldHideBadges}
9390
maxScoreLength={maxScoreLength}
94-
teamBadgePlaceholderFallbackType={teamBadgePlaceholderFallbackType}
9591
/>
9692
</>
9793
);

src/app/components-webcore/SportDataHeader/head-to-head-v2/components/head-to-head-header.tsx

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/app/components-webcore/SportDataHeader/head-to-head-v2/components/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ export { default as Card } from './card';
99
export { default as Centre, shouldShowScores } from './centre';
1010
export { default as ConditionalOnwardJourneyLink } from './conditional-onward-journey-link';
1111
export { default as FixtureTime } from './fixture-time';
12-
export { default as Footer } from './footer';
1312
export { default as GroupedEvents } from './grouped-events';
1413
export { HeadToHeadBanner } from './head-to-head-banner';
15-
export { default as HeadToHeadHeader } from './head-to-head-header';
1614
export { KeyEvents } from './key-events';
1715
export { default as MatchProgress } from './match-progress';
1816
export { default as PenaltyScores } from './penalty-scores';

src/app/components-webcore/SportDataHeader/head-to-head-v2/components/sport-badge/badges-map.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
// eslint-disable-next-line no-restricted-exports
22
export { default } from './sport-badge';
3-
export { hasMapping as hasTeamBadgeMapping } from './badges-map';

src/app/components-webcore/SportDataHeader/head-to-head-v2/components/sport-badge/sport-badge.tsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { getImage } from './badges-map';
21
import styles from '../../index.styles';
3-
import type { BadgePlaceholderFallbackType, BadgeSize } from '../../types';
2+
import type { BadgeSize } from '../../types';
43

54
const getTestId = (id?: string): string => {
65
const urnId =
@@ -11,22 +10,14 @@ const getTestId = (id?: string): string => {
1110

1211
interface SportBadgeProps {
1312
size: BadgeSize;
14-
id?: string;
13+
urn: string;
14+
src: string | null;
1515
alt?: string;
16-
usePlaceholderFallback?: boolean;
17-
placeholderFallbackType?: BadgePlaceholderFallbackType;
1816
isConciseView?: boolean;
1917
}
2018

21-
const SportBadge = ({
22-
size,
23-
id,
24-
alt = '',
25-
usePlaceholderFallback = true,
26-
placeholderFallbackType = 'badge',
27-
}: SportBadgeProps) => {
28-
const testId = getTestId(id);
29-
const src = getImage({ id, usePlaceholderFallback, placeholderFallbackType });
19+
const SportBadge = ({ urn, size, src, alt = '' }: SportBadgeProps) => {
20+
const testId = getTestId(urn);
3021

3122
if (!src) return null;
3223

@@ -35,7 +26,6 @@ const SportBadge = ({
3526
css={styles.badgeContainer(size)}
3627
data-testid={`badge-container-${testId}`}
3728
>
38-
{/* Empty alt string should hide images from assistive technology, but won't hide certain SVG contents in some browsers - e.g. Safari */}
3929
<img
4030
css={styles.badgeImage}
4131
alt={alt}

0 commit comments

Comments
 (0)