Skip to content

Commit

Permalink
feat: link name
Browse files Browse the repository at this point in the history
  • Loading branch information
YulikK committed Jun 12, 2024
1 parent 01bf90e commit 078eff0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/widgets/ProductOrder/view/ProductOrderView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,21 @@ class ProductOrderView {
}

private createTdProduct(): HTMLTableCellElement {
return createBaseElement({
const td = createBaseElement({
cssClasses: [styles.td, styles.nameCell, styles.mainText],
innerContent: this.productItem.name[Number(getCurrentLanguage() === LANGUAGE_CHOICE.RU)].value,
// innerContent: this.productItem.name[Number(getCurrentLanguage() === LANGUAGE_CHOICE.RU)].value,
tag: 'td',
});
const href = `${buildPath.productPathWithIDAndQuery(this.productItem.key, { size: [this.productItem.size] })}`;
const link = new LinkModel({
attrs: {
href,
},
classes: [styles.nameLink],
text: this.productItem.name[Number(getCurrentLanguage() === LANGUAGE_CHOICE.RU)].value,
});
td.append(link.getHTML());
return td;
}

private createTdSize(): HTMLTableCellElement {
Expand Down
6 changes: 6 additions & 0 deletions src/widgets/ProductOrder/view/productOrderView.module.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@import 'src/app/styles/mixins';

$color: var(--steam-green-800);

.style {
display: block;
}
Expand Down Expand Up @@ -110,6 +112,10 @@
}
}

.nameLink {
@include link(0 0, $color);
}

.nameCell {
justify-content: flex-start;
grid-area: 2 / 2 / 3 / 3;
Expand Down

0 comments on commit 078eff0

Please sign in to comment.