From 899be3bd0e6af4d3bbfae4255a1d719fa063a60d Mon Sep 17 00:00:00 2001 From: Yuliya Kursevich <54816946+YulikK@users.noreply.github.com> Date: Wed, 12 Jun 2024 15:31:33 +0200 Subject: [PATCH] feat(RSS-ECOMM-5_93): link cart (#364) * feat: link name * refactor: delete comment --- src/widgets/ProductOrder/view/ProductOrderView.ts | 13 +++++++++++-- .../ProductOrder/view/productOrderView.module.scss | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/widgets/ProductOrder/view/ProductOrderView.ts b/src/widgets/ProductOrder/view/ProductOrderView.ts index 2ec44345..e56f6b08 100644 --- a/src/widgets/ProductOrder/view/ProductOrderView.ts +++ b/src/widgets/ProductOrder/view/ProductOrderView.ts @@ -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 { diff --git a/src/widgets/ProductOrder/view/productOrderView.module.scss b/src/widgets/ProductOrder/view/productOrderView.module.scss index 33029a3e..a8eda741 100644 --- a/src/widgets/ProductOrder/view/productOrderView.module.scss +++ b/src/widgets/ProductOrder/view/productOrderView.module.scss @@ -1,5 +1,7 @@ @import 'src/app/styles/mixins'; +$color: var(--steam-green-800); + .style { display: block; } @@ -110,6 +112,10 @@ } } +.nameLink { + @include link(0 0, $color); +} + .nameCell { justify-content: flex-start; grid-area: 2 / 2 / 3 / 3;