Commit 5e0431fa authored by dev0tion's avatar dev0tion

Fix fee radio buttons

parent 3780b9f7
export class TransactionBuilding {
constructor(walletName: string, coinType: number, accountName: string, password: string, destinationAddress: string, amount: string, feeType: string, allowUnconfirmed: boolean) {
constructor(walletName: string, accountName: string, password: string, destinationAddress: string, amount: string, feeType: string, allowUnconfirmed: boolean) {
this.walletName = walletName;
this.coinType = coinType;
this.accountName = accountName;
this.password = password;
this.destinationAddress = destinationAddress;
......@@ -12,7 +11,6 @@ export class TransactionBuilding {
}
walletName: string;
coinType: number;
accountName: string;
password: string;
destinationAddress: string;
......
......@@ -20,39 +20,20 @@
<input type="text" class="form-control form-control-success" formControlName="address" id="destinationAddress" placeholder="Please enter the destination address here.">
<div *ngIf="formErrors.address" class="form-control-feedback">{{ formErrors.address }}</div>
</div>
<!-- <div class="form-group">
<label for="Fees">Fees</label>
<div class="col feeSlider text-center">
<input class="form-control" id="dataSlider" type="text"
data-provide="slider"
data-slider-ticks="[1, 2, 3]"
data-slider-ticks-labels='["Low", "Medium", "High"]'
data-slider-min="1"
data-slider-max="3"
data-slider-step="1"
data-slider-value="2"
data-slider-tooltip="hide">
</div>
<p class="text-muted text-center">
<em>A higher fee helps expedite your transaction.
<br>You are sending <strong>1 BTC</strong> with an included <strong>Medium</strong> fee of <strong>0.0001</strong>.</em>
</p>
</div> -->
<div class="form-group clearfix">
<label for="feeSlider">Fee</label>
<label>Transaction Fee</label>
<!-- fee buttons -->
<div class="radioButtons" data-toggle="buttons">
<label class="btn btn-outline-danger">
<input type="radio" name="options" id="option1" autocomplete="off"> Slow
<div class="radioButtons" ngbRadioGroup name="feeButtons" formControlName="fee">
<label ngbButtonLabel class="btn btn-outline-danger">
<input ngbButton type="radio" value="low">Low/Slow
</label>
<label class="btn btn-outline-warning">
<input type="radio" name="options" id="option2" autocomplete="off" checked> Medium
<label ngbButtonLabel class="btn btn-outline-warning">
<input ngbButton type="radio" value="medium">Medium
</label>
<label class="btn btn-outline-success">
<input type="radio" name="options" id="option3" autocomplete="off"> Fast
<label ngbButtonLabel class="btn btn-outline-success">
<input ngbButton type="radio" value="high">High/Fast
</label>
</div>
<p>Here is the line to put the fee estimation.</p>
<!-- /fee buttons -->
</div>
<div class="form-group clearfix">
......@@ -60,11 +41,13 @@
<input type="password" class="form-control form-control-success" formControlName="password" id="walletPassword" placeholder="Please enter your wallet password.">
<div *ngIf="formErrors.password" class="form-control-feedback">{{formErrors.password}}</div>
</div>
<!--
<div class="form-group clearfix">
<button type="button" class="btn btn-link" (click)="buildTransaction()" [disabled]="!sendForm.valid">Estimate Fee</button>
<label *ngIf="estimatedFee">Estimated Fee: </label>
<label *ngIf="estimatedFee">{{ estimatedFee | coinNotation }} {{ coinUnit }}</label>
-->
<div *ngIf="estimatedFee">
<label>Estimated Fee: </label>
<label>{{ estimatedFee | coinNotation }} {{ coinUnit }}</label>
</div>
</div>
</form>
<!-- /form-->
</div>
......
......@@ -38,7 +38,7 @@ export class SendComponent implements OnInit {
this.sendForm = this.fb.group({
"address": ["", Validators.required],
"amount": ["", Validators.compose([Validators.required, Validators.pattern(/^[0-9]+(\.[0-9]{0,8})?$/)])],
"fee": [2, Validators.required],
"fee": ["medium", Validators.required],
"password": ["", Validators.required]
});
......@@ -89,12 +89,11 @@ export class SendComponent implements OnInit {
public buildTransaction() {
this.transaction = new TransactionBuilding(
this.globalService.getWalletName(),
this.globalService.getCoinType(),
"account 0",
this.sendForm.get("password").value,
this.sendForm.get("address").value,
this.sendForm.get("amount").value,
this.getFeeType(),
this.sendForm.get("fee").value,
true
);
......@@ -164,19 +163,6 @@ export class SendComponent implements OnInit {
;
}
private getFeeType(){
let feeValue = this.sendForm.get("fee").value;
switch(feeValue){
case 1:
return "low";
case 2:
return "medium";
case 3:
return "high";
}
}
private openConfirmationModal() {
const modalRef = this.modalService.open(SendConfirmationComponent);
modalRef.componentInstance.transaction = this.transaction;
......
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { ClipboardModule } from 'ngx-clipboard';
import { WalletComponent } from './wallet.component';
......@@ -21,7 +21,7 @@ import { TransactionDetailsComponent } from './transaction-details/transaction-d
ClipboardModule,
FormsModule,
SharedModule.forRoot(),
NgbDropdownModule,
NgbModule,
ReactiveFormsModule,
WalletRoutingModule
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment