Created
February 16, 2020 16:41
-
-
Save gustav1105/ad4e598c5d2c1db49429fb1f37388213 to your computer and use it in GitHub Desktop.
media-component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
//eslint-disable-next-line | |
export const MediaComponent = ({ blockProps }: any) => { | |
const src = blockProps.src; | |
if (src.file) { | |
return ( | |
<img | |
style={{ | |
width: "100%" | |
}} | |
src={src.file} | |
alt="article" | |
/> | |
); | |
} | |
return null; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment