diff --git a/package.json b/package.json index e48ea43..8043b16 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "firebase": "^5.1.0", "firebase-tools": "^3.19.0", "hammerjs": "^2.0.8", + "ng-simple-slideshow": "^1.2.3", "ngx-electron": "^1.0.4", "rxjs": "^6.0.0", "webstorage-decorators": "^1.0.3", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index dd9f89f..cb3e736 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -29,6 +29,7 @@ import {NewComponentComponent} from './formulaManager/newComponent/newComponent. import {HttpModule} from '@angular/http'; import {NewFormulaComponent} from './formulaManager/newFormula/newFormula.component'; import {AppStore} from './app.store'; +import {SlideshowModule} from 'ng-simple-slideshow'; @NgModule({ declarations: [ @@ -71,7 +72,8 @@ import {AppStore} from './app.store'; {path: 'store', component: CategoriesComponent}, {path: '**', component: HomeComponent} ]), - ServiceWorkerModule.register('/ngsw-worker.js', {enabled: environment.production}) + ServiceWorkerModule.register('/ngsw-worker.js', {enabled: environment.production}), + SlideshowModule ], providers: [AppStore], entryComponents: [ diff --git a/src/app/app.store.ts b/src/app/app.store.ts index e29550a..090323e 100644 --- a/src/app/app.store.ts +++ b/src/app/app.store.ts @@ -73,6 +73,7 @@ export class AppStore { map(rows => rows.map((row: any) => { let temp = Object.assign({id: row.payload.doc.id, ref: row.payload.doc.ref}, row.payload.doc.data()); + temp.originalImage = temp.image; temp.image = this.domSanitizer.bypassSecurityTrustUrl(temp.image); temp.originalDescription = temp.description; temp.description = this.domSanitizer.bypassSecurityTrustHtml( diff --git a/src/app/store/product.ts b/src/app/store/product.ts index 301aa88..7670be6 100644 --- a/src/app/store/product.ts +++ b/src/app/store/product.ts @@ -5,10 +5,12 @@ export interface Product { category: string; currency: 'CAD' | 'USD'; description: SafeHtml; - files: {link: string; type: string}[]; + files: {name: string; link: string; type: string}[]; id: string; image: SafeUrl; name: string; + originalDescription: string; + originalImage: string; price: number; ref: DocumentReference; weight: number; diff --git a/src/app/store/products/products.component.html b/src/app/store/products/products.component.html index 9fcc3c6..edef859 100644 --- a/src/app/store/products/products.component.html +++ b/src/app/store/products/products.component.html @@ -2,12 +2,43 @@