From b062cc24f7e5e8b033e0185a9674e455f69d38f1 Mon Sep 17 00:00:00 2001 From: sriram-at-840620226347 Date: Wed, 4 Sep 2019 13:45:57 +0530 Subject: [PATCH] UI New Design --- ng8-seed/src/app/app.module.ts | 6 +- ng8-seed/src/app/app.routing.ts | 6 +- .../my-account/my-account.component.html | 70 +++++++++++++++++++ .../my-account/my-account.component.scss | 0 .../my-account/my-account.component.spec.ts | 25 +++++++ .../my-account/my-account.component.ts | 51 ++++++++++++++ .../menu-items/horizontal-menu-items.ts | 12 ++-- 7 files changed, 162 insertions(+), 8 deletions(-) create mode 100644 ng8-seed/src/app/components/my-account/my-account.component.html create mode 100644 ng8-seed/src/app/components/my-account/my-account.component.scss create mode 100644 ng8-seed/src/app/components/my-account/my-account.component.spec.ts create mode 100644 ng8-seed/src/app/components/my-account/my-account.component.ts diff --git a/ng8-seed/src/app/app.module.ts b/ng8-seed/src/app/app.module.ts index 6162b6c..8cadf7d 100644 --- a/ng8-seed/src/app/app.module.ts +++ b/ng8-seed/src/app/app.module.ts @@ -28,6 +28,7 @@ import {MatCheckboxModule} from '@angular/material/checkbox'; import {MatProgressBarModule} from '@angular/material/progress-bar'; import {MatSelectModule} from '@angular/material/select'; import {MatCardModule} from '@angular/material/card'; +import {NgxDatatableModule} from '@swimlane/ngx-datatable'; import { AppRoutes } from './app.routing'; import { AppComponent } from './app.component'; @@ -43,6 +44,7 @@ import { ContributeComponent } from './components/contribute/contribute.componen import { ProjectsComponent } from './components/projects/projects.component'; import { PaymentComponent } from './components/payment/payment.component'; import { PaymentConfirmationComponent } from './components/payment-confirmation/payment-confirmation.component'; +import { MyAccountComponent } from './components/my-account/my-account.component'; // import { AddEventModule } from './add-event.module'; export function HttpLoaderFactory(http: HttpClient) { @@ -67,7 +69,8 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { ContributeComponent, ProjectsComponent, PaymentComponent, - PaymentConfirmationComponent + PaymentConfirmationComponent, + MyAccountComponent // ProjectListComponent ], imports: [ @@ -83,6 +86,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { MatMenuModule, MatToolbarModule, MatTabsModule, + NgxDatatableModule, MatCheckboxModule, MatProgressBarModule, MatSelectModule, diff --git a/ng8-seed/src/app/app.routing.ts b/ng8-seed/src/app/app.routing.ts index 944d8ef..0876caa 100644 --- a/ng8-seed/src/app/app.routing.ts +++ b/ng8-seed/src/app/app.routing.ts @@ -7,7 +7,7 @@ import { ContributeComponent } from './components/contribute/contribute.componen import { ProjectsComponent } from './components/projects/projects.component'; import { PaymentComponent } from './components/payment/payment.component'; import { PaymentConfirmationComponent } from './components/payment-confirmation/payment-confirmation.component'; - +import { MyAccountComponent } from './components/my-account/my-account.component'; export const AppRoutes: Routes = [{ path: '', redirectTo: 'home', @@ -34,6 +34,10 @@ export const AppRoutes: Routes = [{ { path : 'paymentconfirmation', component:PaymentConfirmationComponent +}, +{ + path : 'my-account', + component:MyAccountComponent } ] }, diff --git a/ng8-seed/src/app/components/my-account/my-account.component.html b/ng8-seed/src/app/components/my-account/my-account.component.html new file mode 100644 index 0000000..c93a7b3 --- /dev/null +++ b/ng8-seed/src/app/components/my-account/my-account.component.html @@ -0,0 +1,70 @@ + + + + My Profile + +
+
+ + + + + Registered as Organistation + +
+
+ + + + + + +
+
+ + + +
+
+ + + +
+
+ + + +
+ +
+
+
+ + My Contributions + +
+ + +
+
+
+ + FAQ / Support + + + + +
+
\ No newline at end of file diff --git a/ng8-seed/src/app/components/my-account/my-account.component.scss b/ng8-seed/src/app/components/my-account/my-account.component.scss new file mode 100644 index 0000000..e69de29 diff --git a/ng8-seed/src/app/components/my-account/my-account.component.spec.ts b/ng8-seed/src/app/components/my-account/my-account.component.spec.ts new file mode 100644 index 0000000..9a4cdd2 --- /dev/null +++ b/ng8-seed/src/app/components/my-account/my-account.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MyAccountComponent } from './my-account.component'; + +describe('MyAccountComponent', () => { + let component: MyAccountComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ MyAccountComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(MyAccountComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng8-seed/src/app/components/my-account/my-account.component.ts b/ng8-seed/src/app/components/my-account/my-account.component.ts new file mode 100644 index 0000000..3ad04a2 --- /dev/null +++ b/ng8-seed/src/app/components/my-account/my-account.component.ts @@ -0,0 +1,51 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-my-account', + templateUrl: './my-account.component.html', + styleUrls: ['./my-account.component.scss'] +}) +export class MyAccountComponent implements OnInit { +firstToggle: boolean; +rows = []; +count = 0; +offset = 0; +limit = 10; + +ngOnInit() { + this.page(this.offset, this.limit); +} + +page(offset, limit) { + this.fetch((results) => { + this.count = results.length; + + const start = offset * limit; + const end = start + limit; + const rows = [...this.rows]; + + for (let i = start; i < end; i++) { + rows[i] = results[i]; + } + + this.rows = rows; + console.log('Page Results', start, end, rows); + }); +} + +fetch(cb) { + const req = new XMLHttpRequest(); + req.open('GET', `assets/data/company.json`); + + req.onload = () => { + cb(JSON.parse(req.response)); + }; + + req.send(); +} + +onPage(event) { + console.log('Page Event', event); + this.page(event.offset, event.limit); +} +} diff --git a/ng8-seed/src/app/shared/menu-items/horizontal-menu-items.ts b/ng8-seed/src/app/shared/menu-items/horizontal-menu-items.ts index 04fecbf..0053e24 100644 --- a/ng8-seed/src/app/shared/menu-items/horizontal-menu-items.ts +++ b/ng8-seed/src/app/shared/menu-items/horizontal-menu-items.ts @@ -40,12 +40,12 @@ const HORIZONTALMENUITEMS = [ {state: 'paymentconfirmation', name: 'PaymentConfirmation'} ] }, - // { - // state: 'projects', - // name: 'Projects', - // type: 'link', - // icon: 'bookmark' - // }, + { + state: 'my-account', + name: 'My-Account', + type: 'link', + icon: 'person' + }, // { // state: 'contribute', // name: 'Contribute',