forked from SymfonyCasts/symfony-ux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreactprops-copy-in-component.diff
31 lines (31 loc) · 1.01 KB
/
reactprops-copy-in-component.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/assets/components/FeaturedProduct.js b/assets/components/FeaturedProduct.js
new file mode 100644
index 0000000..91b85ac
--- /dev/null
+++ b/assets/components/FeaturedProduct.js
@@ -0,0 +1,25 @@
+import React from 'react';
+
+export default function(props) {
+ return (
+ <div>
+ <div className="component-light product-show p-3 mb-5">
+ <h5 className="text-center">Featured Product!</h5>
+ <a href={'/product/'+props.product.id}>
+ <img
+ alt={ props.product.name }
+ src={props.product.imageUrl}
+ className="d-block"
+ />
+ </a>
+ <div className="pt-3">
+ <h6>
+ {props.product.name}
+ </h6>
+
+ <a href={'/product/'+props.product.id} className="btn btn-sm btn-primary">More info</a>
+ </div>
+ </div>
+ </div>
+ )
+}