Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumbnail make boxes same size #1210

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/Thumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ const Thumbnail : React.FC = () => {

const bottomStyle = css({
display: 'flex',
width: '100%',
flexDirection: 'column',
alignItems: 'center',
})
Expand All @@ -106,7 +107,8 @@ const Thumbnail : React.FC = () => {
discard={discardThumbnail}
/>
<div css={bottomStyle}>
<VideoPlayers refs={generateRefs} widthInPercent={100}/>
{/* use maxHeightInPixel to make video players the same size*/}
<VideoPlayers refs={generateRefs} widthInPercent={100} maxHeightInPixel={376}/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This magic number depends on the width of the buttons. If a button is hidden (like in #1208), the width changes.

image

So this should likely have a different solution. Maybe both boxes just get a fixed width. Or something else.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welp, that teaches me to not go for the quick and dirty solution. I'll see if I can get a proper solution working, but that'll require some time.

<div css={videosStyle(theme)}>
<Timeline
timelineHeight={125}
Expand Down
4 changes: 2 additions & 2 deletions src/main/VideoPlayers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { useTheme } from "../themes";

import { backgroundBoxStyle, flexGapReplacementStyle } from '../cssStyles'

const VideoPlayers: React.FC<{refs: any, widthInPercent?: number}> = ({refs, widthInPercent = 100}) => {
const VideoPlayers: React.FC<{refs: any, widthInPercent?: number, maxHeightInPixel?: number}> = ({refs, widthInPercent = 100, maxHeightInPixel = 300}) => {

const videoURLs = useSelector(selectVideoURL)
const videoCount = useSelector(selectVideoCount)
Expand All @@ -37,7 +37,7 @@ const VideoPlayers: React.FC<{refs: any, widthInPercent?: number}> = ({refs, wid
borderRadius: '5px',
...(flexGapReplacementStyle(10, false)),

maxHeight: '300px',
maxHeight: maxHeightInPixel + 'px',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editor is also using emotion-js, right? You should be able to just pass integers here. Also the borderRadius: 5 above should just work. But if the whole codebase uses + 'px' already, then it's probably not necessary to fix this for this one PR now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does use Emotion, but not emotion-js specifically I think? Anyway, I like being specific about my units :D

});

// Initialize video players
Expand Down
Loading