Skip to content

Commit 27d67d0

Browse files
authored
added discover and qr page nav (#89)
* added discover and qr page nav * added test imports
1 parent 2017c90 commit 27d67d0

9 files changed

Lines changed: 69 additions & 3 deletions

File tree

src/app/app-routing.module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ const routes: Routes = [
143143
loadChildren: () => import('./pages/manage-uploads/manage-uploads.module').then(m => m.ManageUploadsPageModule),
144144
canActivate: [AuthGuard]
145145
},
146+
{
147+
path: 'discover',
148+
loadChildren: () => import('./pages/discover/discover-routing.module').then(m => m.DiscoverPageRoutingModule),
149+
canActivate: [AuthGuard]
150+
},
146151
];
147152

148153
@NgModule({

src/app/home/home.page.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
<ion-buttons slot="start">
44
<ion-icon size="large" name="qr-code-outline" href="javascript:void(0);" (click)="goToQrPage()"></ion-icon>
55
</ion-buttons>
6+
<ion-buttons slot="end">
7+
<ion-icon size="large" name="images-outline" href="javascript:void(0);" (click)="goToDiscoverPage()"></ion-icon>
8+
</ion-buttons>
69
<ion-buttons [appFeatureFlag]="'statusPage'" slot="start">
710
<ion-icon size="large" name="navigate-circle" (click)="goToStatusPage()"></ion-icon>
811
</ion-buttons>

src/app/home/home.page.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ export class HomePage implements OnInit, OnDestroy {
166166
this.navCtrl.navigateForward('map');
167167
}
168168

169+
goToDiscoverPage() {
170+
this.navCtrl.navigateForward('discover');
171+
}
172+
169173
async goToQrPage() {
170174
const user = await this.authService.user();
171175
this.navCtrl.navigateForward('qr', {

src/app/pages/discover/discover.page.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<ion-header translucent="true">
22
<ion-toolbar>
3-
<ion-title>Discover</ion-title>
3+
<ion-buttons slot="start">
4+
<ion-back-button defaultHref="/"></ion-back-button>
5+
</ion-buttons>
6+
<ion-title>Photos</ion-title>
47
<ion-progress-bar *ngIf="loading" type="indeterminate"></ion-progress-bar>
58
</ion-toolbar>
69
</ion-header>

src/app/pages/events/events.page.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<ion-header translucent="true">
22
<ion-toolbar>
3+
<ion-buttons slot="start">
4+
<ion-icon size="large" name="qr-code-outline" href="javascript:void(0);" (click)="goToQrPage()"></ion-icon>
5+
</ion-buttons>
6+
<ion-buttons slot="end">
7+
<ion-icon size="large" name="images-outline" href="javascript:void(0);" (click)="goToDiscoverPage()"></ion-icon>
8+
</ion-buttons>
39
<ion-title>Events</ion-title>
410
<ion-progress-bar *ngIf="loading || userEventsQueryResult?.loading" type="indeterminate"></ion-progress-bar>
511
</ion-toolbar>

src/app/pages/events/events.page.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { IonicModule } from '@ionic/angular';
33
import { ApolloTestingModule } from 'apollo-angular/testing';
44
import { UserEventsGQL } from 'src/graphql/graphql';
55
import { EventsPage } from './events.page';
6+
import { IonicStorageModule } from '@ionic/storage-angular';
7+
import { LoggerModule } from 'ngx-logger';
8+
import { environment } from 'src/environments/environment';
69

710
describe('EventsPage', () => {
811
let component: EventsPage;
@@ -19,6 +22,8 @@ describe('EventsPage', () => {
1922
imports: [
2023
IonicModule.forRoot(),
2124
ApolloTestingModule,
25+
IonicStorageModule.forRoot(),
26+
LoggerModule.forRoot(environment.logging),
2227
],
2328
providers: [
2429
{ provide: UserEventsGQL, useValue: userEventsGQLSpy },

src/app/pages/events/events.page.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ApolloQueryResult } from '@apollo/client/core';
33
import { NavController } from '@ionic/angular';
44
import { QueryRef } from 'apollo-angular';
55
import { Subscription } from 'rxjs';
6+
import { AuthService } from 'src/app/services/auth/auth.service';
67
import { JoinUserEvent, UserEventsGQL, UserEventsQuery } from 'src/graphql/graphql';
78

89
@Component({
@@ -26,6 +27,7 @@ export class EventsPage implements OnInit, OnDestroy {
2627
constructor(
2728
public navCtrl: NavController,
2829
private readonly userEvents: UserEventsGQL,
30+
private readonly authService: AuthService,
2931
) { }
3032

3133
ngOnInit() {
@@ -69,6 +71,22 @@ export class EventsPage implements OnInit, OnDestroy {
6971
this.navCtrl.navigateForward('create-event');
7072
}
7173

74+
goToDiscoverPage() {
75+
this.navCtrl.navigateForward('discover');
76+
}
77+
78+
async goToQrPage() {
79+
const user = await this.authService.user();
80+
this.navCtrl.navigateForward('qr', {
81+
state: {
82+
data: user?.shareableId,
83+
title: user?.firstName && user?.lastName ? `${user?.firstName} ${user?.lastName}` : undefined,
84+
subtitle: 'Scan to invite me',
85+
image: user?.image,
86+
}
87+
});
88+
}
89+
7290
trackByEvent(index: any, joinUserEvent: JoinUserEvent) {
7391
return joinUserEvent.eventId;
7492
}

src/app/pages/people/people.page.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<ion-header translucent="true">
22
<ion-toolbar>
3-
<ion-buttons slot="start">
4-
</ion-buttons>
3+
<ion-buttons slot="start">
4+
<ion-icon size="large" name="qr-code-outline" href="javascript:void(0);" (click)="goToQrPage()"></ion-icon>
5+
</ion-buttons>
6+
<ion-buttons slot="end">
7+
<ion-icon size="large" name="images-outline" href="javascript:void(0);" (click)="goToDiscoverPage()"></ion-icon>
8+
</ion-buttons>
59
<ion-title>People</ion-title>
610
<ion-progress-bar *ngIf="loading" type="indeterminate"></ion-progress-bar>
711
</ion-toolbar>

src/app/pages/people/people.page.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { QueryRef } from 'apollo-angular';
55
import { NGXLogger } from 'ngx-logger';
66
import { Subscription } from 'rxjs';
77
import { AlertService } from 'src/app/services/alert/alert.service';
8+
import { AuthService } from 'src/app/services/auth/auth.service';
89
import { CommunicationService } from 'src/app/services/communication.service';
910
import { ErrorService } from 'src/app/services/error.service';
1011
import { HubService } from 'src/app/services/hub/hub.service';
@@ -38,6 +39,7 @@ export class PeoplePage implements OnInit, OnDestroy {
3839
private readonly communcationService: CommunicationService,
3940
private readonly usersPeopleGQLService: UsersPeopleGQL,
4041
private readonly errorService: ErrorService,
42+
private readonly authService: AuthService,
4143
) { }
4244

4345
ngOnInit() {
@@ -113,6 +115,22 @@ export class PeoplePage implements OnInit, OnDestroy {
113115
});
114116
}
115117

118+
goToDiscoverPage() {
119+
this.navCtrl.navigateForward('discover');
120+
}
121+
122+
async goToQrPage() {
123+
const user = await this.authService.user();
124+
this.navCtrl.navigateForward('qr', {
125+
state: {
126+
data: user?.shareableId,
127+
title: user?.firstName && user?.lastName ? `${user?.firstName} ${user?.lastName}` : undefined,
128+
subtitle: 'Scan to invite me',
129+
image: user?.image,
130+
}
131+
});
132+
}
133+
116134
async filterPeople(ev: any) {
117135
this.filter = ev?.target?.value;
118136
if (this.filter && this.filter?.trim() !== '') {

0 commit comments

Comments
 (0)