Skip to content

Commit 96ad3b5

Browse files
committed
feat(features/home): use GitBook for FAQ
Replace the iframe FAQ with the GitBook FAQ.
1 parent b4ea40e commit 96ad3b5

16 files changed

+30
-229
lines changed

src/app/app-routing.module.ts

-5
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ const routes: Routes = [
9696
m => m.TermsOfUsePageModule
9797
),
9898
},
99-
{
100-
path: 'faq',
101-
loadChildren: () =>
102-
import('./features/faq/faq.module').then(m => m.FaqPageModule),
103-
},
10499
];
105100
@NgModule({
106101
imports: [

src/app/features/faq/faq-routing.module.ts

-17
This file was deleted.

src/app/features/faq/faq.module.ts

-12
This file was deleted.

src/app/features/faq/faq.page.html

-17
This file was deleted.

src/app/features/faq/faq.page.scss

-31
This file was deleted.

src/app/features/faq/faq.page.spec.ts

-26
This file was deleted.

src/app/features/faq/faq.page.ts

-49
This file was deleted.

src/app/features/home/capture-tab/capture-tab.component.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { HttpErrorResponse } from '@angular/common/http';
33
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
44
import { MatDialog } from '@angular/material/dialog';
55
import { Router } from '@angular/router';
6+
import { Browser } from '@capacitor/browser';
67
import {
78
ActionSheetButton,
89
ActionSheetController,
@@ -40,7 +41,9 @@ import { PreferenceManager } from '../../../shared/preference-manager/preference
4041
import { getOldProof } from '../../../shared/repositories/proof/old-proof-adapter';
4142
import { Proof } from '../../../shared/repositories/proof/proof';
4243
import { ProofRepository } from '../../../shared/repositories/proof/proof-repository.service';
44+
import { browserToolbarColor } from '../../../utils/constants';
4345
import { reloadApp } from '../../../utils/miscellaneous';
46+
import { getFaqUrl } from '../../../utils/url';
4447
import { PrefetchingDialogComponent } from '../onboarding/prefetching-dialog/prefetching-dialog.component';
4548

4649
@UntilDestroy({ checkProperties: true })
@@ -213,7 +216,7 @@ export class CaptureTabComponent implements OnInit {
213216
},
214217
{
215218
text: this.translocoService.translate('faq'),
216-
handler: () => this.router.navigate(['faq']),
219+
handler: async () => await this.openFaq(),
217220
},
218221
{
219222
text: this.translocoService.translate('logout'),
@@ -248,6 +251,10 @@ export class CaptureTabComponent implements OnInit {
248251
.subscribe();
249252
}
250253

254+
async openFaq() {
255+
await Browser.open({ url: getFaqUrl(), toolbarColor: browserToolbarColor });
256+
}
257+
251258
async editUsername() {
252259
const alert = await this.alertController.create({
253260
header: this.translocoService.translate('editUsername'),

src/app/features/home/details/actions/action-details/action-details.page.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import { DiaBackendWalletService } from '../../../../../shared/dia-backend/walle
3636
import { ErrorService } from '../../../../../shared/error/error.service';
3737
import { OrderDetailDialogComponent } from '../../../../../shared/order-detail-dialog/order-detail-dialog.component';
3838
import { ProofRepository } from '../../../../../shared/repositories/proof/proof-repository.service';
39+
import { browserToolbarColor } from '../../../../../utils/constants';
3940
import {
4041
VOID$,
4142
isNonNullable,
@@ -365,7 +366,7 @@ export class ActionDetailsPage {
365366
tap(cid =>
366367
Browser.open({
367368
url: `${url}?cid=${cid}&order_id=${orderId}`,
368-
toolbarColor: '#564dfc',
369+
toolbarColor: browserToolbarColor,
369370
})
370371
),
371372
catchError((err: unknown) => {

src/app/features/home/details/actions/actions.page.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { DiaBackendWalletService } from '../../../../shared/dia-backend/wallet/d
2424
import { ErrorService } from '../../../../shared/error/error.service';
2525
import { OrderDetailDialogComponent } from '../../../../shared/order-detail-dialog/order-detail-dialog.component';
2626
import { ProofRepository } from '../../../../shared/repositories/proof/proof-repository.service';
27+
import { browserToolbarColor } from '../../../../utils/constants';
2728
import {
2829
VOID$,
2930
isNonNullable,
@@ -208,7 +209,7 @@ export class ActionsPage {
208209
tap(cid =>
209210
Browser.open({
210211
url: `${url}?cid=${cid}&order_id=${orderId}`,
211-
toolbarColor: '#564dfc',
212+
toolbarColor: browserToolbarColor,
212213
})
213214
),
214215
catchError((err: unknown) => {

src/app/features/home/details/capture-details-with-ionic/capture-details-with-ionic.component.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
shareReplay,
1414
switchMap,
1515
} from 'rxjs/operators';
16+
import { browserToolbarColor } from '../../../../utils/constants';
1617
import { isNonNullable } from '../../../../utils/rx-operators/rx-operators';
1718
import { getAssetProfileForNSE } from '../../../../utils/url';
1819
import { DetailedCapture } from '../information/session/information-session.service';
@@ -83,7 +84,7 @@ export class CaptureDetailsWithIonicComponent {
8384
if (geolocation)
8485
return Browser.open({
8586
url: `https://maps.google.com/maps?q=${geolocation.latitude},${geolocation.longitude}`,
86-
toolbarColor: '#564dfc',
87+
toolbarColor: browserToolbarColor,
8788
});
8889
return EMPTY;
8990
})
@@ -104,7 +105,7 @@ export class CaptureDetailsWithIonicComponent {
104105
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
105106
detailedCapture.id!
106107
),
107-
toolbarColor: '#564dfc',
108+
toolbarColor: browserToolbarColor,
108109
})
109110
)
110111
),

src/app/features/home/details/details.page.ts

+3-48
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import { NetworkService } from '../../../shared/network/network.service';
5151
import { ProofRepository } from '../../../shared/repositories/proof/proof-repository.service';
5252
import { ShareService } from '../../../shared/share/share.service';
5353
import { UserGuideService } from '../../../shared/user-guide/user-guide.service';
54+
import { browserToolbarColor } from '../../../utils/constants';
5455
import { MimeType } from '../../../utils/mime-type';
5556
import {
5657
VOID$,
@@ -646,7 +647,7 @@ export class DetailsPage {
646647
await defer(() =>
647648
Browser.open({
648649
url: getAssetProfileForNSE(id),
649-
toolbarColor: '#564dfc',
650+
toolbarColor: browserToolbarColor,
650651
})
651652
)
652653
.pipe(untilDestroyed(this), takeUntil(this.shareMenuDismissed$))
@@ -785,29 +786,6 @@ export class DetailsPage {
785786
}
786787
}
787788

788-
private openIpfsSupportingVideo() {
789-
return this.activeDetailedCapture$
790-
.pipe(
791-
first(),
792-
switchMap(
793-
activeDetailedCapture => activeDetailedCapture.diaBackendAsset$
794-
),
795-
isNonNullable(),
796-
switchMap(diaBackendAsset => {
797-
if (!diaBackendAsset.supporting_file) return EMPTY;
798-
return Browser.open({
799-
url: diaBackendAsset.supporting_file.replace(
800-
'ipfs://',
801-
'https://ipfs-pin.numbersprotocol.io/ipfs/'
802-
),
803-
toolbarColor: '#564dfc',
804-
});
805-
}),
806-
untilDestroyed(this)
807-
)
808-
.subscribe();
809-
}
810-
811789
private share() {
812790
this.activeDetailedCapture$
813791
.pipe(
@@ -829,29 +807,6 @@ export class DetailsPage {
829807
.subscribe();
830808
}
831809

832-
private openCaptureClub() {
833-
combineLatest([
834-
this.activeDetailedCapture$.pipe(
835-
switchMap(
836-
activeDetailedCapture => activeDetailedCapture.diaBackendAsset$
837-
),
838-
isNonNullable()
839-
),
840-
this.diaBackendAuthService.token$,
841-
])
842-
.pipe(
843-
first(),
844-
concatMap(([diaBackendAsset, token]) =>
845-
Browser.open({
846-
url: `https://captureclub.cc/asset?mid=${diaBackendAsset.id}&token=${token}`,
847-
toolbarColor: '#564dfc',
848-
})
849-
),
850-
untilDestroyed(this)
851-
)
852-
.subscribe();
853-
}
854-
855810
private async remove() {
856811
const action$ = this.activeDetailedCapture$.pipe(
857812
first(),
@@ -892,7 +847,7 @@ export class DetailsPage {
892847
if (geolocation)
893848
return Browser.open({
894849
url: `https://maps.google.com/maps?q=${geolocation.latitude},${geolocation.longitude}`,
895-
toolbarColor: '#564dfc',
850+
toolbarColor: browserToolbarColor,
896851
});
897852
return EMPTY;
898853
})

src/app/features/home/home.page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</a>
4242
</mat-list-item>
4343
<mat-list-item>
44-
<a routerLink="/faq" (click)="sidenav.close()" mat-list-item>
44+
<a (click)="sidenav.close(); openFaq()" mat-list-item>
4545
{{ t('faq') }}
4646
</a>
4747
</mat-list-item>

0 commit comments

Comments
 (0)