Skip to content

Commit 2e75873

Browse files
authored
Merge pull request #655 from AppQuality/fix-poster
Fix-poster
2 parents 3ac7660 + 7a044c0 commit 2e75873

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

src/features/api/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ export type GetCampaignsByCidUxApiResponse = /** status 200 OK */ {
745745
video?: {
746746
url: string;
747747
streamUrl: string;
748+
poster?: string;
748749
start: number;
749750
end: number;
750751
description?: string;

src/pages/Campaign/useWidgets/Experience/widgets/Insights/HighlightCard.tsx

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ const HighlightCard = ({
6161
videoCount,
6262
index,
6363
insight,
64+
poster,
6465
onClick,
6566
}: {
6667
video: NonNullable<
@@ -69,6 +70,7 @@ const HighlightCard = ({
6970
videoCount: number;
7071
index: number;
7172
insight: NonNullable<GetCampaignsByCidUxApiResponse['findings']>[number];
73+
poster?: string;
7274
onClick?: () => void;
7375
}) => {
7476
const { t } = useTranslation();
@@ -78,18 +80,27 @@ const HighlightCard = ({
7880
<SpecialCard.Header>
7981
<CardThumb>
8082
<VideoPlayIcon />
81-
<Player>
82-
<video src={`${video.url}#t=0.5`}>
83-
<track kind="captions" />
84-
</video>
85-
</Player>
83+
{poster && poster !== '' ? (
84+
<img src={poster} alt={video.description} />
85+
) : (
86+
<Player>
87+
<video src={`${video.url}#t=0.5`}>
88+
<track kind="captions" />
89+
</video>
90+
</Player>
91+
)}
8692
</CardThumb>
8793
<SpecialCard.Header.Label>
8894
<Trans i18nKey="__CAMPAIGN_PAGE_INSIGHTS_VIDEO_PART_NUMBER_LABEL">
8995
Highlight {{ index: index + 1 }} of {{ video_count: videoCount }}
9096
</Trans>
9197
</SpecialCard.Header.Label>
92-
<SpecialCard.Header.Title>
98+
<SpecialCard.Header.Title
99+
style={{
100+
whiteSpace: 'normal',
101+
wordBreak: 'break-word',
102+
}}
103+
>
93104
{`”${video.description}”`}
94105
</SpecialCard.Header.Title>
95106
</SpecialCard.Header>

src/pages/Campaign/useWidgets/Experience/widgets/Insights/Lightbox.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,14 @@ const InsightLightbox = ({
100100
{hideDetails === false && (
101101
<Lightbox.Body.Details>
102102
<div>{getSeverityTag(insight.severity)}</div>
103-
<XL isBold style={{ margin: `${appTheme.space.xs} 0` }}>
103+
<XL
104+
isBold
105+
style={{
106+
margin: `${appTheme.space.xs} 0`,
107+
whiteSpace: 'normal',
108+
wordBreak: 'break-word',
109+
}}
110+
>
104111
{items[`${currentIndex}`].description}
105112
</XL>
106113
<MD style={{ color: appTheme.palette.grey[600] }}>

src/pages/Campaign/useWidgets/Experience/widgets/Insights/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ export const Insights = ({
221221
index={index}
222222
insight={insight}
223223
videoCount={insight.video?.length || 0}
224+
{...(videoPart.poster && {
225+
poster: videoPart.poster,
226+
})}
224227
/>
225228
</Col>
226229
))}
@@ -281,6 +284,9 @@ export const Insights = ({
281284
index={index + 1}
282285
insight={insight}
283286
videoCount={insight.video?.length || 0}
287+
{...(videoPart.poster && {
288+
poster: videoPart.poster,
289+
})}
284290
/>
285291
</Col>
286292
))}

0 commit comments

Comments
 (0)