From 6a8deff706d322ca5b85cb134e96c72b04f583ae Mon Sep 17 00:00:00 2001 From: softsimon Date: Mon, 26 Oct 2020 23:23:08 +0700 Subject: [PATCH] Adding form validators for donation form. --- frontend/src/app/components/about/about.component.html | 8 +++++--- frontend/src/app/components/about/about.component.scss | 6 ++++++ frontend/src/app/components/about/about.component.ts | 4 ++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/src/app/components/about/about.component.html b/frontend/src/app/components/about/about.component.html index 18312d207..e2cbd6faf 100644 --- a/frontend/src/app/components/about/about.component.html +++ b/frontend/src/app/components/about/about.component.html @@ -73,14 +73,16 @@ -
+
@
-
- +
Amount required
+
Minimum amount is 0.001 BTC
+
+
diff --git a/frontend/src/app/components/about/about.component.scss b/frontend/src/app/components/about/about.component.scss index d2ffacb40..b0b5716e4 100644 --- a/frontend/src/app/components/about/about.component.scss +++ b/frontend/src/app/components/about/about.component.scss @@ -27,3 +27,9 @@ .info-group { max-width: 400px; } + + +.required { + color: #FF0000; + font-weight: bold; +} \ No newline at end of file diff --git a/frontend/src/app/components/about/about.component.ts b/frontend/src/app/components/about/about.component.ts index 6884d6a26..94ec35446 100644 --- a/frontend/src/app/components/about/about.component.ts +++ b/frontend/src/app/components/about/about.component.ts @@ -3,7 +3,7 @@ import { WebsocketService } from '../../services/websocket.service'; import { SeoService } from 'src/app/services/seo.service'; import { StateService } from 'src/app/services/state.service'; import { Observable } from 'rxjs'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { ApiService } from 'src/app/services/api.service'; import { env } from '../../app.constants'; import { DomSanitizer, SafeUrl } from '@angular/platform-browser'; @@ -39,7 +39,7 @@ export class AboutComponent implements OnInit { this.websocketService.want(['blocks']); this.donationForm = this.formBuilder.group({ - amount: [0.01], + amount: [0.01, [Validators.min(0.001), Validators.required]], handle: [''], });