New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image support in string as source, for svg strings #2983
Conversation
@adids1221 I can't check out this specific branch... Also, why is that a hotfix? |
@adids1221 Worth adding tests at least to the ImageUtils |
src/utils/imageUtils.ts
Outdated
function isSvgData(source?: ImageProps['source']) { | ||
const sourceString = (source as string); | ||
function isSvgData(source?: ImageSourceType) { | ||
const sourceString = source as string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why cast to a string instead of conditioning it? I think it will be clearer
src/components/image/index.tsx
Outdated
@@ -122,7 +126,7 @@ class Image extends PureComponent<Props, State> { | |||
public static overlayTypes = Overlay.overlayTypes; | |||
public static overlayIntensityType = Overlay.intensityTypes; | |||
|
|||
sourceTransformer?: (props: any) => ImagePropTypes.source; | |||
sourceTransformer?: (props: any) => ImagePropTypes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean ImageSourceType
?
* Image support in string as source, for svg strings * code review refactor, image utils testing * removed ImagePropTypes from Image index file
Description
Image support strings as type for
source
.Source now support
svg
image string, requested from theCTO
and theweb editor
teams.Changelog
Image support strings as type for
source
.Additional info