Skip to content

Commit d380976

Browse files
committed
Fix shorts width
1 parent d9d7e89 commit d380976

File tree

6 files changed

+18
-13
lines changed

6 files changed

+18
-13
lines changed

ui/component/claimCoverRender/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { connect } from 'react-redux';
22

33
import * as SETTINGS from 'constants/settings';
44

5-
import { getThumbnailFromClaim } from 'util/claim';
5+
import { getThumbnailFromClaim, isClaimShort } from 'util/claim';
66
import { selectShortsSidePanelOpen } from 'redux/selectors/shorts';
77
import { selectClaimForUri, selectClaimIsNsfwForUri } from 'redux/selectors/claims';
88
import { selectClientSetting } from 'redux/selectors/settings';
@@ -17,6 +17,7 @@ const select = (state, props) => {
1717

1818
return {
1919
claimThumbnail: getThumbnailFromClaim(claim),
20+
isShortClaim: isClaimShort(claim),
2021
isMature: selectClaimIsNsfwForUri(state, uri),
2122
renderMode: makeSelectFileRenderModeForUri(uri)(state),
2223
sidePanelOpen: selectShortsSidePanelOpen(state),

ui/component/claimCoverRender/view.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type Props = {
2323
enableSwipe?: boolean,
2424
// -- redux --
2525
claimThumbnail?: string,
26+
isShortClaim: boolean,
2627
obscurePreview: boolean,
2728
renderMode: string,
2829
videoTheaterMode: boolean,
@@ -42,6 +43,7 @@ const ClaimCoverRender = (props: Props) => {
4243
enableSwipe,
4344
// -- redux --
4445
claimThumbnail,
46+
isShortClaim,
4547
obscurePreview,
4648
renderMode,
4749
videoTheaterMode,
@@ -59,7 +61,8 @@ const ClaimCoverRender = (props: Props) => {
5961

6062
const isMobile = useIsMobile();
6163
const theaterMode = RENDER_MODES.FLOATING_MODES.includes(renderMode) && videoTheaterMode;
62-
const thumbnail = useGetPoster(claimThumbnail, isShortsParam);
64+
const isShorts = isShortsParam || isShortClaim;
65+
const thumbnail = useGetPoster(claimThumbnail, isShorts);
6366

6467
const swipeRef = useSwipeNavigation({
6568
onSwipeNext,

ui/component/shortsActions/swipeNavigation/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626

2727
@media (min-width: 1150px) {
28-
width: var(--shorts-viewer-width, 28vw) !important;
28+
width: var(--shorts-viewer-width, var(--shorts-viewer-width-default)) !important;
2929
overflow: hidden;
3030
}
3131

ui/scss/component/_content.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@
638638
video {
639639
width: 100%;
640640
height: 100%;
641-
object-fit: contain;
641+
object-fit: cover;
642642
border-radius: 10px !important;
643643
}
644644
}
@@ -652,7 +652,7 @@
652652
.vjs-tech {
653653
width: 100%;
654654
height: 100%;
655-
object-fit: contain;
655+
object-fit: cover;
656656
}
657657

658658
.vjs-control-bar {
@@ -847,9 +847,9 @@
847847
}
848848

849849
@media (min-width: $breakpoint-medium) {
850-
width: var(--shorts-viewer-width, 28vw) !important;
850+
width: var(--shorts-viewer-width, var(--shorts-viewer-width-default)) !important;
851851
.content__wrapper {
852-
width: var(--shorts-viewer-width, 28vw) !important;
852+
width: var(--shorts-viewer-width, var(--shorts-viewer-width-default)) !important;
853853
}
854854
}
855855

ui/scss/component/_shorts.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,11 @@ body:has(.main--shorts-page):not(:has(.navigation__overlay--active)) {
250250

251251
@media (min-width: $breakpoint-medium) {
252252
.shorts-page__info-button.shorts-page-menu__button {
253-
right: calc(49.8% - var(--shorts-viewer-width, 28vw) / 2 - 60px + 7.5px);
253+
right: calc(49.8% - var(--shorts-viewer-width, var(--shorts-viewer-width-default)) / 2 - 60px + 7.5px);
254254
}
255255

256256
.shorts-page__info-button:not(.shorts-page-menu__button) {
257-
right: calc(49.8% - var(--shorts-viewer-width, 28vw) / 2 - 60px + 7.5px);
257+
right: calc(49.8% - var(--shorts-viewer-width, var(--shorts-viewer-width-default)) / 2 - 60px + 7.5px);
258258
}
259259

260260
.shorts-page__back-button {
@@ -625,11 +625,11 @@ body:has(.main--shorts-page):not(:has(.navigation__overlay--active)) {
625625

626626
@media (min-width: $breakpoint-medium) {
627627
.shorts-page__info-button {
628-
right: calc(49.8% - var(--shorts-viewer-width, 28vw) / 2 - 60px + 7.5px);
628+
right: calc(49.8% - var(--shorts-viewer-width, var(--shorts-viewer-width-default)) / 2 - 60px + 7.5px);
629629
}
630630

631631
.shorts-page__navigation {
632-
right: calc(49.8% - var(--shorts-viewer-width, 28vw) / 2 - 60px);
632+
right: calc(49.8% - var(--shorts-viewer-width, var(--shorts-viewer-width-default)) / 2 - 60px);
633633
bottom: 8.5vh;
634634
}
635635

@@ -699,7 +699,7 @@ body:has(.main--shorts-page):not(:has(.navigation__overlay--active)) {
699699
}
700700

701701
@media (min-width: $breakpoint-large) {
702-
width: var(--shorts-viewer-width, 28vw) !important;
702+
width: var(--shorts-viewer-width, var(--shorts-viewer-width-default)) !important;
703703
}
704704

705705
@media (max-width: 1380px) and (min-width: $breakpoint-small) and (max-height: 860px) {
@@ -717,4 +717,4 @@ body:has(.main--shorts-page):not(:has(.navigation__overlay--active)) {
717717
}
718718
}
719719
}
720-
}
720+
}

ui/scss/init/_vars.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
--spacing-main-padding: var(--spacing-xl);
6060
--floating-viewer-width: 32rem;
61+
--shorts-viewer-width-default: calc(90vh * 9 / 16);
6162
--floating-viewer-height: 18rem; // 32 * 9/16
6263
--option-select-width: 8rem;
6364

0 commit comments

Comments
 (0)