Skip to content

Commit

Permalink
Merge pull request #9 from conductor-sdk/change-undefined-for-empty
Browse files Browse the repository at this point in the history
feat: change isUndefined for isEmpty in video and image
  • Loading branch information
Sudakatux authored Aug 7, 2024
2 parents 1615fb8 + 821c853 commit 2418654
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const Boolean: React.FC<BooleanProps> = ({
checked={!_isUndefined(value) ? value : defaultValue}
disabled={readonly}
required={required}
sx={{ marginBottom: "4px" }}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const DescriptionText: React.FC<DescriptionTextProps> = ({
noWrap={noWrap}
paragraph={paragraph}
whiteSpace={preWrap ? "pre-wrap" : "normal"}
sx={{ marginBottom: "4px" }}
>
{_isUndefined(value) ? label : value}
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


import { Box, FormControl } from "@mui/material";
import _isUndefined from "lodash/isUndefined";
import _isEmpty from "lodash/isEmpty";
export interface ImageViewerProps {
id?: string;
value?: string;
Expand All @@ -30,7 +30,7 @@ const ImageViewer: React.FC<ImageViewerProps> = ({
width,
defaultUrl,
}) => {
const url = _isUndefined(value) ? defaultUrl : value;
const url = _isEmpty(value) ? defaultUrl : value;
return (
<FormControl fullWidth>
<Box
Expand All @@ -45,7 +45,7 @@ const ImageViewer: React.FC<ImageViewerProps> = ({
height={height}
width={width}
alt=""
style={{ maxWidth: "100%" }}
style={{ maxWidth: "100%", marginBottom: "4px" }}
/>
) : (
" No Image to preview"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import { Box, Stack, FormControl } from "@mui/material";
import React from "react";
import ReactPlayer from "react-player";
import _isUndefined from "lodash/isUndefined";
import _isEmpty from "lodash/isEmpty";

export interface VideoViewerProps {
id?: string;
Expand All @@ -32,7 +32,7 @@ const VideoViewer: React.FC<VideoViewerProps> = ({
width,
defaultUrl,
}) => {
const url = _isUndefined(value) ? defaultUrl : value;
const url = _isEmpty(value) ? defaultUrl : value;
return (
<FormControl fullWidth>
<Stack
Expand All @@ -48,6 +48,7 @@ const VideoViewer: React.FC<VideoViewerProps> = ({
justifyContent: "center",
width: "100%",
maxWidth: "100%",
marginBottom: '4px',
">div": {
maxWidth: "600px ",
maxHeight: "500px",
Expand Down

0 comments on commit 2418654

Please sign in to comment.