Skip to content

Commit

Permalink
fix: improve product tile actions visibility + improve compare icon (#…
Browse files Browse the repository at this point in the history
…1082)

* add layer for button row of product tile
* change icon for compare
  • Loading branch information
suschneider authored Mar 24, 2022
1 parent fe9b875 commit dc36f5c
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/app/core/icon.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import {
faAngleUp,
faArrowAltCircleRight,
faArrowsAlt,
faBalanceScale,
faBan,
faBars,
faCheck,
faCheckCircle,
faCog,
faCogs,
faColumns,
faEnvelope,
faFastForward,
faFax,
Expand Down Expand Up @@ -62,13 +62,13 @@ export class IconModule {
faAngleUp,
faArrowsAlt,
faArrowAltCircleRight,
faBalanceScale,
faBan,
faBars,
faCheck,
faCheckCircle,
faCog,
faCogs,
faColumns,
faGlobeAmericas,
faHome,
faInbox,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ng-container *ishFeature="'compare'">
<li *ngIf="configuration$('addToCompare') | async" [attr.data-testing-id]="'compare-' + product.sku">
<a routerLink="/compare" (click)="addToCompare()" rel="nofollow">
<fa-icon [icon]="['fas', 'columns']"></fa-icon>
<fa-icon [icon]="['fas', 'balance-scale']"></fa-icon>
<span class="share-label">{{ 'product.compare.link' | translate }}</span>
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ describe('Product Detail Actions Component', () => {
it(`should show "compare" link when product information is available`, () => {
translate.set('product.compare.link', 'Compare');
fixture.detectChanges();
expect(element.querySelector('fa-icon[ng-reflect-icon="fas,columns"]').nextElementSibling.textContent).toContain(
'Compare'
);
expect(
element.querySelector('fa-icon[ng-reflect-icon="fas,balance-scale"]').nextElementSibling.textContent
).toContain('Compare');
});

it('should not show "compare" link when product information is available and productMaster = true', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(click)="toggleCompare()"
>
<ng-container *ngIf="displayType === 'icon'; else defaultButton">
<fa-icon [icon]="['fas', 'columns']"></fa-icon>
<fa-icon [icon]="['fas', 'balance-scale']"></fa-icon>
</ng-container>

<ng-template #defaultButton> {{ 'product.compare.link' | translate }} </ng-template>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a class="compare-status item-count-container" routerLink="/compare" rel="nofollow">
<fa-icon class="header-icon" [icon]="['fas', 'columns']"></fa-icon>
<fa-icon class="header-icon" [icon]="['fas', 'balance-scale']"></fa-icon>
<span class="badge badge-pill" data-testing-id="product-compare-count">{{ productCompareCount$ | async }}</span>
<span [ngClass]="{ 'd-none': view === 'auto' || view === 'small', 'd-md-inline': view === 'auto' }">{{
'product.compare.link' | translate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Product Compare Status Component', () => {
class="compare-status item-count-container"
ng-reflect-router-link="/compare"
href="/compare"
><fa-icon class="header-icon" ng-reflect-icon="fas,columns"></fa-icon
><fa-icon class="header-icon" ng-reflect-icon="fas,balance-scale"></fa-icon
><span data-testing-id="product-compare-count" class="badge badge-pill">123456789</span
><span class="d-none d-md-inline">product.compare.link</span></a
>
Expand Down
15 changes: 12 additions & 3 deletions src/styles/pages/category/product-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,20 @@
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: flex-end;
width: 100%;
background-color: $white;

.btn,
a {
padding: 3px 6px;
font-size: $font-size-lg;

@media (hover: none) {
padding-bottom: 0;
margin-bottom: 0;
}
}

.add-to-cart,
Expand Down Expand Up @@ -318,17 +327,17 @@
transition: opacity 0.5s ease-in-out;

@media (hover: none) {
opacity: 1;
opacity: 0.85;
}

@media (-moz-touch-enabled) {
opacity: 1;
opacity: 0.85;
}
}

&:hover {
.product-tile-actions {
opacity: 1;
opacity: 0.85;
}

.product-image {
Expand Down

0 comments on commit dc36f5c

Please sign in to comment.