Changeset 8572
- Timestamp:
- 04/02/2019 11:03:51 PM (6 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sessions/block-content.js
r8550 r8572 136 136 render() { 137 137 const { attributes, sessionPosts } = this.props; 138 const { show_speaker, show_images, image_align, featured_image_height, featured_image_width, content, excerpt_more, show_meta, show_category } = attributes; 139 const featuredImageSize = { height: featured_image_height, width: featured_image_width }; 138 const { show_speaker, show_images, image_align, featured_image_width, content, excerpt_more, show_meta, show_category } = attributes; 140 139 141 140 return ( … … 164 163 { show_images && 165 164 <FeaturedImage 166 className={ 'wordcamp-session-image-container align-' + decodeEntities( image_align ) } 167 size={ featuredImageSize } 165 className={ classnames( 'wordcamp-session-image-container', 'align-' + decodeEntities( image_align ) ) } 168 166 wpMediaDetails={ get( post, '_embedded.wp:featuredmedia[0].media_details.sizes', {} ) } 169 alt={ post.title.rendered } 170 { ...this.props } 167 alt={ decodeEntities( post.title.rendered ) } 168 width={ Number( featured_image_width ) } 169 imageLink={ post.link } 171 170 /> 172 171 } -
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/featured-image/index.js
r8550 r8572 7 7 * WordPress dependencies. 8 8 */ 9 const { Disabled } = wp.components; 9 10 const { Component } = wp.element; 11 const { isURL } = wp.url; 10 12 11 13 /** … … 66 68 */ 67 69 render() { 68 const { className, alt, attributes } = this.props; 70 const { className, alt, width = 150, imageLink } = this.props; 71 const fullImage = this.getFullImage(); 69 72 70 const { featured_image_width } = attributes; 71 const image = this.getFullImage(); 72 73 const width = featured_image_width || 150; 74 75 return ( 73 let image = ( 76 74 <img 77 75 className={ classnames( 'wordcamp-featured-image', className ) } 78 src={ image.source_url }76 src={ fullImage.source_url } 79 77 alt={ alt } 80 78 width={ width + 'px' } 81 79 /> 82 80 ); 81 82 if ( isURL( imageLink ) ) { 83 image = ( 84 <Disabled> 85 <a href={ imageLink } className={ classnames( 'wordcamp-image-link', 'wordcamp-featured-image-link' ) }> 86 { image } 87 </a> 88 </Disabled> 89 ); 90 } 91 92 image = ( 93 <div className={ classnames( 'wordcamp-image-container', 'wordcamp-featured-image-container', className ) }> 94 { image } 95 </div> 96 ); 97 98 return image; 83 99 } 84 100 } -
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/block-content.js
r8559 r8572 30 30 function SponsorDetail( { sponsorPost, attributes, onFeatureImageChange } ) { 31 31 const { 32 show_name, show_logo, show_desc, content, excerpt_more, 32 show_name, show_logo, show_desc, content, excerpt_more, featured_image_width 33 33 } = attributes; 34 34 … … 42 42 43 43 { ( show_name || show_name === undefined ) && 44 <ItemTitle45 className="wordcamp-sponsor-title"46 headingLevel={ 3 }47 title={ sponsorPost.title.rendered.trim() }48 link={ sponsorPost.link }49 />44 <ItemTitle 45 className="wordcamp-sponsor-title" 46 headingLevel={ 3 } 47 title={ sponsorPost.title.rendered.trim() } 48 link={ sponsorPost.link } 49 /> 50 50 } 51 51 { ( show_logo || show_logo === undefined ) && 52 <FeaturedImage 53 className={ 'wordcamp-sponsor-featured-image wordcamp-sponsor-logo' } 54 wpMediaDetails={ featuredImageSizes } 55 alt={ sponsorPost.title.rendered } 56 attributes={ attributes } 57 /> 52 <FeaturedImage 53 className={ 'wordcamp-sponsor-featured-image wordcamp-sponsor-logo' } 54 wpMediaDetails={ featuredImageSizes } 55 alt={ sponsorPost.title.rendered } 56 width={ featured_image_width } 57 imageLink={ sponsorPost.link } 58 /> 58 59 } 59 60 { ( 'none' !== content ) && 60 <ItemHTMLContent61 className={ classnames( 'wordcamp-sponsor-content' ) }62 content={ displayContent }63 link={ ( 'full' === content || excerpt_more ) ? sponsorPost.link : null }64 linkText={ 'full' === content ? __( 'Visit sponsor page', 'wordcamporg' ) : __( 'Read more', 'wordcamporg' ) }65 />61 <ItemHTMLContent 62 className={ classnames( 'wordcamp-sponsor-content' ) } 63 content={ displayContent } 64 link={ ( 'full' === content || excerpt_more ) ? sponsorPost.link : null } 65 linkText={ 'full' === content ? __( 'Visit sponsor page', 'wordcamporg' ) : __( 'Read more', 'wordcamporg' ) } 66 /> 66 67 } 67 68 </div>
Note: See TracChangeset
for help on using the changeset viewer.