fix: dialog import and video height fix

This commit is contained in:
JohnMark Sill 2022-02-18 20:46:04 -06:00
parent 0c07eccbd1
commit f671b99c52
2 changed files with 7 additions and 15 deletions

View File

@ -36,21 +36,13 @@ export const HistoryVideo = ({
const [videoHeight, setVideoHeight] = useState<number>(undefined);
const [videoProperties, setVideoProperties] = useState<VideoProperties>(undefined);
const initializeVideoContainerHeight = useCallback(() => {
const video = videoRef.current;
const videoExists = !isNullOrUndefined(video);
if (videoExists) {
const videoHeight = video.offsetHeight;
const videoHasHeight = videoHeight > 0;
if (videoHasHeight) {
setVideoHeight(videoHeight);
}
const currentVideo = videoRef.current;
if (currentVideo && !videoHeight) {
const currentVideoHeight = currentVideo.offsetHeight;
if (currentVideoHeight > 0) {
setVideoHeight(currentVideoHeight);
}
}, [videoRef]);
useEffect(() => {
initializeVideoContainerHeight();
}, [initializeVideoContainerHeight]);
}
useEffect(() => {
const idExists = !isNullOrUndefined(id);

View File

@ -1,6 +1,6 @@
import { h } from 'preact';
import Dialog from '../Dialog';
import { fireEvent, render, screen } from '@testing-library/preact';
import { render, screen } from '@testing-library/preact';
describe('Dialog', () => {
let portal;