Skip to content

Instantly share code, notes, and snippets.

@gustav1105
Created February 16, 2020 16:41
Show Gist options
  • Save gustav1105/ad4e598c5d2c1db49429fb1f37388213 to your computer and use it in GitHub Desktop.
Save gustav1105/ad4e598c5d2c1db49429fb1f37388213 to your computer and use it in GitHub Desktop.
media-component
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