Merge with Origin

This commit is contained in:
Rene V. Vergara A. 2022-07-20 11:03:18 -05:00
commit eea842d4e4
4 changed files with 47 additions and 51 deletions

View file

@ -51,27 +51,29 @@ img.icon{
} }
.buttons-class { .buttons-class {
background-color: #ff4722; font-family: 'Spartan', sans-serif;
color: white; background-color: #ff4722;
font-weight: 700; color: white;
height: 25px !important; font-weight: 500;
width: 80px !important; height: 25px !important;
display: flex; width: 80px !important;
align-items: center; display: flex;
justify-content: center; align-items: center;
cursor: pointer; justify-content: center;
margin: auto; cursor: pointer;
margin: auto;
} }
.button-cancel-class { .button-cancel-class {
font-weight: 700; font-family: 'Spartan', sans-serif;
height: 25px !important; font-weight: 500;
width: 80px !important; height: 25px !important;
display: flex; width: 80px !important;
align-items: center; display: flex;
justify-content: center; align-items: center;
cursor: pointer; justify-content: center;
margin: auto; cursor: pointer;
margin: auto;
} }
.availableItems{ .availableItems{

View file

@ -1,9 +1,9 @@
* { * {
font-family: Spartan; font-family: 'Spartan', sans-serif;
} }
.settings-title { .settings-title {
font-family: Spartan; font-family: 'Spartan', sans-serif;
background: #ff4722; background: #ff4722;
color: white; color: white;
font-size: 30px; font-size: 30px;
@ -13,6 +13,9 @@
.settings_field { .settings_field {
width: 100%; width: 100%;
font-family: Spartan; font-family: 'Spartan', sans-serif;
} }
.mat-slide-toggle-content {
font-family: 'Spartan', sans-serif;
}

View file

@ -23,21 +23,16 @@
(change)="onChange($event)"> (change)="onChange($event)">
Use zatoshis? Use zatoshis?
</mat-slide-toggle> </mat-slide-toggle>
<mat-slide-toggle formControlName="useVKey"
<pre></pre> (change)="onChangeVKeyOn($event)">
<mat-slide-toggle formControlName="VkeyOn" Activate payment confirmation?
(change)="onChangeVKeyOn($event)"> </mat-slide-toggle>
Activate payment confirmation? <pre></pre>
</mat-slide-toggle> <mat-form-field [style.width.%]="100">
<pre></pre> <mat-label>Viewing key</mat-label>
<mat-form-field [style.width.%]="100"> <input matInput placeholder="Your wallet viewing key"
<mat-label>Viewing key</mat-label> formControlName="vKey">
<input matInput placeholder="Your wallet viewing key" </mat-form-field>
formControlName="VKey"
[formControl]="viewkeyControl">
</mat-form-field>
</mat-dialog-content> </mat-dialog-content>
@ -55,4 +50,4 @@
Save Save
</button> </button>
</mat-dialog-actions> </mat-dialog-actions>
</div> </div>

View file

@ -36,8 +36,6 @@ export class SettingsComponent implements OnInit {
} }
]; ];
viewkeyControl = new FormControl({ value: null, disabled: false });
constructor( constructor(
private fb: UntypedFormBuilder, private fb: UntypedFormBuilder,
private dialogRef: MatDialogRef<SettingsComponent>, private dialogRef: MatDialogRef<SettingsComponent>,
@ -49,15 +47,12 @@ export class SettingsComponent implements OnInit {
name: [data.name, Validators.required], name: [data.name, Validators.required],
currency: [data.currency, Validators.required], currency: [data.currency, Validators.required],
useZats: [data.zats, Validators.required], useZats: [data.zats, Validators.required],
VkeyOn: [data.payconf, Validators.required], useVKey: [data.payconf, Validators.required],
VKey: [{value:data.viewkey, disabled: !this.useVKey }] vKey: [data.viewkey]
}); });
/* if (data.payconf) {
if ( data.payconf ) this.settingsForm.get('vKey')!.enable();
this.viewkeyControl.enable() }
else
this.viewkeyControl.disable();
*/
this.owner = data; this.owner = data;
@ -71,9 +66,11 @@ export class SettingsComponent implements OnInit {
} }
save() { save() {
console.log('Settings', this.settingsForm.value.vKey);
this.owner.name = this.settingsForm.value.name; this.owner.name = this.settingsForm.value.name;
this.owner.currency = this.settingsForm.value.currency; this.owner.currency = this.settingsForm.value.currency;
this.owner.zats = this.settingsForm.value.useZats; this.owner.zats = this.settingsForm.value.useZats;
this.owner.payconf = this.useVKey; this.owner.payconf = this.useVKey;
if ( this.useVKey ) { if ( this.useVKey ) {
this.owner.viewkey = this.settingsForm.value.VKey; this.owner.viewkey = this.settingsForm.value.VKey;
@ -81,6 +78,7 @@ export class SettingsComponent implements OnInit {
} }
else else
this.owner.viewkey = ''; this.owner.viewkey = '';
this.dialogRef.close(this.owner); this.dialogRef.close(this.owner);
} }
@ -95,11 +93,9 @@ export class SettingsComponent implements OnInit {
this.useVKey = ob.checked; this.useVKey = ob.checked;
if ( ob.checked ) if ( ob.checked )
this.viewkeyControl.enable() this.settingsForm.get('vKey')!.enable();
else else
{ this.settingsForm.get('vKey')!.disable();
this.viewkeyControl.disable();
}
} }
} }