-
-
Save isavch/7e7fff7846ae39109f32f120f96e6f78 to your computer and use it in GitHub Desktop.
certona
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class GlassCertonaWithOverlap extends Component { | |
| state = { | |
| deviceSize: 0, | |
| cardSize: 0, | |
| style: {} | |
| } | |
| getCardImage = card => { | |
| const { clientWidth } = card.querySelector('img') | |
| this.setState({ | |
| style: getOverlapStyle(clientWidth, this.props.componentOverlap) | |
| }) | |
| } | |
| onSizeChange = deviceSize => { | |
| this.setState({ deviceSize }) | |
| } | |
| render() { | |
| return ( | |
| <div style={this.state.style}> | |
| <GlassResizeTracker onChange={onSizeChange} /> | |
| <GlassCertonaCarousel | |
| getCardImage={this.getCardImage} | |
| title={this.props.title} | |
| scheme={this.props.certona_zone_id} | |
| count={parseInt(this.props.certona_recommendation_count, 10) || 16} | |
| /> | |
| </div> | |
| ) | |
| } | |
| } | |
| const renderRecommendations = component => { | |
| const contentFields = getContentFields(component) | |
| const componentOverlap = getComponentOverlap(component) | |
| return componentOverlap ? ( | |
| <GlassCertonaWithOverlap | |
| title={contentFields.title} | |
| scheme={contentFields.certona_zone_id} | |
| count={parseInt(contentFields.certona_recommendation_count, 10) || 16} | |
| /> | |
| ) : ( | |
| <GlassCertonaCarousel | |
| title={contentFields.title} | |
| scheme={contentFields.certona_zone_id} | |
| count={parseInt(contentFields.certona_recommendation_count, 10) || 16} | |
| className={'stack'} | |
| /> | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment