Skip to content

Commit

Permalink
feat(RSS-ECOMM-5_93): link cart (#364)
Browse files Browse the repository at this point in the history
* feat: link name

* refactor: delete comment
  • Loading branch information
YulikK authored Jun 12, 2024
1 parent 01bf90e commit 899be3b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/widgets/ProductOrder/view/ProductOrderView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,20 @@ 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,
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 899be3b

Please sign in to comment.