Your IP : 216.73.216.162


Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/
Upload File :
Current File : /home/x/b/o/xbodynamge/namtation/wp-content/Thumbnail.js.tar

plugins/themeisle-companion/vendor/codeinwp/gutenberg-blocks/blocks/post-grid/Thumbnail.js000060400000001500151150646310036160 0ustar00home/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.js000064400000001500151157570410034061 0ustar00home/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 );