diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.scss b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.scss index 9bbc76bb9..aa5a38718 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.scss +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.scss @@ -149,6 +149,10 @@ flex-direction: row; align-items: stretch; margin-top: 1em; + + @media (min-width: 768px) { + min-height: 350px; + } } .payment-area { diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.scss b/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.scss index 4322fd75c..783e7e5b2 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.scss +++ b/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.scss @@ -1,5 +1,6 @@ .fee-graph { height: 100%; + min-height: 300px; min-width: 120px; width: 120px; margin-left: 4em; @@ -16,7 +17,7 @@ bottom: 0; left: 0; right: 0; - min-height: 30px; + min-height: 0; display: flex; flex-direction: column; justify-content: center; @@ -33,9 +34,11 @@ } .fee { - font-size: 0.9em; + font-size: 0.75em; opacity: 0; pointer-events: none; + position: absolute; + top: 20px; } .spacer { @@ -45,6 +48,7 @@ pointer-events: none; } + .line { position: absolute; right: 0; @@ -77,13 +81,10 @@ .fill { background: var(--green); } - .line { - .fee-rate { - top: 0; - } + .line .fee-rate { + top: 0; } .fee { - position: absolute; opacity: 1; z-index: 11; } @@ -94,7 +95,6 @@ background: var(--tertiary); } .fee { - position: absolute; opacity: 1; z-index: 11; } diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.ts index e0d0d1a2b..86b075f1b 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-fee-graph.component.ts @@ -70,11 +70,11 @@ export class AccelerateFeeGraphComponent implements OnInit, AfterViewInit, OnCha const numBars = hasNextBlockRate ? 4 : 3; const maxRate = Math.max(...this.maxRateOptions.map(option => option.rate)); const baseRate = this.estimate.txSummary.effectiveFee / this.estimate.txSummary.effectiveVsize; - let baseHeight = Math.max(this.height - (numBars * 30), this.height * (baseRate / maxRate)); + let baseHeight = Math.max(this.height - (numBars * 50), this.height * (baseRate / maxRate)); const bars: GraphBar[] = []; let lastHeight = 0; if (hasNextBlockRate) { - lastHeight = Math.max(lastHeight + 30, (this.height * ((this.estimate.targetFeeRate - baseRate) / maxRate))); + lastHeight = Math.max(lastHeight + 50, (this.height * ((this.estimate.targetFeeRate - baseRate) / maxRate))); bars.push({ rate: this.estimate.targetFeeRate, height: lastHeight, @@ -84,7 +84,7 @@ export class AccelerateFeeGraphComponent implements OnInit, AfterViewInit, OnCha }); } this.maxRateOptions.forEach((option, index) => { - lastHeight = Math.max(lastHeight + 30, (this.height * ((option.rate - baseRate) / maxRate))); + lastHeight = Math.max(lastHeight + 50, (this.height * ((option.rate - baseRate) / maxRate))); bars.push({ rate: option.rate, height: lastHeight, @@ -98,6 +98,14 @@ export class AccelerateFeeGraphComponent implements OnInit, AfterViewInit, OnCha bars.reverse(); + const minBaseHeight = 50; + if (this.height - lastHeight < minBaseHeight) { + const scale = (this.height - minBaseHeight) / lastHeight; + lastHeight = this.height - minBaseHeight; + for (const bar of bars) { + bar.height = Math.round(bar.height * scale); + } + } baseHeight = this.height - lastHeight; for (const bar of bars) {