Skip to content

Commit

Permalink
feat(features/home): use GitBook for FAQ
Browse files Browse the repository at this point in the history
Replace the iframe FAQ with the GitBook FAQ.
  • Loading branch information
olgahaha committed Jul 25, 2024
1 parent b4ea40e commit 96ad3b5
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 229 deletions.
5 changes: 0 additions & 5 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ const routes: Routes = [
m => m.TermsOfUsePageModule
),
},
{
path: 'faq',
loadChildren: () =>
import('./features/faq/faq.module').then(m => m.FaqPageModule),
},
];
@NgModule({
imports: [
Expand Down
17 changes: 0 additions & 17 deletions src/app/features/faq/faq-routing.module.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/app/features/faq/faq.module.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/features/faq/faq.page.html

This file was deleted.

31 changes: 0 additions & 31 deletions src/app/features/faq/faq.page.scss

This file was deleted.

26 changes: 0 additions & 26 deletions src/app/features/faq/faq.page.spec.ts

This file was deleted.

49 changes: 0 additions & 49 deletions src/app/features/faq/faq.page.ts

This file was deleted.

9 changes: 8 additions & 1 deletion src/app/features/home/capture-tab/capture-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { HttpErrorResponse } from '@angular/common/http';
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { Browser } from '@capacitor/browser';
import {
ActionSheetButton,
ActionSheetController,
Expand Down Expand Up @@ -40,7 +41,9 @@ import { PreferenceManager } from '../../../shared/preference-manager/preference
import { getOldProof } from '../../../shared/repositories/proof/old-proof-adapter';
import { Proof } from '../../../shared/repositories/proof/proof';
import { ProofRepository } from '../../../shared/repositories/proof/proof-repository.service';
import { browserToolbarColor } from '../../../utils/constants';
import { reloadApp } from '../../../utils/miscellaneous';
import { getFaqUrl } from '../../../utils/url';
import { PrefetchingDialogComponent } from '../onboarding/prefetching-dialog/prefetching-dialog.component';

@UntilDestroy({ checkProperties: true })
Expand Down Expand Up @@ -213,7 +216,7 @@ export class CaptureTabComponent implements OnInit {
},
{
text: this.translocoService.translate('faq'),
handler: () => this.router.navigate(['faq']),
handler: async () => await this.openFaq(),
},
{
text: this.translocoService.translate('logout'),
Expand Down Expand Up @@ -248,6 +251,10 @@ export class CaptureTabComponent implements OnInit {
.subscribe();
}

async openFaq() {

Check failure on line 254 in src/app/features/home/capture-tab/capture-tab.component.ts

View workflow job for this annotation

GitHub Actions / lint

Expected 'this' to be used by class async method 'openFaq'

Check warning on line 254 in src/app/features/home/capture-tab/capture-tab.component.ts

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

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

Expected 'this' to be used by class async method 'openFaq'.
await Browser.open({ url: getFaqUrl(), toolbarColor: browserToolbarColor });
}

async editUsername() {
const alert = await this.alertController.create({
header: this.translocoService.translate('editUsername'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { DiaBackendWalletService } from '../../../../../shared/dia-backend/walle
import { ErrorService } from '../../../../../shared/error/error.service';
import { OrderDetailDialogComponent } from '../../../../../shared/order-detail-dialog/order-detail-dialog.component';
import { ProofRepository } from '../../../../../shared/repositories/proof/proof-repository.service';
import { browserToolbarColor } from '../../../../../utils/constants';
import {
VOID$,
isNonNullable,
Expand Down Expand Up @@ -365,7 +366,7 @@ export class ActionDetailsPage {
tap(cid =>
Browser.open({
url: `${url}?cid=${cid}&order_id=${orderId}`,
toolbarColor: '#564dfc',
toolbarColor: browserToolbarColor,
})
),
catchError((err: unknown) => {
Expand Down
3 changes: 2 additions & 1 deletion src/app/features/home/details/actions/actions.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { DiaBackendWalletService } from '../../../../shared/dia-backend/wallet/d
import { ErrorService } from '../../../../shared/error/error.service';
import { OrderDetailDialogComponent } from '../../../../shared/order-detail-dialog/order-detail-dialog.component';
import { ProofRepository } from '../../../../shared/repositories/proof/proof-repository.service';
import { browserToolbarColor } from '../../../../utils/constants';
import {
VOID$,
isNonNullable,
Expand Down Expand Up @@ -208,7 +209,7 @@ export class ActionsPage {
tap(cid =>
Browser.open({
url: `${url}?cid=${cid}&order_id=${orderId}`,
toolbarColor: '#564dfc',
toolbarColor: browserToolbarColor,
})
),
catchError((err: unknown) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
shareReplay,
switchMap,
} from 'rxjs/operators';
import { browserToolbarColor } from '../../../../utils/constants';
import { isNonNullable } from '../../../../utils/rx-operators/rx-operators';
import { getAssetProfileForNSE } from '../../../../utils/url';
import { DetailedCapture } from '../information/session/information-session.service';
Expand Down Expand Up @@ -83,7 +84,7 @@ export class CaptureDetailsWithIonicComponent {
if (geolocation)
return Browser.open({
url: `https://maps.google.com/maps?q=${geolocation.latitude},${geolocation.longitude}`,
toolbarColor: '#564dfc',
toolbarColor: browserToolbarColor,
});
return EMPTY;
})
Expand All @@ -104,7 +105,7 @@ export class CaptureDetailsWithIonicComponent {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
detailedCapture.id!
),
toolbarColor: '#564dfc',
toolbarColor: browserToolbarColor,
})
)
),
Expand Down
51 changes: 3 additions & 48 deletions src/app/features/home/details/details.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { NetworkService } from '../../../shared/network/network.service';
import { ProofRepository } from '../../../shared/repositories/proof/proof-repository.service';
import { ShareService } from '../../../shared/share/share.service';
import { UserGuideService } from '../../../shared/user-guide/user-guide.service';
import { browserToolbarColor } from '../../../utils/constants';
import { MimeType } from '../../../utils/mime-type';
import {
VOID$,
Expand Down Expand Up @@ -646,7 +647,7 @@ export class DetailsPage {
await defer(() =>
Browser.open({
url: getAssetProfileForNSE(id),
toolbarColor: '#564dfc',
toolbarColor: browserToolbarColor,
})
)
.pipe(untilDestroyed(this), takeUntil(this.shareMenuDismissed$))
Expand Down Expand Up @@ -785,29 +786,6 @@ export class DetailsPage {
}
}

private openIpfsSupportingVideo() {
return this.activeDetailedCapture$
.pipe(
first(),
switchMap(
activeDetailedCapture => activeDetailedCapture.diaBackendAsset$
),
isNonNullable(),
switchMap(diaBackendAsset => {
if (!diaBackendAsset.supporting_file) return EMPTY;
return Browser.open({
url: diaBackendAsset.supporting_file.replace(
'ipfs://',
'https://ipfs-pin.numbersprotocol.io/ipfs/'
),
toolbarColor: '#564dfc',
});
}),
untilDestroyed(this)
)
.subscribe();
}

private share() {
this.activeDetailedCapture$
.pipe(
Expand All @@ -829,29 +807,6 @@ export class DetailsPage {
.subscribe();
}

private openCaptureClub() {
combineLatest([
this.activeDetailedCapture$.pipe(
switchMap(
activeDetailedCapture => activeDetailedCapture.diaBackendAsset$
),
isNonNullable()
),
this.diaBackendAuthService.token$,
])
.pipe(
first(),
concatMap(([diaBackendAsset, token]) =>
Browser.open({
url: `https://captureclub.cc/asset?mid=${diaBackendAsset.id}&token=${token}`,
toolbarColor: '#564dfc',
})
),
untilDestroyed(this)
)
.subscribe();
}

private async remove() {
const action$ = this.activeDetailedCapture$.pipe(
first(),
Expand Down Expand Up @@ -892,7 +847,7 @@ export class DetailsPage {
if (geolocation)
return Browser.open({
url: `https://maps.google.com/maps?q=${geolocation.latitude},${geolocation.longitude}`,
toolbarColor: '#564dfc',
toolbarColor: browserToolbarColor,
});
return EMPTY;
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/home/home.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</a>
</mat-list-item>
<mat-list-item>
<a routerLink="/faq" (click)="sidenav.close()" mat-list-item>
<a (click)="sidenav.close(); openFaq()" mat-list-item>
{{ t('faq') }}
</a>
</mat-list-item>
Expand Down
Loading

0 comments on commit 96ad3b5

Please sign in to comment.