Added unit to offer value

This commit is contained in:
Peter Zimon 2021-10-04 15:21:28 +02:00
parent 96ec92a47b
commit 5343b9f6b5
2 changed files with 45 additions and 14 deletions

View File

@ -92,6 +92,31 @@
font-size: 1.3rem;
}
.gh-offer-value {
position: relative;
}
.gh-offer-value .unit {
display: block;
position: absolute;
top: 7px;
left: 8px;
color: var(--midgrey);
}
.gh-offer-value .gh-input {
padding-left: 20px;
}
.gh-offer-value.percentage .unit {
left: unset;
right: 11px;
}
.gh-offer-value.gh-offer-value.percentage .gh-input {
padding-left: 12px;
padding-right: 28px;
}
.gh-offer-form textarea {
max-width: unset;

View File

@ -48,24 +48,30 @@
{{#if (eq this.selectedDiscountType "percentage")}}
<GhFormGroup @errors={{this.errors}} @property="amount">
<label for="amount" class="fw6">Percentage off</label>
<GhTextInput
@type="number"
@name="amount"
@placeholder=""
@id="amount"
@class="gh-input" />
<GhErrorMessage @errors={{this.errors}} @property="amount" />
<div class="gh-offer-value percentage">
<span class="unit">%</span>
<GhTextInput
@type="number"
@name="amount"
@placeholder=""
@id="amount"
@class="gh-input" />
<GhErrorMessage @errors={{this.errors}} @property="amount" />
</div>
</GhFormGroup>
{{else}}
<GhFormGroup @errors={{this.errors}} @property="amount">
<label for="amount" class="fw6">Amount off</label>
<GhTextInput
@name="amount"
@type="number"
@placeholder=""
@id="amount"
@class="gh-input" />
<GhErrorMessage @errors={{this.errors}} @property="amount" />
<div class="gh-offer-value fixed">
<span class="unit">$</span>
<GhTextInput
@name="amount"
@type="number"
@placeholder=""
@id="amount"
@class="gh-input" />
<GhErrorMessage @errors={{this.errors}} @property="amount" />
</div>
</GhFormGroup>
{{/if}}
<div class="gh-offer-type">