Skip to content

Commit

Permalink
Merge branch 'pwa_integration'
Browse files Browse the repository at this point in the history
  • Loading branch information
pagarevijayy committed Mar 25, 2021
2 parents 71b8c3b + c3bf39a commit ede4985
Show file tree
Hide file tree
Showing 18 changed files with 130 additions and 16 deletions.
10 changes: 7 additions & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"tsConfig": "tsconfig.app.json",
"aot": true,
"assets": [
"src/assets"
"src/assets",
"src/manifest.webmanifest"
],
"styles": [
"src/styles.scss",
Expand Down Expand Up @@ -62,7 +63,9 @@
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
],
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
}
}
},
Expand Down Expand Up @@ -92,7 +95,8 @@
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/assets"
"src/assets",
"src/manifest.webmanifest"
],
"styles": [
"src/styles.scss",
Expand Down
30 changes: 30 additions & 0 deletions ngsw-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "./node_modules/@angular/service-worker/config/schema.json",
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/manifest.webmanifest",
"/*.css",
"/*.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**",
"/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
]
}
}
]
}
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@angular/platform-browser": "~10.1.1",
"@angular/platform-browser-dynamic": "~10.1.1",
"@angular/router": "~10.1.1",
"@angular/service-worker": "~10.1.1",
"apollo-angular": "^2.4.0",
"bootstrap": "^4.5.3",
"jquery": "^3.5.1",
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<router-outlet></router-outlet>
<footer class="secondary-text text-center fs-12 my-4">
<div class="store-credits"> {{footerText}} </div>
<div class="powered-by pt-2"> <small style="font-size: 8px;">Powered by</small> Eragap Tech Company</div>
<div class="powered-by pt-2 cursor-pointer" (click)="poweredByEragapTech()"> <small style="font-size: 8px;">Powered by</small> Eragap Tech Company</div>
</footer>
</app-main-nav>
4 changes: 4 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,8 @@ export class AppComponent implements OnInit {
const faviconURL = browserData?.storeInformation?.faviconURL;
this.favIcon.href = faviconURL;
}

poweredByEragapTech(){
window.open(`https://eragap.co.in`, "_blank");
}
}
5 changes: 4 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import { ProductDetailsComponent } from './components/product-details/product-de
import { ProductCardComponent } from './components/utils/product-card/product-card.component';
import { InterceptorService } from './services';
import { GraphQLModule } from './graphql.module';
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment';

@NgModule({
declarations: [
Expand All @@ -53,7 +55,8 @@ import { GraphQLModule } from './graphql.module';
MatSelectModule,
MatCardModule,
MatProgressSpinnerModule,
GraphQLModule
GraphQLModule,
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production })
],
providers: [
{
Expand Down
12 changes: 6 additions & 6 deletions src/app/components/homepage/homepage.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ <h5 class="py-3 fs-18">{{item?.displayTitle}}</h5>
<div [ngClass]="{'pt-4': (isHandset$ | async)}">
<h5 class="fs-18" *ngIf="!(isHandset$ | async)"> follow us:</h5>
<div class="pt-1">
<span class="px-2">
<i class="fa fa-facebook cursor-pointer" aria-hidden="true"></i>
<span class="px-2" *ngIf="!!storeFacebookURL">
<i class="fa fa-facebook cursor-pointer" (click)="socialMediaCTA('facebook')" aria-hidden="true"></i>
</span>
<span class="px-2">
<i class="fa fa-instagram cursor-pointer" aria-hidden="true"></i>
<span class="px-2" *ngIf="!!storeInstagramURL">
<i class="fa fa-instagram cursor-pointer" (click)="socialMediaCTA('instagram')" aria-hidden="true"></i>
</span>
<span class="px-2">
<i class="fa fa-twitter cursor-pointer" aria-hidden="true"></i>
<span class="px-2" *ngIf="!!storeTwitterURL">
<i class="fa fa-twitter cursor-pointer" (click)="socialMediaCTA('twitter')" aria-hidden="true"></i>
</span>
</div>
<aside class="py-3">
Expand Down
22 changes: 22 additions & 0 deletions src/app/components/homepage/homepage.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export class HomepageComponent implements OnInit {
storeAddressLineOne = browserData?.storeInformation?.addressLineOne;
storeAddressLineTwo = browserData?.storeInformation?.addressLineTwo;
storeGoogleMapLocationURL = browserData?.storeInformation?.googleMapsLocationURL;
storeFacebookURL = browserData?.storeInformation?.socialFacebook;
storeInstagramURL = browserData?.storeInformation?.socialInstagram;
storeTwitterURL = browserData?.storeInformation?.socialTwitter;


constructor(
private _utilService: UtilsService,
Expand Down Expand Up @@ -71,6 +75,24 @@ export class HomepageComponent implements OnInit {
window.open(`tel:${this.storeContactNumber}`, "_blank");
}

socialMediaCTA(platform: string) {
switch (platform) {
case 'facebook':
window.open(`${this.storeFacebookURL}`, "_blank");
break;

case 'instagram':
window.open(`${this.storeInstagramURL}`, "_blank");
break;
case 'twitter':
window.open(`${this.storeTwitterURL}`, "_blank");
break;

default:
break;
}
}

}


Expand Down
2 changes: 1 addition & 1 deletion src/app/components/main-nav/main-nav.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
<div class="copyright-text pt-2">
<span class="d-block secondary-text fs-12">{{copyrightText}}</span>
<span class="d-block secondary-text fs-12 pt-2"> <small style="font-size: 8px;">Powered by</small> Eragap Tech Company</span>
<span class="d-block secondary-text fs-12 pt-2 cursor-pointer" (click)="poweredByEragapTech()"> <small style="font-size: 8px;">Powered by</small> Eragap Tech Company</span>
</div>
</mat-sidenav>
<mat-sidenav-content>
Expand Down
4 changes: 4 additions & 0 deletions src/app/components/main-nav/main-nav.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ export class MainNavComponent implements OnInit {
this._stateManagementService.updateItemCategoryClicked(categoryInformation, 'lastItemCategoryClicked');
}

poweredByEragapTech(){
window.open(`https://eragap.co.in`, "_blank");
}

}
6 changes: 3 additions & 3 deletions src/assets/data/inbrowser-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export class browserData {
emailAddress: "[email protected]",
addressLineOne: "Sector 1, Shantinagar",
addressLineTwo: "Miraroad (E), Thane 401107",
socialFacebook: "urlhere",
socialInstagram: null,
socialTwitter: null,
socialFacebook: "https://eragap.co.in/",
socialInstagram: "https://eragap.co.in/",
socialTwitter: 'https://eragap.co.in/',
};

static footerContent = {
Expand Down
Binary file added src/assets/icons/icon-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/icons/icon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500&family=Poppins:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500&amp;family=Poppins:wght@300;400;500&amp;display=swap" rel="stylesheet">
<link rel="manifest" href="manifest.webmanifest">
<meta name="theme-color" content="#ffebcd">
</head>

<body>
<app-root></app-root>

<!-- to lazyload images -->
<!-- <script src="lazysizes.min.js" async=""></script> -->
<noscript>Please enable JavaScript to continue using this application.</noscript>
</body>

</html>
35 changes: 35 additions & 0 deletions src/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "Eragap Tech Company",
"short_name": "Eragap Tech",
"theme_color": "#ffebcd",
"background_color": "#fafafa",
"display": "standalone",
"scope": "./",
"start_url": "./",
"icons": [
{
"src": "assets/icons/icon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable any"
},
{
"src": "assets/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable any"
}
]
}

0 comments on commit ede4985

Please sign in to comment.