Skip to content

Commit edea4de

Browse files
Implement and style Register page
1 parent 00707dc commit edea4de

File tree

7 files changed

+60
-7
lines changed

7 files changed

+60
-7
lines changed

app/app.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { CostModule } from "./tabs/cost/cost.module";
88
import { TabsComponent } from "./tabs/tabs.component";
99
import { CostsComponent } from "./tabs/cost/costs.component";
1010
import { LoginComponent} from "./login/login.component";
11+
import { RegisterComponent} from "./register/register.component";
1112

1213
@NgModule({
1314
bootstrap: [
@@ -22,7 +23,8 @@ import { LoginComponent} from "./login/login.component";
2223
AppComponent,
2324
TabsComponent,
2425
CostsComponent,
25-
LoginComponent
26+
LoginComponent,
27+
RegisterComponent
2628
],
2729
providers: [
2830
],

app/app.routing.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import { CostsComponent } from "./tabs/cost/costs.component";
77
import { CostDetailComponent } from "./tabs/cost/detail/cost-detail.component";
88
import { CostEditComponent } from "./tabs/cost/edit/cost-edit.component";
99
import { LoginComponent } from "./login/login.component";
10+
import { RegisterComponent } from "./register/register.component";
1011

1112
const routes: Routes = [
1213
{ path: "", component: LoginComponent },
1314
{ path: 'tabs', component: TabsComponent },
15+
{ path: 'register', component: RegisterComponent },
1416
//{ path: "costs", component: CostsComponent },
1517
{ path: "cost/:id", component: CostDetailComponent },
1618
{ path: "cost-edit/:id", component: CostEditComponent }

app/login/login.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<Label text="Password" class="label font-weight-bold m-b-5"></Label>
1212
<TextField secure="true"></TextField>
1313
</StackLayout>
14-
<Button class="btn-login" text="Login" (tap)="login()"></Button>
14+
<Button text="Login" class="btn-login" (tap)="login()"></Button>
1515
<Label [nsRouterLink]="['/register']" text="Not a member? Register here." class="text-center footnote"></Label>
1616
</StackLayout>

app/login/login.component.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ export class LoginComponent implements OnInit {
1919
}
2020
}
2121

22-
public ngOnInit() {
23-
//if(ApplicationSettings.getBoolean("authenticated", false)) {
24-
// this.router.navigate(["/secure"], { clearHistory: true });
25-
//}
26-
}
22+
public ngOnInit() {}
2723

2824
public login() {
2925
this.router.navigate(["/tabs"], { clearHistory: true });
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.register-view
2+
{
3+
padding-left: 50;
4+
padding-right: 50;
5+
}
6+
7+
.btn-register
8+
{
9+
background-color: #7ada2f;
10+
color: aliceblue;
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<ActionBar title="Register" class="action-bar">
2+
</ActionBar>
3+
4+
<StackLayout verticalAlignment="center" class="register-view" >
5+
<Label text="Name" class="label font-weight-bold m-b-5"></Label>
6+
<TextField></TextField>
7+
<Label text="Surname" class="label font-weight-bold m-b-5"></Label>
8+
<TextField></TextField>
9+
<Label text="Login" class="label font-weight-bold m-b-5"></Label>
10+
<TextField></TextField>
11+
<Label text="Email" class="label font-weight-bold m-b-5"></Label>
12+
<TextField></TextField>
13+
<Label text="Password" class="label font-weight-bold m-b-5"></Label>
14+
<TextField secure="true"></TextField>
15+
<Button [nsRouterLink]="['']" text="Register" class="btn-register"></Button>
16+
</StackLayout>

app/register/register.component.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Component, OnInit } from "@angular/core";
2+
import { RouterExtensions } from "nativescript-angular/router";
3+
import * as ApplicationSettings from "application-settings";
4+
5+
@Component({
6+
moduleId: module.id,
7+
selector: "ns-register",
8+
templateUrl: "register.component.html",
9+
styleUrls: ["register.component.css"]
10+
})
11+
export class RegisterComponent implements OnInit {
12+
13+
public input: any;
14+
15+
public constructor(private router: RouterExtensions) {
16+
this.input = {
17+
"name": "",
18+
"surname": "",
19+
"login": "",
20+
"email": "",
21+
"password": "",
22+
}
23+
}
24+
25+
public ngOnInit() {}
26+
}

0 commit comments

Comments
 (0)