Skip to content

Commit f117ca7

Browse files
committed
fix(package): added i18n support for the name input + tos as feature
1 parent 220d855 commit f117ca7

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

src/module/components/ngx-auth-firebaseui-register/ngx-auth-firebaseui-register.component.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
<div fxLayout="column" id="register">
2-
<div fxLayout="column" fxLayoutAlign="center center" id="register-form-wrapper">
1+
<div id="register" fxLayout="column">
2+
3+
<div id="register-form-wrapper" fxLayout="column" fxLayoutAlign="center center">
4+
35
<div id="register-form" [@animateStagger]="{ value: '50' }">
46

57
<div *ngIf="logoUrl" class="logo">
@@ -8,12 +10,14 @@
810

911
<div class="title" [@animate]="{ value: '*', params: { x: '-50px' } }">{{titleText}}</div>
1012

11-
<form [formGroup]="registerForm" name="registerForm" novalidate>
13+
<form [formGroup]="registerForm" name="registerForm" novalidate
14+
[@animate]="{value:'*',params:{duration:'300ms',y:'100px'}}">
15+
1216
<mat-form-field [appearance]="appearance" [@animate]="{ value: '*', params: { x: '50px' } }">
13-
<input formControlName="name" matInput placeholder="Name"/>
17+
<input formControlName="name" matInput [placeholder]="nameText"/>
1418
<mat-icon matSuffix [color]="color">person</mat-icon>
1519
<mat-error>
16-
Name is required
20+
{{nameErrorRequiredText}}
1721
</mat-error>
1822
</mat-form-field>
1923

@@ -51,7 +55,9 @@
5155
</mat-error>
5256
</mat-form-field>
5357

54-
<div class="terms" fxLayout="row" fxLayoutAlign="center center">
58+
<div *ngIf="this.tosUrl || this.privacyPolicyUrl"
59+
class="terms"
60+
fxLayout="row" fxLayoutAlign="center center">
5561
<mat-checkbox aria-label="I read and accept" name="terms" required>
5662
<span>{{readAncAcceptText}}</span>
5763
</mat-checkbox>
@@ -72,6 +78,7 @@
7278
<span class="text">{{alreadyHaveAccountText}}</span>
7379
<button mat-button [color]="colorAccent">{{loginButtonText}}</button>
7480
</div>
81+
7582
</div>
7683
</div>
7784
</div>

src/module/components/ngx-auth-firebaseui-register/ngx-auth-firebaseui-register.component.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export class NgxAuthFirebaseuiRegisterComponent implements OnInit, OnDestroy {
4141

4242
@Input() logoUrl: string;
4343
@Input() appearance: MatFormFieldAppearance;
44+
@Input() tosUrl: string;
45+
@Input() privacyPolicyUrl: string;
4446

4547
// i18n common
4648
@Input() titleText = 'CREATE AN ACCOUNT';
@@ -50,6 +52,10 @@ export class NgxAuthFirebaseuiRegisterComponent implements OnInit, OnDestroy {
5052
@Input() alreadyHaveAccountText = 'Already have an account?';
5153
@Input() loginButtonText = 'LOGIN';
5254

55+
// i18n emnameail
56+
@Input() nameText = 'Name';
57+
@Input() nameErrorRequiredText = 'Name is required';
58+
5359
// i18n email
5460
@Input() emailText = 'Email';
5561
@Input() emailErrorRequiredText = 'Email is required';

0 commit comments

Comments
 (0)