Skip to content

Commit

Permalink
Update sign in/register form
Browse files Browse the repository at this point in the history
  • Loading branch information
webprofusion-chrisc committed Nov 29, 2023
1 parent 83a0f5b commit fa48b3d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/app/pages/signin/signin.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
<ion-label position="floating">Email</ion-label>
<ion-input type="text" [(ngModel)]="email"></ion-input>
</ion-item>
<ion-item>
<ion-label position="floating">Name or Nickname</ion-label>
<ion-input type="text" [(ngModel)]="username"></ion-input>
</ion-item>

<ion-item>
<ion-label position="floating">Password</ion-label>
<ion-input type="password" [(ngModel)]="password"></ion-input>
Expand All @@ -55,14 +52,17 @@
<ion-label position="floating">Email</ion-label>
<ion-input type="text" [(ngModel)]="email"></ion-input>
</ion-item>

<ion-item>
<ion-label position="floating">Display Name or Nickname</ion-label>
<ion-input type="text" [(ngModel)]="username"></ion-input>
</ion-item>
<ion-item>
<ion-label position="floating">Password</ion-label>
<ion-input type="password" [(ngModel)]="password"></ion-input>
</ion-item>
<ion-item>
<ion-label position="floating">Confirm Password</ion-label>
<ion-input type="password" [(ngModel)]="password"></ion-input>
<ion-input type="password" [(ngModel)]="confirmpassword"></ion-input>
</ion-item>

</ion-list>
Expand Down
16 changes: 14 additions & 2 deletions src/app/pages/signin/signin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ import { AlertController, LoadingController, ModalController } from '@ionic/angu
export class SignInPage {
email: string;
password: string;

username: string;
confirmpassword: string;

mode: string = 'register';
mode: string = 'signin';

constructor(
public appManager: AppManager,
Expand All @@ -40,8 +42,18 @@ export class SignInPage {
}

async performRegister() {

if (this.password != this.confirmpassword) {
alert("Your password and the confirmed password do not match, please try again.");
return;
}
if (this.password.length < 6) {
alert("Your password should be at least 6 characters.");
return;
}

const loading = await this.loadingController.create({
message: 'Signing In..'
message: 'Registering ..'
});
await loading.present();

Expand Down

0 comments on commit fa48b3d

Please sign in to comment.