This commit is contained in:
2024-05-08 17:01:33 -04:00
parent 4cea1b0832
commit 6656e3ba43
12 changed files with 380 additions and 126 deletions

View File

@ -19,23 +19,23 @@ class cable {
this.name = name;
this.brand = brand;
this.description = description;
this.short_description = short_description;
if (image === undefined) {
this.image = DefaultPartImg;
} else {
this.image = image;
}
this.short_description = short_description
? short_description
: description;
this.image = image
? `http://localhost${image}`
: DefaultPartImg;
}
returnDiv() {
return (
<NavLink className="browse-cable" to={"/cable/" + this.part_number}>
<NavLink className="browse-cable" to={"/browse/cable/" + this.position}>
<img className="browse-cable-image" src={this.image} alt="Cable" />
<div className="browse-cable-label">
<div className="browse-cable-name">{this.name}</div>
<div className="browse-cable-description">
<span style={{ color: "#007cbe" }}></span>
{this.description}
{this.short_description}
</div>
<div className="browse-cable-brand">
<span style={{ color: "black", backgroundColor: "transparent" }}>
@ -85,6 +85,7 @@ export default class BrowseComponent extends Component {
let map = message.data.map;
for (let i = 0; i < map.length; i++) {
let part_number = map[i].part_number;
let image = map[i].image;
let position = map[i].position;
let name = map[i].name;
let brand = map[i].brand;
@ -97,7 +98,8 @@ export default class BrowseComponent extends Component {
name,
brand,
description,
short_description
short_description,
image
)
);
}