File tree Expand file tree Collapse file tree 2 files changed +37
-36
lines changed Expand file tree Collapse file tree 2 files changed +37
-36
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { GetCampaignsByCidVideoApiResponse } from 'src/features/api';
55import { useLocalizeRoute } from 'src/hooks/useLocalizedRoute' ;
66import { styled } from 'styled-components' ;
77import { getColorWithAlpha } from 'src/common/utils' ;
8+ import { ReactComponent as PlaceholderVideo } from 'src/assets/icons/placeholder-video.svg' ;
89import { getSeverityTagsByVideoCount } from '../utils/getSeverityTagsWithCount' ;
910
1011const Container = styled . div `
@@ -19,31 +20,27 @@ const Container = styled.div`
1920` ;
2021
2122const ThumbnailContainer = styled . div `
22- background-color: ${ ( { theme } ) => theme . palette . black } ;
23- width: 106px;
2423 display: flex;
25- align-items: center;
2624 justify-content: center;
27- margin-bottom: ${ ( { theme } ) => theme . space . xxs } ;
25+ align-items: center;
26+ background-color: ${ ( { theme } ) => theme . palette . black } ;
27+ height: 70px;
28+ width: 110px;
29+ overflow: hidden;
30+
31+ > img,
32+ svg {
33+ width: 100%;
34+ height: auto;
35+ }
2836` ;
29- const StyledAnchor = styled ( Anchor ) < { disabled ?: boolean } > `
30- width: 100%;
3137
32- ${ ( { disabled } ) =>
33- disabled &&
34- `
35- pointer-events: none;
36- cursor: default;
37- ` }
38+ const StyledAnchor = styled ( Anchor ) `
39+ width: 100%;
3840
3941 &:hover {
4042 text-decoration: none;
4143 }
42-
43- video {
44- width: 100%;
45- height: 68px;
46- }
4744` ;
4845
4946const ObservationsTotalContainer = styled . div `
@@ -56,25 +53,15 @@ const Poster = ({
5653 video,
5754} : {
5855 video : GetCampaignsByCidVideoApiResponse [ 'items' ] [ number ] [ 'videos' ] [ number ] ;
59- } ) => {
60- if ( video . poster ) {
61- return (
62- < img
63- src = { video . poster }
64- alt = { `video poster preview of video ${ video . id } ` }
65- />
66- ) ;
67- }
68-
69- return (
70- < ThumbnailContainer >
71- < video >
72- < source src = { `${ video . url } #t0.5` } type = "video/mp4" />
73- < track kind = "captions" />
74- </ video >
75- </ ThumbnailContainer >
76- ) ;
77- } ;
56+ } ) => (
57+ < ThumbnailContainer >
58+ { video . poster ? (
59+ < img src = { video . poster } alt = { `Video ${ video . id } ` } />
60+ ) : (
61+ < PlaceholderVideo />
62+ ) }
63+ </ ThumbnailContainer >
64+ ) ;
7865
7966const Video = ( {
8067 video,
You can’t perform that action at this time.
0 commit comments