From 078eff08b34edb7990bedb01ac2e07b28665a4ee Mon Sep 17 00:00:00 2001 From: YulikK Date: Wed, 12 Jun 2024 15:18:57 +0200 Subject: [PATCH 1/2] feat: link name --- src/widgets/ProductOrder/view/ProductOrderView.ts | 14 ++++++++++++-- .../ProductOrder/view/productOrderView.module.scss | 6 ++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/widgets/ProductOrder/view/ProductOrderView.ts b/src/widgets/ProductOrder/view/ProductOrderView.ts index 2ec44345..486b6b61 100644 --- a/src/widgets/ProductOrder/view/ProductOrderView.ts +++ b/src/widgets/ProductOrder/view/ProductOrderView.ts @@ -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 { 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; From fab41f94cfa3aaf85d5672d42f2d5ad1c2bffde2 Mon Sep 17 00:00:00 2001 From: YulikK Date: Wed, 12 Jun 2024 15:22:00 +0200 Subject: [PATCH 2/2] refactor: delete comment --- src/widgets/ProductOrder/view/ProductOrderView.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widgets/ProductOrder/view/ProductOrderView.ts b/src/widgets/ProductOrder/view/ProductOrderView.ts index 486b6b61..e56f6b08 100644 --- a/src/widgets/ProductOrder/view/ProductOrderView.ts +++ b/src/widgets/ProductOrder/view/ProductOrderView.ts @@ -172,7 +172,6 @@ class ProductOrderView { private createTdProduct(): HTMLTableCellElement { 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] })}`;