diff --git a/android/.idea/compiler.xml b/android/.idea/compiler.xml new file mode 100644 index 000000000..61a9130cd --- /dev/null +++ b/android/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml index b6ea2b11a..fdae1d0dc 100644 --- a/android/.idea/misc.xml +++ b/android/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/capacitor.config.json b/capacitor.config.json index 376f0d671..21a459c6d 100644 --- a/capacitor.config.json +++ b/capacitor.config.json @@ -12,4 +12,4 @@ }, "cordova": {}, "linuxAndroidStudioPath": "/home/username/android-studio/bin/studio.sh" -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b7127eec4..b78fa09a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -337,6 +337,31 @@ } } }, + "@angular/animations": { + "version": "10.0.14", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-10.0.14.tgz", + "integrity": "sha512-0BOGQOuaudIG0pq6FAnG55teKM7tEQZdIwdoOf0okhh9n0cFWSWRUjvUxWt25bWswlO+HxELyJioiRUvVSES4g==", + "requires": { + "tslib": "^2.0.0" + } + }, + "@angular/cdk": { + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-10.2.7.tgz", + "integrity": "sha512-ZQjDfTRTn7JuAKsf3jiIdU2XBaxxGBi/ZWYv5Pb3HCl6B4PISsIE5VWRhkoUogoAB0MiFHpjnWeIqknJEm11YQ==", + "requires": { + "parse5": "^5.0.0", + "tslib": "^2.0.0" + }, + "dependencies": { + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "optional": true + } + } + }, "@angular/cli": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-10.2.0.tgz", @@ -507,6 +532,14 @@ "integrity": "sha512-M10ubO8VYY5CjmTlD8h1qSfn7MSRXSGFMPR/4JQpPQP8SmcXpkgK72Y8YzW7sJrc/y4yaZWHwjne8CHBN+XFcw==", "dev": true }, + "@angular/material": { + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/@angular/material/-/material-10.2.7.tgz", + "integrity": "sha512-uk6JkRrKHaM9VFMzX7pWC83YNLVgXPB3D8U1yjSOafCdWwrRZgUHGr8MPlSILCr3o2nxgg5SsKdWcWwHuXXUZA==", + "requires": { + "tslib": "^2.0.0" + } + }, "@angular/platform-browser": { "version": "10.0.14", "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-10.0.14.tgz", diff --git a/package.json b/package.json index 31195bb72..ebb79a491 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "preconfig": "node set-secret.js", "serve": "npm run preconfig && ionic serve", "build": "npm run preconfig && ionic build", - "build-android": "npm run build && cap sync && cap open android", + "build-android": "npm run build && cap sync android && cap open android", "test": "npm run preconfig && ng test", "test-ci": "npm run preconfig && ng test --no-watch --no-progress --browsers=ChromeHeadlessCI", "lint": "npm run preconfig && ng lint", @@ -16,9 +16,12 @@ }, "private": true, "dependencies": { + "@angular/animations": "~10.0.6", + "@angular/cdk": "^10.2.7", "@angular/common": "~10.0.6", "@angular/core": "~10.0.6", "@angular/forms": "~10.0.6", + "@angular/material": "^10.2.7", "@angular/platform-browser": "~10.0.6", "@angular/platform-browser-dynamic": "~10.0.6", "@angular/router": "~10.0.6", @@ -30,10 +33,10 @@ "@ionic/pwa-elements": "^3.0.1", "@ngneat/transloco": "^2.19.1", "@ngneat/until-destroy": "^8.0.2", - "image-blob-reduce": "^2.0.0", "@ngx-formly/core": "^5.0.0", "@ngx-formly/ionic": "^5.0.0", "@ngx-formly/schematics": "^5.10.3", + "image-blob-reduce": "^2.0.0", "rxjs": "~6.6.3", "tslib": "^2.0.1", "zone.js": "~0.10.2" diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 8dfb641ab..5fed58ee0 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -1,33 +1,38 @@ import { NgModule } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; - import { AuthGuardService } from './services/auth/auth-guard.service'; import { LoginGuardService } from './services/auth/login-guard.service'; + const routes: Routes = [{ path: '', redirectTo: 'storage', pathMatch: 'full' -}, -{ +}, { path: 'login', loadChildren: () => import('./pages/login/login.module').then(m => m.LoginPageModule), canActivate: [LoginGuardService], -}, -{ +}, { path: 'signup', loadChildren: () => import('./pages/signup/signup.module').then(m => m.SignupPageModule) -}, - -{ +}, { path: 'storage', loadChildren: () => import('./pages/storage/storage.module').then(m => m.StoragePageModule), canActivate: [AuthGuardService], -}, -{ +}, { + path: 'profile', + loadChildren: () => import('./pages/profile/profile.module').then(m => m.ProfilePageModule) +}, { path: 'settings', loadChildren: () => import('./pages/settings/settings.module').then(m => m.SettingsPageModule), canActivate: [AuthGuardService], +}, { + path: 'privacy', + loadChildren: () => import('./pages/privacy/privacy.module').then(m => m.PrivacyPageModule) +}, { + path: 'about', + loadChildren: () => import('./pages/about/about.module').then(m => m.AboutPageModule), + canActivate: [AuthGuardService], }, { path: 'proof', loadChildren: () => import('./pages/proof/proof.module').then(m => m.ProofPageModule), @@ -44,25 +49,7 @@ const routes: Routes = [{ path: 'publishers/numbers-storage', loadChildren: () => import('./pages/publishers/numbers-storage/numbers-storage.module').then(m => m.NumbersStoragePageModule), canActivate: [AuthGuardService], -}, { - path: 'general', - loadChildren: () => import('./pages/general/general.module').then(m => m.GeneralPageModule), - canActivate: [AuthGuardService], -}, { - path: 'defaultinformationprovider', - // tslint:disable-next-line: max-line-length - loadChildren: () => import('./pages/defaultinformationprovider/defaultinformationprovider.module').then(m => m.DefaultInformationProviderPageModule), - canActivate: [AuthGuardService], -}, { - path: 'defaultsignature', - loadChildren: () => import('./pages/defaultsignature/defaultsignature.module').then(m => m.DefaultSignaturePageModule), - canActivate: [AuthGuardService], -}, { - path: 'about', - loadChildren: () => import('./pages/about/about.module').then(m => m.AboutPageModule), - canActivate: [AuthGuardService], -}, -]; +}]; @NgModule({ imports: [ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 5f3eccf67..dc6c3cbf6 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,17 +1,19 @@ import { HttpClientModule } from '@angular/common/http'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar'; import { BrowserModule } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouteReuseStrategy, RouterModule } from '@angular/router'; - import { IonicModule, IonicRouteStrategy } from '@ionic/angular'; import { FormlyModule } from '@ngx-formly/core'; import { FormlyIonicModule } from '@ngx-formly/ionic'; - import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { TranslocoRootModule } from './transloco/transloco-root.module'; + + @NgModule({ declarations: [AppComponent], entryComponents: [], @@ -25,9 +27,14 @@ import { TranslocoRootModule } from './transloco/transloco-root.module'; ReactiveFormsModule, FormlyModule.forRoot({ extras: { lazyRender: true } }), FormlyIonicModule, - RouterModule.forRoot([]) + RouterModule.forRoot([]), + BrowserAnimationsModule ], - providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }], + providers: [{ + provide: RouteReuseStrategy, useClass: IonicRouteStrategy + }, { + provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: { duration: 2500 } + }], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/src/app/components/post-capture-card/post-capture-card.component.html b/src/app/components/post-capture-card/post-capture-card.component.html new file mode 100644 index 000000000..a898f77d9 --- /dev/null +++ b/src/app/components/post-capture-card/post-capture-card.component.html @@ -0,0 +1,47 @@ + + +
+ User Name + sent from n hours + + +
+ + + + + access_time +
+ {{ t('timestamp') }} + {{ proof.timestamp | date:'medium' }} +
+
+ + place +
+ {{ t('address') }} + 877 N Trinity St Eagle Pass, Texas(TX), 78852 +
+
+ + +
+ {{ t('mediaId') }} + abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef-abcdef +
+
+
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum + dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui + officia deserunt mollit anim id est laborum. +

+
+ + + +
\ No newline at end of file diff --git a/src/app/components/post-capture-card/post-capture-card.component.scss b/src/app/components/post-capture-card/post-capture-card.component.scss new file mode 100644 index 000000000..7ef0280fa --- /dev/null +++ b/src/app/components/post-capture-card/post-capture-card.component.scss @@ -0,0 +1,49 @@ +:host { + display: block; +} + +.toolbar-spacer { + flex: 1 1 auto; +} + +mat-card img { + max-width: initial; +} + +mat-card-content { + margin-bottom: 0; +} + +.post-capture-avatar { + background-image: url("https://gravatar.com/avatar/8db683da3c728970bb776f6cc4048fd2?s=400&d=mp&r=x"); + background-size: cover; +} + +.caption-ellipsis { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} + +.caption-full { + overflow: visible; + height: auto; + text-overflow: initial; + white-space: initial; +} + +.info-list { + display: none; +} + +.info-list-show { + display: block; +} + +.info-list-content { + width: 60%; + float: right; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} diff --git a/src/app/components/post-capture-card/post-capture-card.component.spec.ts b/src/app/components/post-capture-card/post-capture-card.component.spec.ts new file mode 100644 index 000000000..f38d9fd6b --- /dev/null +++ b/src/app/components/post-capture-card/post-capture-card.component.spec.ts @@ -0,0 +1,42 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { IonicModule } from '@ionic/angular'; +import { Proof } from 'src/app/services/data/proof/proof'; +import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; +import { PostCaptureCardComponent } from './post-capture-card.component'; + +describe('PostCaptureCardComponent', () => { + let component: PostCaptureCardComponent; + let fixture: ComponentFixture; + const expectedProof: Proof = { hash: '1234567890abcdef', timestamp: 1604473851208, mimeType: 'image/jpeg' }; + const expectedImageSrc = 'https://picsum.photos/200/300'; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PostCaptureCardComponent], + imports: [ + IonicModule.forRoot(), + HttpClientTestingModule, + MatCardModule, + MatButtonModule, + MatIconModule, + MatListModule, + getTranslocoModule() + ] + }).compileComponents(); + + fixture = TestBed.createComponent(PostCaptureCardComponent); + component = fixture.componentInstance; + component.proof = expectedProof; + component.imageSrc = expectedImageSrc; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/components/post-capture-card/post-capture-card.component.ts b/src/app/components/post-capture-card/post-capture-card.component.ts new file mode 100644 index 000000000..e62e27ddb --- /dev/null +++ b/src/app/components/post-capture-card/post-capture-card.component.ts @@ -0,0 +1,24 @@ +import { Component, Input } from '@angular/core'; +import { MatIconRegistry } from '@angular/material/icon'; +import { DomSanitizer } from '@angular/platform-browser'; +import { Proof } from 'src/app/services/data/proof/proof'; + +@Component({ + selector: 'app-post-capture-card', + templateUrl: './post-capture-card.component.html', + styleUrls: ['./post-capture-card.component.scss'], +}) +export class PostCaptureCardComponent { + + @Input() proof!: Proof; + @Input() imageSrc!: string; + + openMore = false; + + constructor( + iconRegistry: MatIconRegistry, + sanitizer: DomSanitizer + ) { + iconRegistry.addSvgIcon('media-id', sanitizer.bypassSecurityTrustResourceUrl('/assets/icon/media-id.svg')); + } +} diff --git a/src/app/pages/about/about.module.ts b/src/app/pages/about/about.module.ts index 9747b1b00..2bd312049 100644 --- a/src/app/pages/about/about.module.ts +++ b/src/app/pages/about/about.module.ts @@ -1,6 +1,9 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatToolbarModule } from '@angular/material/toolbar'; import { IonicModule } from '@ionic/angular'; import { TranslocoModule } from '@ngneat/transloco'; import { AboutPageRoutingModule } from './about-routing.module'; @@ -9,10 +12,13 @@ import { AboutPage } from './about.page'; @NgModule({ imports: [ CommonModule, - FormsModule, IonicModule, AboutPageRoutingModule, - TranslocoModule + TranslocoModule, + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatListModule ], declarations: [AboutPage] }) diff --git a/src/app/pages/about/about.page.html b/src/app/pages/about/about.page.html index 6af55b7b5..82474ebd7 100644 --- a/src/app/pages/about/about.page.html +++ b/src/app/pages/about/about.page.html @@ -1,22 +1,16 @@ - - - - - - - - {{ t('about') }} - - + + + {{ t('about') }} + - - - - - -

{{ t('version') }}

-

{{ version$ | async }}

-
-
-
-
\ No newline at end of file +
+ + + update +
{{ t('version') }}
+
{{ version$ | async }}
+
+
+
\ No newline at end of file diff --git a/src/app/pages/about/about.page.scss b/src/app/pages/about/about.page.scss index e69de29bb..0d9c2d0d0 100644 --- a/src/app/pages/about/about.page.scss +++ b/src/app/pages/about/about.page.scss @@ -0,0 +1,3 @@ +mat-toolbar { + background: white; +} diff --git a/src/app/pages/about/about.page.spec.ts b/src/app/pages/about/about.page.spec.ts index e69de29bb..31954cd4d 100644 --- a/src/app/pages/about/about.page.spec.ts +++ b/src/app/pages/about/about.page.spec.ts @@ -0,0 +1,39 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { RouterTestingModule } from '@angular/router/testing'; +import { IonicModule } from '@ionic/angular'; +import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; +import { AboutPage } from './about.page'; + +describe('AboutPage', () => { + let component: AboutPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [AboutPage], + imports: [ + IonicModule.forRoot(), + RouterTestingModule, + getTranslocoModule(), + HttpClientTestingModule, + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatListModule + ] + }).compileComponents(); + + fixture = TestBed.createComponent(AboutPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/defaultinformationprovider/defaultinformationprovider-routing.module.ts b/src/app/pages/defaultinformationprovider/defaultinformationprovider-routing.module.ts deleted file mode 100644 index 3b35c3043..000000000 --- a/src/app/pages/defaultinformationprovider/defaultinformationprovider-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { DefaultInformationProviderPage } from './defaultinformationprovider.page'; - - -const routes: Routes = [ - { - path: '', - component: DefaultInformationProviderPage - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class DefaultInformationProviderPageRoutingModule { } diff --git a/src/app/pages/defaultinformationprovider/defaultinformationprovider.module.ts b/src/app/pages/defaultinformationprovider/defaultinformationprovider.module.ts deleted file mode 100644 index a11f5e520..000000000 --- a/src/app/pages/defaultinformationprovider/defaultinformationprovider.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { IonicModule } from '@ionic/angular'; -import { TranslocoModule } from '@ngneat/transloco'; -import { DefaultInformationProviderPageRoutingModule } from './defaultinformationprovider-routing.module'; -import { DefaultInformationProviderPage } from './defaultinformationprovider.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - DefaultInformationProviderPageRoutingModule, - TranslocoModule - ], - declarations: [DefaultInformationProviderPage] -}) -export class DefaultInformationProviderPageModule { } diff --git a/src/app/pages/defaultinformationprovider/defaultinformationprovider.page.html b/src/app/pages/defaultinformationprovider/defaultinformationprovider.page.html deleted file mode 100644 index fcbf4449f..000000000 --- a/src/app/pages/defaultinformationprovider/defaultinformationprovider.page.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - {{ t('defaultInformationProvider') }} - - - - - - - - {{ t('collectDeviceInfo') }} - - - - - {{ t('collectLocationInfo') }} - - - - \ No newline at end of file diff --git a/src/app/pages/defaultinformationprovider/defaultinformationprovider.page.scss b/src/app/pages/defaultinformationprovider/defaultinformationprovider.page.scss deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/app/pages/defaultinformationprovider/defaultinformationprovider.page.spec.ts b/src/app/pages/defaultinformationprovider/defaultinformationprovider.page.spec.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/app/pages/defaultsignature/defaultsignature-routing.module.ts b/src/app/pages/defaultsignature/defaultsignature-routing.module.ts deleted file mode 100644 index ed7edaddc..000000000 --- a/src/app/pages/defaultsignature/defaultsignature-routing.module.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { DefaultSignaturePage } from './defaultsignature.page'; - - -const routes: Routes = [ - { - path: '', - component: DefaultSignaturePage - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule], -}) -export class DefaultSignaturePageRoutingModule { } diff --git a/src/app/pages/defaultsignature/defaultsignature.module.ts b/src/app/pages/defaultsignature/defaultsignature.module.ts deleted file mode 100644 index c49eaaeae..000000000 --- a/src/app/pages/defaultsignature/defaultsignature.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { IonicModule } from '@ionic/angular'; -import { TranslocoModule } from '@ngneat/transloco'; -import { DefaultSignaturePageRoutingModule } from './defaultsignature-routing.module'; -import { DefaultSignaturePage } from './defaultsignature.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - DefaultSignaturePageRoutingModule, - TranslocoModule - ], - declarations: [DefaultSignaturePage] -}) -export class DefaultSignaturePageModule { } diff --git a/src/app/pages/defaultsignature/defaultsignature.page.html b/src/app/pages/defaultsignature/defaultsignature.page.html deleted file mode 100644 index 9beaf69c9..000000000 --- a/src/app/pages/defaultsignature/defaultsignature.page.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - {{ t('defaultSignature') }} - - - - - - - - -

{{ t('publicKey') }}

-

{{ publicKey$ | async }}

-
-
- - - -

{{ t('privateKey') }}

-

{{ privateKey$ | async }}

-
-
-
-
\ No newline at end of file diff --git a/src/app/pages/defaultsignature/defaultsignature.page.scss b/src/app/pages/defaultsignature/defaultsignature.page.scss deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/app/pages/defaultsignature/defaultsignature.page.spec.ts b/src/app/pages/defaultsignature/defaultsignature.page.spec.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/app/pages/defaultsignature/defaultsignature.page.ts b/src/app/pages/defaultsignature/defaultsignature.page.ts deleted file mode 100644 index 6db29f90d..000000000 --- a/src/app/pages/defaultsignature/defaultsignature.page.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Component } from '@angular/core'; -import { UntilDestroy } from '@ngneat/until-destroy'; -import { DefaultSignatureProvider } from 'src/app/services/collector/signature/default-provider/default-provider'; - -@UntilDestroy({ checkProperties: true }) -@Component({ - selector: 'app-defaultsignature', - templateUrl: './defaultsignature.page.html', - styleUrls: ['./defaultsignature.page.scss'], -}) -export class DefaultSignaturePage { - - readonly publicKey$ = DefaultSignatureProvider.getPublicKey$(); - readonly privateKey$ = DefaultSignatureProvider.getPrivateKey$(); -} diff --git a/src/app/pages/general/general.module.ts b/src/app/pages/general/general.module.ts deleted file mode 100644 index 7f3329996..000000000 --- a/src/app/pages/general/general.module.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { IonicModule } from '@ionic/angular'; -import { TranslocoModule } from '@ngneat/transloco'; -import { GeneralPageRoutingModule } from './general-routing.module'; -import { GeneralPage } from './general.page'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - IonicModule, - GeneralPageRoutingModule, - TranslocoModule - ], - declarations: [GeneralPage] -}) -export class GeneralPageModule { } diff --git a/src/app/pages/general/general.page.html b/src/app/pages/general/general.page.html deleted file mode 100644 index 35abd8a7c..000000000 --- a/src/app/pages/general/general.page.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - {{ t('general') }} - - - - - - - - {{ t('languages') }} - - {{ language.value }} - - - - - \ No newline at end of file diff --git a/src/app/pages/general/general.page.scss b/src/app/pages/general/general.page.scss deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/app/pages/general/general.page.spec.ts b/src/app/pages/general/general.page.spec.ts deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/app/pages/general/general.page.ts b/src/app/pages/general/general.page.ts deleted file mode 100644 index 4351f6795..000000000 --- a/src/app/pages/general/general.page.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Component } from '@angular/core'; -import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { LanguageService } from 'src/app/services/language/language.service'; - -@UntilDestroy({ checkProperties: true }) -@Component({ - selector: 'app-general', - templateUrl: './general.page.html', - styleUrls: ['./general.page.scss'], -}) -export class GeneralPage { - - readonly langauges = this.languageService.languages; - readonly currentLanguageKey$ = this.languageService.currentLanguageKey$; - - constructor( - private readonly languageService: LanguageService - ) { } - - setCurrentLanguage(languageKey: string) { - this.languageService.setCurrentLanguage$(languageKey).pipe( - untilDestroyed(this) - ).subscribe(); - } -} diff --git a/src/app/pages/login/login.module.ts b/src/app/pages/login/login.module.ts index f9f6bde81..4c717278c 100644 --- a/src/app/pages/login/login.module.ts +++ b/src/app/pages/login/login.module.ts @@ -1,14 +1,10 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; - import { IonicModule } from '@ionic/angular'; import { TranslocoModule, TranslocoService } from '@ngneat/transloco'; -import { - FORMLY_CONFIG, FormlyFieldConfig, FormlyModule, -} from '@ngx-formly/core'; +import { FormlyFieldConfig, FormlyModule, FORMLY_CONFIG } from '@ngx-formly/core'; import { FormlyIonicModule } from '@ngx-formly/ionic'; - import { LoginPageRoutingModule } from './login-routing.module'; import { LoginPage } from './login.page'; @@ -56,13 +52,11 @@ export function registerValidationMessages(translocoService: TranslocoService) { FormlyIonicModule, ], declarations: [LoginPage], - providers: [ - { - provide: FORMLY_CONFIG, - multi: true, - useFactory: registerValidationMessages, - deps: [TranslocoService], - }, - ], + providers: [{ + provide: FORMLY_CONFIG, + multi: true, + useFactory: registerValidationMessages, + deps: [TranslocoService], + }] }) export class LoginPageModule { } diff --git a/src/app/pages/login/login.page.spec.ts b/src/app/pages/login/login.page.spec.ts index 49dab8c6e..e94bc5ab3 100644 --- a/src/app/pages/login/login.page.spec.ts +++ b/src/app/pages/login/login.page.spec.ts @@ -1,16 +1,12 @@ import { HttpClient } from '@angular/common/http'; -import { - HttpClientTestingModule, HttpTestingController, -} from '@angular/common/http/testing'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; - -import { - getTranslocoModule, -} from 'src/app/transloco/transloco-root.module.spec'; - import { IonicModule } from '@ionic/angular'; - +import { FormlyModule } from '@ngx-formly/core'; +import { FormlyIonicModule } from '@ngx-formly/ionic'; +import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; import { LoginPage } from './login.page'; describe('LoginPage', () => { @@ -24,9 +20,12 @@ describe('LoginPage', () => { declarations: [LoginPage], imports: [ IonicModule.forRoot(), - HttpClientTestingModule, - getTranslocoModule(), RouterTestingModule, + getTranslocoModule(), + HttpClientTestingModule, + FormlyModule.forRoot(), + FormlyIonicModule, + ReactiveFormsModule ] }).compileComponents(); diff --git a/src/app/pages/general/general-routing.module.ts b/src/app/pages/privacy/privacy-routing.module.ts similarity index 51% rename from src/app/pages/general/general-routing.module.ts rename to src/app/pages/privacy/privacy-routing.module.ts index af45c5bf4..4c64f30ff 100644 --- a/src/app/pages/general/general-routing.module.ts +++ b/src/app/pages/privacy/privacy-routing.module.ts @@ -1,12 +1,12 @@ import { NgModule } from '@angular/core'; -import { RouterModule, Routes } from '@angular/router'; -import { GeneralPage } from './general.page'; +import { Routes, RouterModule } from '@angular/router'; +import { PrivacyPage } from './privacy.page'; const routes: Routes = [ { path: '', - component: GeneralPage + component: PrivacyPage } ]; @@ -14,4 +14,4 @@ const routes: Routes = [ imports: [RouterModule.forChild(routes)], exports: [RouterModule], }) -export class GeneralPageRoutingModule { } +export class PrivacyPageRoutingModule {} diff --git a/src/app/pages/privacy/privacy.module.ts b/src/app/pages/privacy/privacy.module.ts new file mode 100644 index 000000000..cffe4b861 --- /dev/null +++ b/src/app/pages/privacy/privacy.module.ts @@ -0,0 +1,27 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { IonicModule } from '@ionic/angular'; +import { TranslocoModule } from '@ngneat/transloco'; +import { PrivacyPageRoutingModule } from './privacy-routing.module'; +import { PrivacyPage } from './privacy.page'; + +@NgModule({ + imports: [ + CommonModule, + IonicModule, + PrivacyPageRoutingModule, + TranslocoModule, + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatListModule, + MatSlideToggleModule + ], + declarations: [PrivacyPage] +}) +export class PrivacyPageModule { } diff --git a/src/app/pages/privacy/privacy.page.html b/src/app/pages/privacy/privacy.page.html new file mode 100644 index 000000000..1a2ba1efa --- /dev/null +++ b/src/app/pages/privacy/privacy.page.html @@ -0,0 +1,23 @@ + + + {{ t('privacy') }} + + +
+ + + perm_device_information +
{{ t('collectDeviceInfo') }}
+ +
+ + my_location +
{{ t('collectLocationInfo') }}
+ +
+
+
\ No newline at end of file diff --git a/src/app/pages/privacy/privacy.page.scss b/src/app/pages/privacy/privacy.page.scss new file mode 100644 index 000000000..0d9c2d0d0 --- /dev/null +++ b/src/app/pages/privacy/privacy.page.scss @@ -0,0 +1,3 @@ +mat-toolbar { + background: white; +} diff --git a/src/app/pages/privacy/privacy.page.spec.ts b/src/app/pages/privacy/privacy.page.spec.ts new file mode 100644 index 000000000..8e9d9ae13 --- /dev/null +++ b/src/app/pages/privacy/privacy.page.spec.ts @@ -0,0 +1,39 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { RouterTestingModule } from '@angular/router/testing'; +import { IonicModule } from '@ionic/angular'; +import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; +import { PrivacyPage } from './privacy.page'; + +describe('PrivacyPage', () => { + let component: PrivacyPage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [PrivacyPage], + imports: [ + IonicModule.forRoot(), + RouterTestingModule, + getTranslocoModule(), + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatListModule, + MatSlideToggleModule + ] + }).compileComponents(); + + fixture = TestBed.createComponent(PrivacyPage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/defaultinformationprovider/defaultinformationprovider.page.ts b/src/app/pages/privacy/privacy.page.ts similarity index 68% rename from src/app/pages/defaultinformationprovider/defaultinformationprovider.page.ts rename to src/app/pages/privacy/privacy.page.ts index 6b750aa44..0376e8309 100644 --- a/src/app/pages/defaultinformationprovider/defaultinformationprovider.page.ts +++ b/src/app/pages/privacy/privacy.page.ts @@ -1,14 +1,14 @@ import { Component } from '@angular/core'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { CapacitorProvider } from 'src/app/services/collector/information/capacitor-provider/capacitor-provider'; +import { CapacitorProvider } from '../../services/collector/information/capacitor-provider/capacitor-provider'; @UntilDestroy({ checkProperties: true }) @Component({ - selector: 'app-defaultinformationprovider', - templateUrl: './defaultinformationprovider.page.html', - styleUrls: ['./defaultinformationprovider.page.scss'], + selector: 'app-privacy', + templateUrl: './privacy.page.html', + styleUrls: ['./privacy.page.scss'], }) -export class DefaultInformationProviderPage { +export class PrivacyPage { readonly isDeviceInfoCollectionEnabled$ = CapacitorProvider.isDeviceInfoCollectionEnabled$(); readonly isLocationInfoCollectionEnabled$ = CapacitorProvider.isLocationInfoCollectionEnabled$(); diff --git a/src/app/pages/profile/profile-routing.module.ts b/src/app/pages/profile/profile-routing.module.ts new file mode 100644 index 000000000..a7052f82c --- /dev/null +++ b/src/app/pages/profile/profile-routing.module.ts @@ -0,0 +1,17 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { ProfilePage } from './profile.page'; + +const routes: Routes = [ + { + path: '', + component: ProfilePage + } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class ProfilePageRoutingModule {} diff --git a/src/app/pages/profile/profile.module.ts b/src/app/pages/profile/profile.module.ts new file mode 100644 index 000000000..ed9d67288 --- /dev/null +++ b/src/app/pages/profile/profile.module.ts @@ -0,0 +1,27 @@ +import { CommonModule } from '@angular/common'; +import { NgModule } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { IonicModule } from '@ionic/angular'; +import { TranslocoModule } from '@ngneat/transloco'; +import { ProfilePageRoutingModule } from './profile-routing.module'; +import { ProfilePage } from './profile.page'; + +@NgModule({ + imports: [ + CommonModule, + IonicModule, + ProfilePageRoutingModule, + TranslocoModule, + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatListModule, + MatSnackBarModule + ], + declarations: [ProfilePage] +}) +export class ProfilePageModule { } diff --git a/src/app/pages/profile/profile.page.html b/src/app/pages/profile/profile.page.html new file mode 100644 index 000000000..093c8f8e1 --- /dev/null +++ b/src/app/pages/profile/profile.page.html @@ -0,0 +1,41 @@ + + + {{ t('profile') }} + + + + +
+ + + account_circle +
{{ t('userName') }}
+
{{ userName$ | async }}
+
+ + email +
{{ t('email') }}
+
{{ email$ | async }}
+
+ + lock +
{{ t('publicKey') }}
+
{{ publicKey$ | async }}
+ +
+ + vpn_key +
{{ t('privateKey') }}
+
{{ privateKey$ | async }}
+ +
+
+ + +
\ No newline at end of file diff --git a/src/app/pages/profile/profile.page.scss b/src/app/pages/profile/profile.page.scss new file mode 100644 index 000000000..5fe742012 --- /dev/null +++ b/src/app/pages/profile/profile.page.scss @@ -0,0 +1,13 @@ +mat-toolbar { + background: white; +} + +.numbers-logo { + display: block; + width: 50%; + margin: 10vw auto; +} + +.expand { + width: 100%; +} diff --git a/src/app/pages/profile/profile.page.spec.ts b/src/app/pages/profile/profile.page.spec.ts new file mode 100644 index 000000000..9157fa584 --- /dev/null +++ b/src/app/pages/profile/profile.page.spec.ts @@ -0,0 +1,41 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { RouterTestingModule } from '@angular/router/testing'; +import { IonicModule } from '@ionic/angular'; +import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; +import { ProfilePage } from './profile.page'; + +describe('ProfilePage', () => { + let component: ProfilePage; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ProfilePage], + imports: [ + IonicModule.forRoot(), + RouterTestingModule, + getTranslocoModule(), + HttpClientTestingModule, + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatListModule, + MatSnackBarModule + ] + }).compileComponents(); + + fixture = TestBed.createComponent(ProfilePage); + component = fixture.componentInstance; + fixture.detectChanges(); + })); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/profile/profile.page.ts b/src/app/pages/profile/profile.page.ts new file mode 100644 index 000000000..3ea5d90b1 --- /dev/null +++ b/src/app/pages/profile/profile.page.ts @@ -0,0 +1,58 @@ +import { Component } from '@angular/core'; +import { MatSnackBar } from '@angular/material/snack-bar'; +import { Router } from '@angular/router'; +import { Plugins } from '@capacitor/core'; +import { ToastController } from '@ionic/angular'; +import { TranslocoService } from '@ngneat/transloco'; +import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; +import { defer } from 'rxjs'; +import { catchError, concatMapTo } from 'rxjs/operators'; +import { BlockingActionService } from '../../services/blocking-action/blocking-action.service'; +import { DefaultSignatureProvider } from '../../services/collector/signature/default-provider/default-provider'; +import { NumbersStorageApi } from '../../services/publisher/numbers-storage/numbers-storage-api.service'; + +const { Clipboard } = Plugins; + +@UntilDestroy({ checkProperties: true }) +@Component({ + selector: 'app-profile', + templateUrl: './profile.page.html', + styleUrls: ['./profile.page.scss'], +}) +export class ProfilePage { + + readonly userName$ = this.numbersStorageApi.getUserName$(); + readonly email$ = this.numbersStorageApi.getEmail$(); + readonly publicKey$ = DefaultSignatureProvider.getPublicKey$(); + readonly privateKey$ = DefaultSignatureProvider.getPrivateKey$(); + + constructor( + private readonly router: Router, + private readonly blockingActionService: BlockingActionService, + private readonly toastController: ToastController, + private readonly translocoService: TranslocoService, + private readonly snackBar: MatSnackBar, + private readonly numbersStorageApi: NumbersStorageApi + ) { } + + copyToClipboard(value: string) { + Clipboard.write({ string: value }); + this.snackBar.open(this.translocoService.translate('message.copiedToClipboard')); + } + + logout() { + const action$ = this.numbersStorageApi.logout$().pipe( + concatMapTo(defer(() => this.router.navigate(['/login']))), + catchError(err => this.toastController + .create({ message: JSON.stringify(err.error), duration: 4000 }) + .then(toast => toast.present()) + ) + ); + this.blockingActionService.run$( + action$, + { message: this.translocoService.translate('talkingToTheServer') } + ).pipe( + untilDestroyed(this) + ).subscribe(); + } +} diff --git a/src/app/pages/settings/settings.module.ts b/src/app/pages/settings/settings.module.ts index 9ca93404b..a5cc25efa 100644 --- a/src/app/pages/settings/settings.module.ts +++ b/src/app/pages/settings/settings.module.ts @@ -1,6 +1,10 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; +import { MatToolbarModule } from '@angular/material/toolbar'; import { IonicModule } from '@ionic/angular'; import { TranslocoModule } from '@ngneat/transloco'; import { SettingsPageRoutingModule } from './settings-routing.module'; @@ -9,10 +13,14 @@ import { SettingsPage } from './settings.page'; @NgModule({ imports: [ CommonModule, - FormsModule, IonicModule, SettingsPageRoutingModule, - TranslocoModule + TranslocoModule, + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatListModule, + MatSelectModule ], declarations: [SettingsPage] }) diff --git a/src/app/pages/settings/settings.page.html b/src/app/pages/settings/settings.page.html index e2b014e88..1992a2d3c 100644 --- a/src/app/pages/settings/settings.page.html +++ b/src/app/pages/settings/settings.page.html @@ -1,65 +1,20 @@ - - - - - - - - {{ t('settings') }} - - + + + {{ t('settings') }} + - - - {{ t('general') }} - - - {{ t('languages') }} - - {{ language.value }} - - - - {{ t('defaultInformationProvider') + ' (Capacitor)' }} - - - {{ t('collectDeviceInfo') }} - - - - - {{ t('collectLocationInfo') }} - - - {{ t('defaultSignature') + ' (Web Crypto API)' }} - - - -

{{ t('publicKey') }}

-

{{ publicKey$ | async }}

-
-
- - - -

{{ t('privateKey') }}

-

{{ privateKey$ | async }}

-
-
- {{ t('publisher')}} - - - Numbers Storage - - {{ t('about') }} - - - -

{{ t('version') }}

-

{{ version$ | async }}

-
-
-
-
\ No newline at end of file +
+ + + language +
{{ t('languages') }}
+ + + {{ language.value }} + + +
+
+
\ No newline at end of file diff --git a/src/app/pages/settings/settings.page.scss b/src/app/pages/settings/settings.page.scss index e69de29bb..66aeae665 100644 --- a/src/app/pages/settings/settings.page.scss +++ b/src/app/pages/settings/settings.page.scss @@ -0,0 +1,7 @@ +mat-toolbar { + background: white; +} + +mat-select { + width: 50%; +} diff --git a/src/app/pages/settings/settings.page.spec.ts b/src/app/pages/settings/settings.page.spec.ts index 21fc7c095..4740f83b2 100644 --- a/src/app/pages/settings/settings.page.spec.ts +++ b/src/app/pages/settings/settings.page.spec.ts @@ -1,5 +1,9 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSelectModule } from '@angular/material/select'; +import { MatToolbarModule } from '@angular/material/toolbar'; import { RouterTestingModule } from '@angular/router/testing'; import { IonicModule } from '@ionic/angular'; import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; @@ -12,7 +16,16 @@ describe('SettingsPage', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [SettingsPage], - imports: [FormsModule, IonicModule.forRoot(), RouterTestingModule, getTranslocoModule()] + imports: [ + IonicModule.forRoot(), + RouterTestingModule, + getTranslocoModule(), + MatToolbarModule, + MatButtonModule, + MatIconModule, + MatListModule, + MatSelectModule + ] }).compileComponents(); fixture = TestBed.createComponent(SettingsPage); diff --git a/src/app/pages/settings/settings.page.ts b/src/app/pages/settings/settings.page.ts index 2e1e047eb..f0bcb5c95 100644 --- a/src/app/pages/settings/settings.page.ts +++ b/src/app/pages/settings/settings.page.ts @@ -1,14 +1,7 @@ import { Component } from '@angular/core'; -import { Plugins } from '@capacitor/core'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; -import { defer } from 'rxjs'; -import { first, pluck } from 'rxjs/operators'; -import { CapacitorProvider } from 'src/app/services/collector/information/capacitor-provider/capacitor-provider'; -import { DefaultSignatureProvider } from 'src/app/services/collector/signature/default-provider/default-provider'; import { LanguageService } from 'src/app/services/language/language.service'; -const { Device } = Plugins; - @UntilDestroy({ checkProperties: true }) @Component({ selector: 'app-settings', @@ -19,14 +12,6 @@ export class SettingsPage { readonly langauges = this.languageService.languages; readonly currentLanguageKey$ = this.languageService.currentLanguageKey$; - readonly isDeviceInfoCollectionEnabled$ = CapacitorProvider.isDeviceInfoCollectionEnabled$(); - readonly isLocationInfoCollectionEnabled$ = CapacitorProvider.isLocationInfoCollectionEnabled$(); - readonly publicKey$ = DefaultSignatureProvider.getPublicKey$(); - readonly privateKey$ = DefaultSignatureProvider.getPrivateKey$(); - readonly version$ = defer(() => Device.getInfo()).pipe( - first(), - pluck('appVersion') - ); constructor( private readonly languageService: LanguageService @@ -37,16 +22,4 @@ export class SettingsPage { untilDestroyed(this) ).subscribe(); } - - setDeviceInfoCollection(enable: boolean) { - CapacitorProvider.setDeviceInfoCollection$(enable).pipe( - untilDestroyed(this) - ).subscribe(); - } - - setLocationInfoCollection(enable: boolean) { - CapacitorProvider.setLocationInfoCollection$(enable).pipe( - untilDestroyed(this) - ).subscribe(); - } } diff --git a/src/app/pages/signup/signup.module.ts b/src/app/pages/signup/signup.module.ts index bb1f6589e..cd239d9eb 100644 --- a/src/app/pages/signup/signup.module.ts +++ b/src/app/pages/signup/signup.module.ts @@ -1,16 +1,10 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { - AbstractControl, FormsModule, ReactiveFormsModule, -} from '@angular/forms'; - +import { AbstractControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { IonicModule } from '@ionic/angular'; import { TranslocoModule, TranslocoService } from '@ngneat/transloco'; -import { - FORMLY_CONFIG, FormlyFieldConfig, FormlyModule, -} from '@ngx-formly/core'; +import { FormlyFieldConfig, FormlyModule, FORMLY_CONFIG } from '@ngx-formly/core'; import { FormlyIonicModule } from '@ngx-formly/ionic'; - import { SignupPageRoutingModule } from './signup-routing.module'; import { SignupPage } from './signup.page'; @@ -78,22 +72,15 @@ export function registerValidationMessages(translocoService: TranslocoService) { SignupPageRoutingModule, FormsModule, ReactiveFormsModule, - FormlyModule.forRoot({ - validators: [ - { name: 'fieldMatch', validation: fieldMatchValidator }, - ], - extras: { lazyRender: true }, - }), + FormlyModule.forRoot({ validators: [{ name: 'fieldMatch', validation: fieldMatchValidator }], extras: { lazyRender: true }, }), FormlyIonicModule, ], declarations: [SignupPage], - providers: [ - { - provide: FORMLY_CONFIG, - multi: true, - useFactory: registerValidationMessages, - deps: [TranslocoService], - }, - ], + providers: [{ + provide: FORMLY_CONFIG, + multi: true, + useFactory: registerValidationMessages, + deps: [TranslocoService], + }] }) export class SignupPageModule { } diff --git a/src/app/pages/signup/signup.page.spec.ts b/src/app/pages/signup/signup.page.spec.ts index 92b07508e..6ad548a2b 100644 --- a/src/app/pages/signup/signup.page.spec.ts +++ b/src/app/pages/signup/signup.page.spec.ts @@ -1,16 +1,13 @@ import { HttpClient } from '@angular/common/http'; -import { - HttpClientTestingModule, HttpTestingController, -} from '@angular/common/http/testing'; +import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; - -import { - getTranslocoModule, -} from 'src/app/transloco/transloco-root.module.spec'; - import { IonicModule } from '@ionic/angular'; - +import { FormlyModule } from '@ngx-formly/core'; +import { FormlyIonicModule } from '@ngx-formly/ionic'; +import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; +import { fieldMatchValidator } from './signup.module'; import { SignupPage } from './signup.page'; describe('SignupPage', () => { @@ -24,9 +21,12 @@ describe('SignupPage', () => { declarations: [SignupPage], imports: [ IonicModule.forRoot(), - HttpClientTestingModule, + RouterTestingModule, getTranslocoModule(), - RouterTestingModule + HttpClientTestingModule, + FormlyModule.forRoot({ validators: [{ name: 'fieldMatch', validation: fieldMatchValidator }] }), + FormlyIonicModule, + ReactiveFormsModule ] }).compileComponents(); diff --git a/src/app/pages/storage/storage.module.ts b/src/app/pages/storage/storage.module.ts index a5695a91e..df16ee0b8 100644 --- a/src/app/pages/storage/storage.module.ts +++ b/src/app/pages/storage/storage.module.ts @@ -1,19 +1,35 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { IonicModule } from '@ionic/angular'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatGridListModule } from '@angular/material/grid-list'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSidenavModule } from '@angular/material/sidenav'; +import { MatTabsModule } from '@angular/material/tabs'; +import { MatToolbarModule } from '@angular/material/toolbar'; import { TranslocoModule } from '@ngneat/transloco'; +import { PostCaptureCardComponent } from 'src/app/components/post-capture-card/post-capture-card.component'; import { StoragePageRoutingModule } from './storage-routing.module'; import { StoragePage } from './storage.page'; @NgModule({ imports: [ CommonModule, - FormsModule, - IonicModule, StoragePageRoutingModule, - TranslocoModule + TranslocoModule, + MatToolbarModule, + MatIconModule, + MatButtonModule, + MatTabsModule, + MatGridListModule, + MatCardModule, + MatSidenavModule, + MatListModule ], - declarations: [StoragePage] + declarations: [ + StoragePage, + PostCaptureCardComponent + ] }) export class StoragePageModule { } diff --git a/src/app/pages/storage/storage.page.html b/src/app/pages/storage/storage.page.html index fe8f6dc83..9e74cf512 100644 --- a/src/app/pages/storage/storage.page.html +++ b/src/app/pages/storage/storage.page.html @@ -1,113 +1,69 @@ - - - - - - - - - - - - - {{ t('all') }} - - - - - {{ t('tags') }} - - - - - - - - - - - - + + + + + {{ userName$ | async }} + + + + + {{ t('profile') }} + + + {{ t('settings') }} + + + {{ t('privacy') }} + + + {{ t('about') }} + + + - - - - {{ t('settings') }} - - - - - - - - {{ t('general') }} - - - - - - {{ t('defaultInformationProvider') }} - - - - - - {{ t('defaultSignature') }} - - - - - - {{ t('informationProvider') }} - - - - - - {{ t('about') }} - - - - - + + + + + + + - - - - - -
{{proofWithSet[0].date}}
- - - - - - - -
-
-
- - - -
{{proofWithRaw.date}}
- - - - - -
-
-
-
+ + +
+ +
{{ proofsWithRaw[0].date }}
+ + + +
+
+
+ +
+ +
{{ proofsWithRaw[0].date }}
+ +
+
+
+
- - - - - -
\ No newline at end of file + +
+
\ No newline at end of file diff --git a/src/app/pages/storage/storage.page.scss b/src/app/pages/storage/storage.page.scss index 0263d1ea0..e64736bca 100644 --- a/src/app/pages/storage/storage.page.scss +++ b/src/app/pages/storage/storage.page.scss @@ -1,41 +1,51 @@ +mat-sidenav-container { + background: white; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; +} + +mat-sidenav { + width: 60%; +} + +mat-toolbar { + background: white; +} -.img-card { - margin: calc(var(--ion-padding, 9px) / 3); - width: 30vw; +.toolbar-spacer { + flex: 1 1 auto; } -.Title { - color: #000; +mat-tab-group { + height: 100%; } -.setTitle { - display: flex; - flex-direction: row; - justify-self: start; - padding-bottom: 10px; - color: #000; - margin: calc(var(--ion-padding, 9px) / 3); +.tab-content { + padding: 16px; + margin-bottom: 128px; } -.img-thumbnail { - --size: calc(90vw / 3); +div.mat-title { + margin-top: 16px; } -.select-thumbnail { - --size: 90vw; - height: 60vw; +.square-image-tile { + border-radius: 4px; + background-position: center center; + background-size: cover; } -.date-card-title { - text-align: start; - color: #000; - margin-left: 5vw; - padding-bottom: 10px; - padding-top: 10px; +app-post-capture-card { + width: 100%; + margin: 8px auto; } -.select-card { - width: 90vw; - margin-bottom: 0; - margin-top: 0; +button[mat-fab] { + z-index: 999; + position: fixed; + bottom: 16px; + right: 16px; } diff --git a/src/app/pages/storage/storage.page.spec.ts b/src/app/pages/storage/storage.page.spec.ts index 7775c3a56..7e8685a1a 100644 --- a/src/app/pages/storage/storage.page.spec.ts +++ b/src/app/pages/storage/storage.page.spec.ts @@ -1,6 +1,15 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatGridListModule } from '@angular/material/grid-list'; +import { MatIconModule } from '@angular/material/icon'; +import { MatListModule } from '@angular/material/list'; +import { MatSidenavModule } from '@angular/material/sidenav'; +import { MatTabsModule } from '@angular/material/tabs'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { IonicModule } from '@ionic/angular'; import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec'; import { StoragePage } from './storage.page'; @@ -11,7 +20,19 @@ describe('StoragePage', () => { beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [StoragePage], - imports: [IonicModule.forRoot(), RouterTestingModule, getTranslocoModule()] + imports: [ + RouterTestingModule, + getTranslocoModule(), + HttpClientTestingModule, + BrowserAnimationsModule, + MatToolbarModule, + MatIconModule, + MatButtonModule, + MatTabsModule, + MatGridListModule, + MatCardModule, + MatSidenavModule, + MatListModule] }).compileComponents(); fixture = TestBed.createComponent(StoragePage); diff --git a/src/app/pages/storage/storage.page.ts b/src/app/pages/storage/storage.page.ts index bfe1da08d..717a70073 100644 --- a/src/app/pages/storage/storage.page.ts +++ b/src/app/pages/storage/storage.page.ts @@ -1,19 +1,19 @@ import { formatDate } from '@angular/common'; -import { Component, ViewChildren } from '@angular/core'; - +import { Component } from '@angular/core'; +import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { of, zip } from 'rxjs'; import { concatMap, map } from 'rxjs/operators'; import { CameraService } from 'src/app/services/camera/camera.service'; import { CollectorService } from 'src/app/services/collector/collector.service'; import { Proof } from 'src/app/services/data/proof/proof'; import { - ProofRepository, + ProofRepository } from 'src/app/services/data/proof/proof-repository.service'; +import { NumbersStorageApi } from 'src/app/services/publisher/numbers-storage/numbers-storage-api.service'; import { fromExtension } from 'src/app/utils/mime-type'; import { forkJoinWithDefault } from 'src/app/utils/rx-operators'; -import { IonSlides } from '@ionic/angular'; -import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; + @UntilDestroy({ checkProperties: true }) @Component({ @@ -25,30 +25,20 @@ export class StoragePage { private readonly proofs$ = this.proofRepository.getAll$(); - + // TODO: rename for better readability. readonly proofsWithRaw$ = this.proofs$.pipe( concatMap(proofs => forkJoinWithDefault(proofs.map(proof => this.proofRepository.getThumbnail$(proof)))), concatMap(base64Strings => zip(this.proofs$, of(base64Strings))), map(([proofs, base64Strings]) => proofs.map((proof, index) => ({ proof, rawBase64: base64Strings[index], - date: this.getDate(proof.timestamp) + date: formatDate(proof.timestamp, 'mediumDate', 'en-US') }))), map(proofsWithRaw => proofsWithRaw.sort((proofWithRawBase64A, proofWithRawBase64B) => proofWithRawBase64B.proof.timestamp - proofWithRawBase64A.proof.timestamp)), ); - index = 0; - @ViewChildren('slides') slides: IonSlides | undefined; - buttonName = 'Next'; - selectedSlide: any; - - slideOpts = { - loop: false, - autoplay: false - }; - - + // TODO: rename for better readability. readonly proofsWithRawByDate$ = this.proofsWithRaw$.pipe( map(proofsWithRawBase64 => proofsWithRawBase64 @@ -69,18 +59,15 @@ export class StoragePage { ) ); + readonly userName$ = this.numbersStorageApi.getUserName$(); constructor( private readonly proofRepository: ProofRepository, private readonly cameraService: CameraService, - private readonly collectorService: CollectorService + private readonly collectorService: CollectorService, + private readonly numbersStorageApi: NumbersStorageApi ) { } - getDate(timestamp: number) { - return formatDate(timestamp, 'mediumDate', 'en-US'); - - } - capture() { this.cameraService.capture$().pipe( map(cameraPhoto => this.collectorService.storeAndCollect( @@ -90,20 +77,4 @@ export class StoragePage { untilDestroyed(this) ).subscribe(); } - - - ionSlideLoad(slide: any) { - this.selectedSlide = slide; - } - - ionSlideChange(slide: any) { - this.selectedSlide = slide; - } - - next() { - this.selectedSlide.slideNext(); - } - back() { - this.selectedSlide.slidePrev(); - } } diff --git a/src/assets/appicon/Add Task.svg b/src/assets/appicon/Add Task.svg deleted file mode 100644 index 163028dfb..000000000 --- a/src/assets/appicon/Add Task.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - Add Task - Created with Sketch. - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/Avatar.svg b/src/assets/appicon/Avatar.svg deleted file mode 100644 index 06197e766..000000000 --- a/src/assets/appicon/Avatar.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - Avatar - Created with Sketch. - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/Close.svg b/src/assets/appicon/Close.svg deleted file mode 100644 index 5fa5d2777..000000000 --- a/src/assets/appicon/Close.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - Close - Created with Sketch. - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/More.svg b/src/assets/appicon/More.svg deleted file mode 100644 index 2c99be1df..000000000 --- a/src/assets/appicon/More.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - More - Created with Sketch. - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/Search.svg b/src/assets/appicon/Search.svg deleted file mode 100644 index d4605b721..000000000 --- a/src/assets/appicon/Search.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - Search - Created with Sketch. - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/Settings.svg b/src/assets/appicon/Settings.svg deleted file mode 100644 index 045a4f850..000000000 --- a/src/assets/appicon/Settings.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - Settings - Created with Sketch. - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/Share.svg b/src/assets/appicon/Share.svg deleted file mode 100644 index 501282405..000000000 --- a/src/assets/appicon/Share.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - Share - Created with Sketch. - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/android.svg b/src/assets/appicon/android.svg deleted file mode 100644 index 68175443c..000000000 --- a/src/assets/appicon/android.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - android - Created with Sketch. - - - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/around.svg b/src/assets/appicon/around.svg deleted file mode 100644 index 366872e58..000000000 --- a/src/assets/appicon/around.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - around - Created with Sketch. - - - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/bin.svg b/src/assets/appicon/bin.svg deleted file mode 100644 index 69e750ce6..000000000 --- a/src/assets/appicon/bin.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - bin - Created with Sketch. - - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/camera.svg b/src/assets/appicon/camera.svg deleted file mode 100644 index cf379fc68..000000000 --- a/src/assets/appicon/camera.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - camera - Created with Sketch. - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/document.svg b/src/assets/appicon/document.svg deleted file mode 100644 index efa8c13b9..000000000 --- a/src/assets/appicon/document.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - document - Created with Sketch. - - - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/info.svg b/src/assets/appicon/info.svg deleted file mode 100644 index b276753bc..000000000 --- a/src/assets/appicon/info.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - info - Created with Sketch. - - - - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/pen.svg b/src/assets/appicon/pen.svg deleted file mode 100644 index f64364000..000000000 --- a/src/assets/appicon/pen.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - pen - Created with Sketch. - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/phone.svg b/src/assets/appicon/phone.svg deleted file mode 100644 index 316e9d55d..000000000 --- a/src/assets/appicon/phone.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - phone - Created with Sketch. - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/photo.svg b/src/assets/appicon/photo.svg deleted file mode 100644 index b372d2a42..000000000 --- a/src/assets/appicon/photo.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - photo - Created with Sketch. - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/picture.svg b/src/assets/appicon/picture.svg deleted file mode 100644 index 8129fda6e..000000000 --- a/src/assets/appicon/picture.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - picture - Created with Sketch. - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/pin.svg b/src/assets/appicon/pin.svg deleted file mode 100644 index 569ec933d..000000000 --- a/src/assets/appicon/pin.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - pin - Created with Sketch. - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/time.svg b/src/assets/appicon/time.svg deleted file mode 100644 index 8f21200a7..000000000 --- a/src/assets/appicon/time.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - time - Created with Sketch. - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/upload (1).svg b/src/assets/appicon/upload (1).svg deleted file mode 100644 index fdc5c2c8a..000000000 --- a/src/assets/appicon/upload (1).svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - upload (1) - Created with Sketch. - - - - - - - - - \ No newline at end of file diff --git a/src/assets/appicon/video-camera.svg b/src/assets/appicon/video-camera.svg deleted file mode 100644 index 0ad8c7e7c..000000000 --- a/src/assets/appicon/video-camera.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - video-camera - Created with Sketch. - - - - - - - - \ No newline at end of file diff --git a/src/assets/i18n/en-us.json b/src/assets/i18n/en-us.json index 2532c05bc..3804b561f 100644 --- a/src/assets/i18n/en-us.json +++ b/src/assets/i18n/en-us.json @@ -1,6 +1,8 @@ { "capture": "Capture", + "profile": "Profile", "settings": "Settings", + "privacy": "Privacy", "proofDetails": "Proof Details", "informationDetails": "Information Details", "caption": "Caption", @@ -32,7 +34,6 @@ "privateKey": "Private Key", "general": "General", "languages": "Languages", - "defaultSignature": "Default Siganture", "areYouSure": "Are You Sure", "cancel": "Cancel", "ok": "Ok", @@ -46,7 +47,6 @@ "signingProof": "Signing Proof", "about": "About", "version": "Version", - "defaultInformationProvider": "Default Information Provider", "informationProvider": "Information Provider", "collectDeviceInfo": "Collect Device Info", "collectLocationInfo": "Collect Location Info", @@ -74,6 +74,8 @@ "tags": "Tags", "all": "All", "viewAll": "View All", + "address": "Address", + "mediaId": "Media ID", "message": { "areYouSure": "This action cannot be undone.", "verificationEmailSent": "A verification email has been sent to your email address.", @@ -90,6 +92,7 @@ "proofPublished": "Proof {{hash}} has been published to {{publisherName}}.", "forbiddenAllNumeric": "Cannot contain only numbers.", "isNotEmail": "Does not follow email format.", - "pleaseWait": "Please wait..." + "pleaseWait": "Please wait...", + "copiedToClipboard": "Has copied to clipboard." } } \ No newline at end of file diff --git a/src/assets/i18n/zh-tw.json b/src/assets/i18n/zh-tw.json index df7493f39..bff5b3a2e 100644 --- a/src/assets/i18n/zh-tw.json +++ b/src/assets/i18n/zh-tw.json @@ -1,6 +1,8 @@ { "capture": "Capture", + "profile": "個人資料", "settings": "設定", + "privacy": "隱私", "proofDetails": "證明細節", "informationDetails": "詳細資訊", "caption": "標題", @@ -32,7 +34,6 @@ "privateKey": "私密金鑰", "general": "一般", "languages": "語言", - "defaultSignature": "預設簽章", "areYouSure": "是否確定", "cancel": "取消", "ok": "確認", @@ -46,7 +47,6 @@ "signingProof": "簽章證明", "about": "關於", "version": "版本", - "defaultInformationProvider": "預設資訊提供者", "informationProvider": "資訊提供者", "collectDeviceInfo": "收集設備資訊", "collectLocationInfo": "收集位置資訊", @@ -74,6 +74,8 @@ "tags": "標籤", "all": "所有", "viewAll": "檢視全部", + "address": "地址", + "mediaId": "媒體 ID", "message": { "areYouSure": "此操作不可撤銷。", "verificationEmailSent": "驗證電子郵件已發送到您的電子郵件地址。", @@ -90,6 +92,7 @@ "proofPublished": "證明{{hash}}已發佈到{{publisherName}}。", "forbiddenAllNumeric": "密碼不能只有數字。", "isNotEmail": "電子郵件格式不符。", - "pleaseWait": "請稍候..." + "pleaseWait": "請稍候...", + "copiedToClipboard": "已複製至剪貼簿。" } } \ No newline at end of file diff --git a/src/assets/icon/media-id.svg b/src/assets/icon/media-id.svg new file mode 100644 index 000000000..e6a3d0655 --- /dev/null +++ b/src/assets/icon/media-id.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/global.scss b/src/global.scss index b84576ed6..5a081185e 100644 --- a/src/global.scss +++ b/src/global.scss @@ -19,8 +19,17 @@ @import "~@ionic/angular/css/display.css"; /* Optional CSS utils that can be commented out */ -@import "~@ionic/angular/css/padding.css"; -@import "~@ionic/angular/css/float-elements.css"; -@import "~@ionic/angular/css/text-alignment.css"; -@import "~@ionic/angular/css/text-transformation.css"; -@import "~@ionic/angular/css/flex-utils.css"; +// @import "~@ionic/angular/css/padding.css"; +// @import "~@ionic/angular/css/float-elements.css"; +// @import "~@ionic/angular/css/text-alignment.css"; +// @import "~@ionic/angular/css/text-transformation.css"; +// @import "~@ionic/angular/css/flex-utils.css"; + +.ion-page { + display: initial !important; + background-color: white; +} + +.page-content { + padding: 8px 16px; +} diff --git a/src/index.html b/src/index.html index af58b2635..5be107f99 100644 --- a/src/index.html +++ b/src/index.html @@ -3,11 +3,11 @@ - Ionic App + Capture Lite - + @@ -18,6 +18,8 @@ + + diff --git a/src/theme/variables.scss b/src/theme/variables.scss index 9d3a9aef8..84e9bf65b 100644 --- a/src/theme/variables.scss +++ b/src/theme/variables.scss @@ -1,3 +1,39 @@ +// Custom Theming for Angular Material +// For more information: https://material.angular.io/guide/theming +@import "~@angular/material/theming"; +// Plus imports for other components in your app. + +// Include the common styles for Angular Material. We include this here so that you only +// have to load a single css file for Angular Material in your app. +// Be sure that you only ever include this mixin once! +@include mat-core(); + +// Define the palettes for your theme using the Material Design palettes available in palette.scss +// (imported above). For each palette, you can optionally specify a default, lighter, and darker +// hue. Available color palettes: https://material.io/design/color/ +$app-primary: mat-palette($mat-indigo); +$app-accent: mat-palette($mat-teal, A200, A100, A400); + +// The warn palette is optional (defaults to red). +$app-warn: mat-palette($mat-red); + +// Create the theme object. A theme consists of configurations for individual +// theming systems such as "color" or "typography". +$app-theme: mat-light-theme( + ( + color: ( + primary: $app-primary, + accent: $app-accent, + warn: $app-warn, + ), + ) +); + +// Include theme styles for core and each component used in your app. +// Alternatively, you can import and @include the theme mixins for each component +// that you are using. +@include angular-material-theme($app-theme); + // Ionic Variables and Theming. For more info, please see: // http://ionicframework.com/docs/theming/ @@ -225,3 +261,12 @@ --ion-tab-bar-background: #1f1f1f; } } + +html, +body { + height: 100%; +} +body { + margin: 0; + font-family: Roboto, "Helvetica Neue", sans-serif; +}