-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Allow add new RPC * Allow add new RPC * Set reasonable default * Lint prettier * Lint prettier * Lint prettier * Update changelog * Update changelog
- Loading branch information
Showing
16 changed files
with
264 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.add-rpc-overlay { | ||
width: 380px; | ||
} | ||
|
||
.add-rpc-example { | ||
font-family: monospace; | ||
background: #e6e6e6; | ||
padding: 0 4px; | ||
border-radius: 4px; | ||
margin-top: 8px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { Component, EventEmitter, Output } from '@angular/core'; | ||
import { FormControl } from '@angular/forms'; | ||
import { ADD_RPC_NODE_BY_URL } from '@app/services/wallet-events.service'; | ||
|
||
@Component({ | ||
selector: 'app-add-rpc-overlay', | ||
styleUrls: ['add-rpc.component.scss'], | ||
template: ` | ||
<div class="add-rpc-overlay overlay-action-container"> | ||
<div class="overlay-header">Add new Banano RPC Node</div> | ||
<div class="overlay-body"> | ||
<div class="mat-body-1" style="margin-bottom: 16px"> | ||
If the default Banano nodes are unavailable, you can add a custom RPC node to handle all send, | ||
receive, change transactions. | ||
</div> | ||
<div class="mat-body-1"> | ||
<div>Use the input field below to enter the URL of your new Banano node e.g:</div> | ||
<div class="add-rpc-example mat-body-1">https://booster.dev-ptera.com/banano-rpc</div> | ||
</div> | ||
<form style="margin: 32px 0 16px 0"> | ||
<mat-form-field style="width: 100%" appearance="fill"> | ||
<mat-label>RPC Node URL</mat-label> | ||
<textarea | ||
type="text" | ||
matInput | ||
(keyup.enter)="addRpcNode()" | ||
[formControl]="urlFormControl" | ||
data-cy="add-new-rpc-input" | ||
></textarea> | ||
</mat-form-field> | ||
</form> | ||
</div> | ||
<div class="overlay-footer"> | ||
<button mat-stroked-button mat-dialog-close color="primary" (click)="close.emit()">Close</button> | ||
<button | ||
data-cy="add-rpc-overlay-button" | ||
mat-flat-button | ||
color="primary" | ||
[disabled]="isDisabled()" | ||
(click)="addRpcNode()" | ||
> | ||
Add | ||
</button> | ||
</div> | ||
</div> | ||
`, | ||
}) | ||
export class AddRpcOverlayComponent { | ||
urlFormControl = new FormControl(''); | ||
|
||
@Output() close: EventEmitter<void> = new EventEmitter<void>(); | ||
|
||
isDisabled(): boolean { | ||
return !this.urlFormControl.value; | ||
} | ||
|
||
addRpcNode(): void { | ||
if (this.isDisabled()) { | ||
return; | ||
} | ||
|
||
// TODO: Add checks to see if the node is accessible and online before adding it to the list. | ||
ADD_RPC_NODE_BY_URL.next(this.urlFormControl.value); | ||
this.close.emit(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/app/overlays/bottom-sheet/add-rpc/add-rpc-bottom-sheet.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Component } from '@angular/core'; | ||
import { MatBottomSheetRef } from '@angular/material/bottom-sheet'; | ||
|
||
@Component({ | ||
selector: 'app-add-rpc-bottom-sheet', | ||
template: ` <app-add-rpc-overlay (close)="closeDialog()"></app-add-rpc-overlay> `, | ||
}) | ||
export class AddRpcBottomSheetComponent { | ||
constructor(private readonly _sheet: MatBottomSheetRef<AddRpcBottomSheetComponent>) {} | ||
|
||
closeDialog(): void { | ||
this._sheet.dismiss(); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/app/overlays/dialogs/add-rpc/add-rpc-dialog.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Component } from '@angular/core'; | ||
import { MatDialogRef } from '@angular/material/dialog'; | ||
|
||
@Component({ | ||
selector: 'app-add-rpc-dialog', | ||
template: ` <app-add-rpc-overlay (close)="closeDialog()"></app-add-rpc-overlay> `, | ||
}) | ||
export class AddRpcDialogComponent { | ||
constructor(private readonly _dialogRef: MatDialogRef<AddRpcDialogComponent>) {} | ||
|
||
closeDialog(): void { | ||
this._dialogRef.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.