| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/Thumbnail.js.tar |
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/post-grid/Thumbnail.js 0000604 00000001500 15115064631 0036160 0 ustar 00 home/xbodynamge/crosstraining/wp-content /**
* WordPress Dependencies
*/
const { Spinner } = wp.components;
const { withSelect } = wp.data;
const { Component } = wp.element;
class Thumbnail extends Component {
constructor() {
super( ...arguments );
}
render() {
const { alt, id, thumbnail, link } = this.props;
const img = thumbnail ? <img src={ thumbnail } alt={ alt } data-id={ id } /> : <Spinner />;
return (
<div className="post-thumbnail" >
<a href={ link }>{ img }</a>
</div>
);
}
}
export default withSelect( ( select, ownProps ) => {
const { id } = ownProps;
const image = id ? select( 'core' ).getMedia( id ) : undefined;
const size = 'medium';
const thumbnail = image ? image.media_details.sizes[size].source_url : null;
return image ? {
thumbnail: thumbnail,
alt: image.alt_text
} : {
alt: null
};
})( Thumbnail );
plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/post-grid/Thumbnail.js 0000644 00000001500 15115757041 0034061 0 ustar 00 home/xbodynamge/dev/wp-content /**
* WordPress Dependencies
*/
const { Spinner } = wp.components;
const { withSelect } = wp.data;
const { Component } = wp.element;
class Thumbnail extends Component {
constructor() {
super( ...arguments );
}
render() {
const { alt, id, thumbnail, link } = this.props;
const img = thumbnail ? <img src={ thumbnail } alt={ alt } data-id={ id } /> : <Spinner />;
return (
<div className="post-thumbnail" >
<a href={ link }>{ img }</a>
</div>
);
}
}
export default withSelect( ( select, ownProps ) => {
const { id } = ownProps;
const image = id ? select( 'core' ).getMedia( id ) : undefined;
const size = 'medium';
const thumbnail = image ? image.media_details.sizes[size].source_url : null;
return image ? {
thumbnail: thumbnail,
alt: image.alt_text
} : {
alt: null
};
})( Thumbnail );