Skip to content

Commit

Permalink
[not verified] VideoPress: Fix local video listed as VideoPress video (
Browse files Browse the repository at this point in the history
…#28237)

* add isLocalVideo flag to VideoRow

* changelog
  • Loading branch information
dhasilva authored and n3f committed Jan 11, 2023
1 parent d982962 commit 4d7b0fb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

VideoPress: Fix local video listed as VideoPress video
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useState } from 'react';
*/
import { VIDEO_PRIVACY_LEVELS, VIDEO_PRIVACY_LEVEL_PRIVATE } from '../../../state/constants';
import Checkbox from '../checkbox';
import ConnectVideoRow, { VideoRow, Stats } from '../video-row';
import ConnectVideoRow, { LocalVideoRow, Stats } from '../video-row';
import styles from './style.module.scss';
/**
* Types
Expand Down Expand Up @@ -151,7 +151,7 @@ export const LocalVideoList = ( {
return null;
}
return (
<VideoRow
<LocalVideoRow
key={ `local-video-${ video.id }` }
id={ video.id }
title={ video.title }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export const VideoRow = ( {
disableActionButton = false,
disabled = false,
uploadProgress,
isLocalVideo = false,
}: VideoRowProps ) => {
const textRef = useRef( null );
const checkboxRef = useRef( null );
Expand Down Expand Up @@ -320,11 +321,17 @@ export const VideoRow = ( {
) }
</div>

<PublishFirstVideoPopover id={ id } anchor={ anchor } position="top center" />
{ ! isLocalVideo && (
<PublishFirstVideoPopover id={ id } anchor={ anchor } position="top center" />
) }
</div>
);
};

export const LocalVideoRow = ( props: VideoRowProps ) => {
return <VideoRow isLocalVideo={ true } { ...props } />;
};

export const ConnectVideoRow = ( { id, ...restProps }: VideoRowProps ) => {
const { isDeleting, uploading, processing, isUpdatingPoster, data, uploadProgress } = useVideo(
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ type VideoRowBaseProps = {
* Adornment to be showed after title.
*/
disableActionButton?: boolean;
/**
* True when row is used to show a local video.
*/
isLocalVideo?: boolean;
};

type VideoPressVideoProps = VideoRowBaseProps &
Expand Down

0 comments on commit 4d7b0fb

Please sign in to comment.