Skip to content

Commit dd67624

Browse files
committed
Refactor
1 parent 26a0906 commit dd67624

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

dotcom-rendering/src/components/Card/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ export const Card = ({
10131013
}
10141014
subtitleSize={subtitleSize}
10151015
enableHls={enableHls}
1016-
fullWidth={false}
1016+
letterboxed={true}
10171017
/>
10181018
</Island>
10191019
)}

dotcom-rendering/src/components/LoopVideoInArticle.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export const LoopVideoInArticle = ({
6363
uniqueId={element.id}
6464
width={firstVideoAsset?.dimensions?.width ?? 500}
6565
enableHls={false}
66-
fullWidth={true}
6766
/>
6867
</Island>
6968
{!!caption && (

dotcom-rendering/src/components/SelfHostedVideo.importable.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ const videoContainerStyles = (
5555
}
5656
`;
5757

58-
const figureStyles = (aspectRatio: number, fullWidth: boolean) => css`
58+
const figureStyles = (aspectRatio: number, letterboxed: boolean) => css`
5959
position: relative;
6060
aspect-ratio: ${aspectRatio};
6161
height: 100%;
62-
${!fullWidth &&
62+
${letterboxed &&
6363
css`
6464
max-height: 100vh;
6565
max-height: 100svh;
@@ -153,7 +153,7 @@ type Props = {
153153
subtitleSource?: string;
154154
subtitleSize: SubtitleSize;
155155
enableHls: boolean;
156-
fullWidth: boolean;
156+
letterboxed?: boolean;
157157
};
158158

159159
export const SelfHostedVideo = ({
@@ -174,7 +174,7 @@ export const SelfHostedVideo = ({
174174
subtitleSource,
175175
subtitleSize,
176176
enableHls,
177-
fullWidth,
177+
letterboxed = false,
178178
}: Props) => {
179179
const adapted = useShouldAdapt();
180180
const { renderingTarget } = useConfig();
@@ -708,7 +708,7 @@ export const SelfHostedVideo = ({
708708
>
709709
<figure
710710
ref={setNode}
711-
css={figureStyles(aspectRatio, fullWidth)}
711+
css={figureStyles(aspectRatio, letterboxed)}
712712
className={`video-container ${videoStyle.toLocaleLowerCase()}`}
713713
data-component="gu-video-loop"
714714
>
@@ -742,7 +742,7 @@ export const SelfHostedVideo = ({
742742
subtitleSize={subtitleSize}
743743
activeCue={activeCue}
744744
enableHls={enableHls}
745-
fullWidth={fullWidth}
745+
letterboxed={letterboxed}
746746
/>
747747
</figure>
748748
</div>

dotcom-rendering/src/components/SelfHostedVideoPlayer.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ import { VideoProgressBar } from './VideoProgressBar';
2323

2424
export type SubtitleSize = 'small' | 'medium' | 'large';
2525

26-
const videoStyles = (aspectRatio: number, fullWidth: boolean) => css`
26+
const videoStyles = (aspectRatio: number, letterboxed: boolean) => css`
2727
position: relative;
2828
display: block;
2929
height: auto;
3030
width: 100%;
31-
${!fullWidth &&
31+
${letterboxed &&
3232
css`
3333
max-height: 100vh;
3434
max-height: 100svh;
@@ -130,7 +130,7 @@ type Props = {
130130
/* used in custom subtitle overlays */
131131
activeCue?: ActiveCue | null;
132132
enableHls: boolean;
133-
fullWidth: boolean;
133+
letterboxed: boolean;
134134
};
135135

136136
/**
@@ -173,7 +173,7 @@ export const SelfHostedVideoPlayer = forwardRef(
173173
subtitleSize,
174174
activeCue,
175175
enableHls,
176-
fullWidth,
176+
letterboxed,
177177
}: Props,
178178
ref: React.ForwardedRef<HTMLVideoElement>,
179179
) => {
@@ -204,7 +204,7 @@ export const SelfHostedVideoPlayer = forwardRef(
204204
<video
205205
id={videoId}
206206
css={[
207-
videoStyles(aspectRatio, fullWidth),
207+
videoStyles(aspectRatio, letterboxed),
208208
showSubtitles && subtitleStyles(subtitleSize),
209209
]}
210210
crossOrigin="anonymous"

0 commit comments

Comments
 (0)