diff --git a/src/app/backend.service.ts b/src/app/backend.service.ts index 44eb161..da6d496 100644 --- a/src/app/backend.service.ts +++ b/src/app/backend.service.ts @@ -269,9 +269,13 @@ export class BackendService { * @returns The price to pay by cryptocurrency; */ getAmount(): string | undefined { - return this.invoice?.paymentMethods.find(item => { + const amount = this.invoice?.paymentMethods.find(item => { return item.method === this.invoice.paymentMethod; - })?.amount.toFixed(8); + })?.amount.toString(); + + if (amount === undefined) { return '0.00'; } + + return amount; } /** @@ -279,12 +283,12 @@ export class BackendService { * @param prodcut Index of product in cart */ calculateCryptoPrice(productNr: number): number { - if (this.invoice.cart === undefined) return 0; - if (this.invoice.paymentMethod === undefined) return 0; + if (this.invoice.cart === undefined) { return 0; } + if (this.invoice.paymentMethod === undefined) { return 0; } const product = this.invoice.cart[productNr]; - const exRate = this.invoice.paymentMethods.find(method => { return method.method === this.invoice.paymentMethod })?.exRate; - if (exRate === undefined) return 0; + const exRate = this.invoice.paymentMethods.find(method => method.method === this.invoice.paymentMethod)?.exRate; + if (exRate === undefined) { return 0; } return product.quantity * product.price / exRate; } diff --git a/src/app/cart/cart.component.css b/src/app/cart/cart.component.css index d0d0a5b..39e4b99 100644 --- a/src/app/cart/cart.component.css +++ b/src/app/cart/cart.component.css @@ -17,24 +17,39 @@ height: 359px; } -.cart ul li { +.item { display: grid; padding: 1rem; grid-template-columns: 64px 1fr auto; grid-column-gap: 1rem; border-radius: 12px; + transition: .2s !important; } -.cart ul li:nth-child(even) { +.item:hover { + padding-top: 1.5rem; + padding-bottom: 1.5rem; +} + +.item:hover img { + transform: rotate(5deg); +} + +.item:nth-child(even) { background-color: #292929; } +.item:nth-child(even):hover img { + transform: rotate(-5deg); +} + .image { height: 64px; width: 64px; padding: 0; margin: 0; border-radius: 8px; + transition: .25s ease-out; } .name { diff --git a/src/app/cart/cart.component.html b/src/app/cart/cart.component.html index 6d8f3cb..551ec38 100644 --- a/src/app/cart/cart.component.html +++ b/src/app/cart/cart.component.html @@ -1,6 +1,6 @@ -
+