-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DCN-112 - Add promo product for Magento integration
- Loading branch information
Showing
7 changed files
with
68 additions
and
39 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React from 'react'; | ||
|
||
const MagentoProductPromo = props => { | ||
const value = | ||
props.product && props.product.value && JSON.parse(props.product.value); | ||
|
||
if (!value) { | ||
return null; | ||
} | ||
|
||
const imageLink = value.previewUrl ? ( | ||
<img alt={value.title} src={value.previewUrl} title={value.title} /> | ||
) : ( | ||
<div style={{ height: '257.15px' }} className="placeholder-tile-image"> | ||
{this.props.t('noTeaserValue')} | ||
</div> | ||
); | ||
|
||
const storeFrontUrl = `https://demo1-m2.mage.direct/${value.urlKey}.html`; | ||
|
||
return ( | ||
<div className="row"> | ||
<h2>Featured product</h2> | ||
<div className="col-md-6 col-lg-4"> | ||
<div className="product-tile"> | ||
<h1 className="product-heading">{value.title}</h1> | ||
<figure className="product-tile-image">{imageLink}</figure> | ||
<div className="product-tile-info"> | ||
<a className="btn btn-secondary" href={storeFrontUrl}> | ||
See more details | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MagentoProductPromo; |
This file contains 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
This file contains 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
This file contains 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