fix: change getAsset to not return a promise (#3232)
* fix: change getAsset to not return a promise * fix: update markdown widget per getAsset changes * test: fix editor component image test * docs: update getAsset docs
This commit is contained in:
@ -2,23 +2,16 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import styled from '@emotion/styled';
|
||||
import { List } from 'immutable';
|
||||
import { WidgetPreviewContainer, Asset } from 'netlify-cms-ui-default';
|
||||
import { WidgetPreviewContainer } from 'netlify-cms-ui-default';
|
||||
|
||||
const StyledImage = styled(({ value: src }) => <img src={src || ''} role="presentation" />)`
|
||||
const StyledImage = styled(({ src }) => <img src={src || ''} role="presentation" />)`
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
`;
|
||||
|
||||
const StyledImageAsset = ({ getAsset, value, field }) => {
|
||||
return (
|
||||
<Asset
|
||||
folder={field.get('media_folder')}
|
||||
path={value}
|
||||
getAsset={getAsset}
|
||||
component={StyledImage}
|
||||
/>
|
||||
);
|
||||
return <StyledImage src={getAsset(value, field.get('media_folder'))} />;
|
||||
};
|
||||
|
||||
const ImagePreviewContent = props => {
|
||||
|
Reference in New Issue
Block a user