Skip to content

Commit

Permalink
Merge pull request #6924 from topcoder-platform/PROD-4251
Browse files Browse the repository at this point in the history
PROD-4251 -> develop
  • Loading branch information
kkartunov authored Oct 17, 2023
2 parents 3a9a745 + eed2118 commit 8056220
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ workflows:
filters:
branches:
only:
- free
- PROD-4251
# This is alternate dev env for parallel testing
- "build-qa":
context : org-global
Expand Down
8 changes: 7 additions & 1 deletion src/shared/components/GUIKit/PhotoVideoItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ function PhotoVideoItem({
})}
type="button"
>
{imageUrl ? (<img styleName="img-container" src={imageUrl} alt="" />) : null}
{imageUrl && !isThisVideo ? (<img styleName="img-container" src={imageUrl} alt="" />) : null}
{isThisVideo && (
<video styleName="video-container">
<source src={imageUrl} />
<track kind="captions" />
</video>
)}
{isThisVideo ? (<BtnPlay styleName="btn-play" width="25" height="25" />) : null}
</button>
);
Expand Down
4 changes: 4 additions & 0 deletions src/shared/components/GUIKit/PhotoVideoItem/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
object-fit: cover;
}

.video-container {
max-width: 100%;
}

.btn-play {
position: absolute;
top: calc(50% - 12px);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ function ModalPhotoViewer({ onClose, selectedPhoto, photos }) {
selected: photo.id === localSelectedPhoto,
})}
url={photo.previewUrl || photo.url}
videoThumnailUrl={photo.videoThumnailUrl}
isUrlPhoto={!photo.videoThumnailUrl}
videoThumnailUrl={photo.previewUrl || photo.url}
isUrlPhoto={!photo.isVideo}
onClick={() => setLocalSelectedPhoto(photo.id)}
key={uuidv4()}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ function ApprovalItem({
key={photo.id}
styleName="photo-item"
url={photo.previewUrl || photo.url}
videoThumnailUrl={photo.videoThumnailUrl}
isUrlPhoto={!photo.videoThumnailUrl}
videoThumnailUrl={photo.previewUrl || photo.url}
isUrlPhoto={!photo.isVideo}
onClick={() => {
setShowModalPhoto(true);
setSelectedPhoto(photo.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ function PhotoItemsMobile({ photos, className }) {
role="button"
tabIndex={0}
>
{selectedPhotoObject && !selectedPhotoObject.videoThumnailUrl ? (<img src={selectedPhotoObject.previewUrl || selectedPhotoObject.url} alt="main" />) : null}
{selectedPhotoObject && !!selectedPhotoObject.videoThumnailUrl ? (
{selectedPhotoObject && !selectedPhotoObject.isVideo ? (<img src={selectedPhotoObject.previewUrl || selectedPhotoObject.url} alt="main" />) : null}
{selectedPhotoObject && selectedPhotoObject.isVideo ? (
<React.Fragment>
<img src={selectedPhotoObject.videoThumnailUrl} alt="main" />
<video styleName="video-container">
<source src={selectedPhotoObject.url} />
<track kind="captions" />
</video>
<BtnPlay styleName="img-play" />
</React.Fragment>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
top: calc(50% - 25px);
}

.video-container {
max-width: 100%;
}

.btn-left,
.btn-right {
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ function EventItem({
<PhotoVideoItem
styleName="photo-item hide-mobile"
url={photo.previewUrl || photo.url}
videoThumnailUrl={photo.videoThumnailUrl}
isUrlPhoto={!photo.videoThumnailUrl}
videoThumnailUrl={photo.url}
isUrlPhoto={!photo.isVideo}
key={photo.id}
onClick={() => {
setShowModalPhoto(true);
Expand Down

0 comments on commit 8056220

Please sign in to comment.