mirror of
https://github.com/phuoc-ng/csslayout.git
synced 2025-10-24 19:26:26 +02:00
List products on sidebar
This commit is contained in:
27
client/components/Product.tsx
Normal file
27
client/components/Product.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* A collection of popular layouts and patterns made with CSS (https://csslayout.io)
|
||||
* (c) 2019 - 2020 Nguyen Huu Phuoc <https://twitter.com/nghuuphuoc>
|
||||
*/
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
import './product.css';
|
||||
import ProductModel from '../constants/ProductModel';
|
||||
import slug from '../helpers/slug';
|
||||
|
||||
interface ProductProps {
|
||||
product: ProductModel;
|
||||
}
|
||||
|
||||
const Product: React.FC<ProductProps> = ({ product }) => {
|
||||
return (
|
||||
<div className="product">
|
||||
<a href={product.url}>
|
||||
<img className="product__logo" src={`/assets/${slug(product.name)}.png`} alt={`${product.name} - ${product.description}`} />
|
||||
<div className="product__desc">{product.description}</div>
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Product;
|
||||
Reference in New Issue
Block a user