-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of ssh://gitlab.papers.tech:10022/papers/airga…
…p/airgap-wallet into feat/rsk-ready
- Loading branch information
Showing
16 changed files
with
594 additions
and
301 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.single-group-label{ | ||
flex: 0 0 auto; | ||
} | ||
|
||
ion-select { | ||
width: 400px; | ||
} | ||
|
||
ion-select::part(text) { | ||
flex: 0 0 auto; | ||
} |
20 changes: 20 additions & 0 deletions
20
src/app/pages/languages-selection-settings-page/languages-selection-settings.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { CommonModule } from '@angular/common' | ||
import { NgModule } from '@angular/core' | ||
import { FormsModule } from '@angular/forms' | ||
import { RouterModule, Routes } from '@angular/router' | ||
import { IonicModule } from '@ionic/angular' | ||
import { TranslateModule } from '@ngx-translate/core' | ||
|
||
import { LanguagesSelectionSettingsPage } from './languages-selection-settings.page' | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: '', | ||
component: LanguagesSelectionSettingsPage | ||
} | ||
] | ||
@NgModule({ | ||
imports: [CommonModule, FormsModule, IonicModule, RouterModule.forChild(routes), TranslateModule], | ||
declarations: [LanguagesSelectionSettingsPage] | ||
}) | ||
export class LanguagesSelectionSettingsPageModule {} |
34 changes: 34 additions & 0 deletions
34
src/app/pages/languages-selection-settings-page/languages-selection-settings.page.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<ion-header class="ion-no-border"> | ||
<ion-toolbar> | ||
<ion-buttons slot="start"> | ||
<ion-back-button></ion-back-button> | ||
</ion-buttons> | ||
<ion-title>{{ 'language-selection-settings.title' | translate }}</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content class="ion-padding"> | ||
<h3 [innerHTML]="'language-selection-settings.heading' | translate"></h3> | ||
|
||
<ion-list lines="none" class="ion-padding-vertical" (ionChange)="changeLanguage($event.detail.value)"> | ||
<ion-radio-group [(ngModel)]="selectedType"> | ||
<ng-container *ngFor="let language of languages"> | ||
<ion-item detail="false" class="ion-no-padding"> | ||
<ion-label color="dark">{{ 'language-selection-settings.selector.' + language | translate }}</ion-label> | ||
<ion-radio class="ion-no-margin" slot="end" [value]="language"></ion-radio> | ||
</ion-item> | ||
</ng-container> | ||
</ion-radio-group> | ||
</ion-list> | ||
<ion-button color="tertiary" shape="round" (click)="defaultToDevice()"> | ||
{{ 'language-selection-settings.selector.device' | translate }} | ||
</ion-button> | ||
|
||
<p><i>{{ 'interaction-selection-settings.description' | translate }}</i></p> | ||
|
||
<ion-fab vertical="bottom" horizontal="end" slot="fixed"> | ||
<ion-button color="primary" shape="round" (click)="goToNextPage()"> | ||
{{ 'language-selection-settings.continue_label' | translate }} | ||
</ion-button> | ||
</ion-fab> | ||
</ion-content> |
3 changes: 3 additions & 0 deletions
3
src/app/pages/languages-selection-settings-page/languages-selection-settings.page.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ion-content { | ||
--padding-bottom: var(--ion-padding, 64px); | ||
} |
55 changes: 55 additions & 0 deletions
55
src/app/pages/languages-selection-settings-page/languages-selection-settings.page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { Component, OnInit } from '@angular/core' | ||
import { TranslateService } from '@ngx-translate/core' | ||
import { NavigationService } from 'src/app/services/navigation/navigation.service' | ||
import { LanguagesType, WalletStorageKey, WalletStorageService } from 'src/app/services/storage/storage' | ||
|
||
@Component({ | ||
selector: 'app-languages-selection-settings-page', | ||
templateUrl: './languages-selection-settings.page.html', | ||
styleUrls: ['./languages-selection-settings.page.scss'] | ||
}) | ||
export class LanguagesSelectionSettingsPage implements OnInit { | ||
public languageType: typeof LanguagesType = LanguagesType | ||
public initialType: LanguagesType | undefined | ||
public selectedType: LanguagesType | undefined | ||
public isEdit: boolean = false | ||
|
||
public get languages(): string[] { | ||
return Object.values(LanguagesType) | ||
} | ||
|
||
constructor( | ||
private readonly translateService: TranslateService, | ||
private readonly navigationService: NavigationService, | ||
private readonly storageService: WalletStorageService | ||
) {} | ||
|
||
public async ngOnInit(): Promise<void> { | ||
const currentLanguage = await this.getCurrentLanguage() | ||
this.changeLanguage(currentLanguage) | ||
} | ||
|
||
public async getCurrentLanguage(): Promise<LanguagesType> { | ||
const savedLanguage = await this.storageService.get(WalletStorageKey.LANGUAGE_TYPE) | ||
const deviceLanguage = this.translateService.getBrowserLang() | ||
|
||
return savedLanguage || (deviceLanguage as LanguagesType) || LanguagesType.EN | ||
} | ||
|
||
public async defaultToDevice() { | ||
const deviceLanguage = this.translateService.getBrowserLang() as LanguagesType | ||
this.changeLanguage(deviceLanguage) | ||
} | ||
|
||
public async changeLanguage(language: LanguagesType): Promise<void> { | ||
await this.translateService.use(language).toPromise() | ||
this.selectedType = language | ||
} | ||
|
||
public goToNextPage(): void { | ||
if (this.selectedType) { | ||
this.storageService.set(WalletStorageKey.LANGUAGE_TYPE, this.selectedType) | ||
} | ||
this.navigationService.back() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
.ion-no-margin { | ||
font-size: 50px; | ||
font-weight: bold; | ||
} | ||
.loading-header { | ||
color: white; | ||
font-weight: 300; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.