Skip to content

Commit

Permalink
Add minimum height to video container to fix review on landscape phone
Browse files Browse the repository at this point in the history
Before, the video might not be visible at all (due to the controls).
Now it scrolls, which is sub-optimal, but at least usable.
  • Loading branch information
LukasKalbertodt committed Sep 7, 2020
1 parent 4f386d4 commit 801e545
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ui/studio/elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const useVideoBoxResize = () => React.useContext(VideoBoxResizeContext);
// - `dimensions`: a function returning `[width, height]` of the child (also
// defining the aspect ratio). We require the dimensions instead of only the
// aspect ratio to better detect changes in the video stream.
export function VideoBox({ gap = 0, minWidth = 180, children }) {
export function VideoBox({ gap = 0, minWidth = 180, minHeight = 140, children }) {
const { ref, width = 1, height = 1 } = useResizeObserver();

// This is a dummy state to force a rerender.
Expand Down Expand Up @@ -159,7 +159,7 @@ export function VideoBox({ gap = 0, minWidth = 180, children }) {

return (
<VideoBoxResizeContext.Provider value={resizeVideoBox}>
<div ref={ref} sx={{ flex: '1 0 0', minHeight: 0, display: 'flex' }}>
<div ref={ref} sx={{ flex: '1 0 0', minHeight, display: 'flex' }}>
<div sx={{
height: childHeight,
width: childWidth,
Expand Down Expand Up @@ -266,7 +266,7 @@ export function VideoBox({ gap = 0, minWidth = 180, children }) {
display: 'flex',
flexDirection,
justifyContent: 'space-between',
minHeight: 0,
minHeight,
}}
>
<div sx={{
Expand Down

0 comments on commit 801e545

Please sign in to comment.