Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Refactor login and signup page
- Loading branch information
ChrisRollings
committed
Mar 4, 2019
1 parent
c541bc7
commit 092584b5197eb732a4549042747e8e50d600a4e8
Showing
12 changed files
with
250 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<div> | ||
<mat-card> | ||
<form class="form-container" [formGroup]="form" (submit)="onSubmit()"> | ||
<mat-form-field appearance="outline"> | ||
<input matInput type="email" formControlName="Email" placeholder="Email"> | ||
<mat-error *ngIf="Email.invalid">Please enter a valid email</mat-error> | ||
|
||
</mat-form-field> | ||
|
||
<mat-form-field appearance="outline"> | ||
<input matInput type="text" formControlName="FirstName" placeholder="First name"> | ||
<mat-error *ngIf="FirstName.invalid">Please enter your first name</mat-error> | ||
|
||
</mat-form-field> | ||
|
||
<mat-form-field appearance="outline"> | ||
<input matInput type="text" formControlName="LastName" placeholder="Last name"> | ||
<mat-error *ngIf="LastName.invalid">Please enter your last name</mat-error> | ||
|
||
</mat-form-field> | ||
|
||
<mat-form-field appearance="outline"> | ||
<input matInput type="text" formControlName="Crew" placeholder="Crew"> | ||
<mat-error *ngIf="Crew.invalid">Please enter your crew name</mat-error> | ||
</mat-form-field> | ||
|
||
<div> | ||
<button type="submit" [disabled]="form.invalid" mat-stroked-button> Submit</button> | ||
</div> | ||
<!-- | ||
<mat-form-field> | ||
<mat-select placeholder="Select"> | ||
<mat-option formControlName="" value="option">Option</mat-option> | ||
</mat-select> | ||
</mat-form-field> --> | ||
</form> | ||
</mat-card> | ||
</div> |
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,12 @@ | ||
.form-container { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.form-container > * { | ||
width: 100%; | ||
} | ||
|
||
mat-card{ | ||
margin:50px; | ||
} |
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,25 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AccountComponent } from './account.component'; | ||
|
||
describe('AccountComponent', () => { | ||
let component: AccountComponent; | ||
let fixture: ComponentFixture<AccountComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ AccountComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(AccountComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
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,38 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { FormGroup, FormControl, Validators } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'app-account', | ||
templateUrl: './account.component.html', | ||
styleUrls: ['./account.component.scss'] | ||
}) | ||
export class AccountComponent implements OnInit { | ||
|
||
constructor() { } | ||
form: FormGroup; | ||
|
||
ngOnInit() { | ||
this.form = new FormGroup({ | ||
Email: new FormControl(null, { | ||
validators: [Validators.required, Validators.email] | ||
}), | ||
FirstName: new FormControl(null, { validators: [Validators.required] }), | ||
LastName: new FormControl(null, { validators: [Validators.required] }), | ||
Crew: new FormControl(null, { validators: [Validators.required] }), | ||
}); | ||
} | ||
|
||
get Email(){ | ||
return this.form.get("Email") | ||
} | ||
get FirstName(){ | ||
return this.form.get("FirstName") | ||
} | ||
get LastName(){ | ||
return this.form.get("LastName") | ||
} | ||
|
||
get Crew(){ | ||
return this.form.get("Crew") | ||
} | ||
} |
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,12 @@ | ||
export class Event { | ||
_id: string; | ||
StartDate: Date; | ||
Duration: number; | ||
Type: BoatType; | ||
} | ||
|
||
enum BoatType { | ||
Motor, | ||
Wind, | ||
Rowing | ||
} |
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,6 @@ | ||
export class Registration { | ||
_id: string; | ||
AccountId: string; | ||
EventId: string; | ||
BoatDesc: string; | ||
} |
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.