Skip to content

Commit 517a094

Browse files
authored
Merge pull request #10 from imranhsayed/feature/add-product-price
Add price html
2 parents 3e57edc + b858533 commit 517a094

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function Home({ headerFooter, products }) {
1818
return (
1919
<div >
2020
<Header header={header}/>
21-
<main className="container mx-auto p-4">
21+
<main className="container mx-auto py-4">
2222
<Products products={products}/>
2323
</main>
2424

src/components/products/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { isArray, isEmpty } from 'lodash';
22
import Link from 'next/link';
33
import Image from '../image';
4+
import { sanitize } from '../../utils/miscellaneous';
45

56
const Products = ({ products }) => {
67

@@ -25,6 +26,7 @@ const Products = ({ products }) => {
2526
height="380"
2627
/>
2728
<h3 className="font-bold uppercase">{ product?.name ?? '' }</h3>
29+
<div dangerouslySetInnerHTML={{ __html: sanitize( product?.price_html ?? '' ) }}/>
2830
</a>
2931
</Link>
3032
</div>

0 commit comments

Comments
 (0)