-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor order-items components
- Loading branch information
Showing
3 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
packages/modules/ui/src/lib/components/molecules/order-items/order-item.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<div class="row"> | ||
<div class="flex-10"> | ||
<h4>{{ item.product?.product?.name }}</h4> | ||
</div> | ||
|
||
<div #target> | ||
<button | ||
vcl-button | ||
square | ||
class="emphasized-transparent" | ||
title="Options" | ||
(click)="popover.open()" | ||
> | ||
<vcl-icon | ||
class="scale155p" | ||
icon="mdi mdi-dots-vertical" | ||
/> | ||
</button> | ||
</div> | ||
</div> | ||
|
||
<div class="my-1 secondary-text-color">[Qty: {{ item.quantity }}]</div> | ||
|
||
<div> | ||
{{ item.productId }} | ||
</div> | ||
<div>'No variant': {{ item.variantId }}</div> | ||
|
||
<img | ||
[alt]="item.product?.product?.physical?.variants?.[0]?.name" | ||
[src]="item.product?.product?.physical?.variants?.[0]?.images?.[0]?.url" | ||
sizes="(max-width: 123px) 123px, 123px" | ||
width="123" | ||
loading="lazy" | ||
ngOptimizedImage | ||
priority="auto" | ||
/> | ||
<p class="mt-2"> | ||
<strong>Price:</strong> {{ item.unitPrice?.currency || 'EUR' }} | ||
{{ item.unitPrice?.regularPrice }} | ||
</p> | ||
|
||
<ng-template | ||
vclPopover | ||
#popover="vclPopover" | ||
[closeOnOffClick]="true" | ||
[target]="target" | ||
[positions]="[ | ||
{ | ||
originX: 'end', | ||
originY: 'bottom', | ||
overlayX: 'end', | ||
overlayY: 'top' | ||
} | ||
]" | ||
> | ||
<div> | ||
<vcl-button-group class="vertical"> | ||
<button | ||
vcl-button | ||
class="transparent" | ||
> | ||
<!-- (click)="editVariant.emit(variant); popover.close()" --> | ||
Edit | ||
</button> | ||
<button | ||
class="transparent" | ||
vcl-button | ||
[value]="2" | ||
> | ||
Delete | ||
</button> | ||
</vcl-button-group> | ||
</div> | ||
</ng-template> |
21 changes: 21 additions & 0 deletions
21
packages/modules/ui/src/lib/components/molecules/order-items/order-item.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
EventEmitter, | ||
Input, | ||
Output, | ||
} from '@angular/core'; | ||
|
||
import { IoRestorecommerceOrderItem } from '@console-core/graphql'; | ||
|
||
@Component({ | ||
selector: 'rc-order-item', | ||
templateUrl: './order-item.component.html', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class RcOrderItemComponent { | ||
@Input({ required: true }) | ||
item!: IoRestorecommerceOrderItem; | ||
|
||
@Output() openEditItemModal = new EventEmitter<void>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters