Skip to content

Commit

Permalink
Merge pull request #10238 from Gamboster/feat/walletGroupOnboarding
Browse files Browse the repository at this point in the history
Feat: key onboarding from settings
  • Loading branch information
cmgustavo authored Oct 15, 2019
2 parents 180a3d2 + d3137b2 commit 996d8e1
Show file tree
Hide file tree
Showing 10 changed files with 1,062 additions and 9 deletions.
186 changes: 186 additions & 0 deletions src/assets/img/wallet-group-tour1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
213 changes: 213 additions & 0 deletions src/assets/img/wallet-group-tour2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
474 changes: 474 additions & 0 deletions src/assets/img/wallet-group-tour3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/pages/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import { SharePage } from '../pages/settings/share/share';
import { WalletGroupDeletePage } from '../pages/settings/wallet-group-settings/wallet-group-delete/wallet-group-delete';
import { WalletGroupExtendedPrivateKeyPage } from '../pages/settings/wallet-group-settings/wallet-group-extended-private-key/wallet-group-extended-private-key';
import { WalletGroupNamePage } from '../pages/settings/wallet-group-settings/wallet-group-name/wallet-group-name';
import { WalletGroupOnboardingPage } from '../pages/settings/wallet-group-settings/wallet-group-onboarding/wallet-group-onboarding';
import { WalletGroupSettingsPage } from '../pages/settings/wallet-group-settings/wallet-group-settings';

/* Wallet Settings */
Expand Down Expand Up @@ -205,6 +206,7 @@ export const PAGES = [
WalletGroupDeletePage,
WalletGroupSettingsPage,
WalletGroupNamePage,
WalletGroupOnboardingPage,
WalletDetailsPage,
WalletRecoverPage,
WalletMnemonicRecoverPage,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<ion-slides #walletGroupOnboardingSlides pager="true" class="key-onboarding-slides">
<ion-slide>
<div class="img-container">
<img src="assets/img/wallet-group-tour1.svg" />
</div>
<div class="slide-info">
<div class="info">
<div class="title" translate>Your funds, on your device</div>
<div class="text" translate>
A wallet is like a vault stored on your device containing your crypto funds. Much like a vault, your wallet will only be accesible with the master key.
</div>
</div>
</div>
</ion-slide>
<ion-slide>
<div class="img-container">
<img src="assets/img/wallet-group-tour2.svg" />
</div>
<div class="slide-info">
<div class="info">
<div class="title" translate>The "Key" to your funds</div>
<div class="text" translate>
Your wallet master key is a phrase composed of 12 randomly selected words. If you were to ever lose or damage your device, you can restore access to your wallet as long as you have your 12 word master key.
</div>
</div>
</div>
</ion-slide>
<ion-slide>
<div class="img-container">
<img src="assets/img/wallet-group-tour3.svg" />
</div>
<div class="slide-info">
<div class="info">
<div class="title" translate>Don't loose your key!</div>
<div class="text" translate>
In order to protect your funds from being accessible to hackers and theives, the Master Key to your wallet must be kept somewhere safe and remain a secret.
</div>
</div>
</div>
</ion-slide>
</ion-slides>
<div padding>
<button ion-button clear class="next-slide-button" (click)="nextSlide()" *ngIf="walletGroupOnboardingSlides.getActiveIndex() < 2" translate>
Next
</button>
<button ion-button clear class="next-slide-button" (click)="close()" *ngIf="walletGroupOnboardingSlides.getActiveIndex() == 2" translate>
I understand
</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
page-wallet-group-onboarding {
.key-onboarding-slides {
.slide-zoom {
height: 100%;
}
ion-slide {
background: linear-gradient(to bottom, #ffffff, #ebedf8 80%);
.img-container {
height: 68vh;
@media (max-height: 650px) and (max-width: 768px) {
height: 60vh;
}
@media (max-height: 550px) and (max-width: 768px) {
height: 53vh;
}
@media (min-height: 600px) and (min-width: 768px) {
height: 42vh;
}
@media (min-height: 768px) and (min-width: 768px) {
height: 50vh;
}
img {
padding: 5rem;
@media (max-height: 650px) and (max-width: 768px) {
padding: 3rem;
}
@media (max-height: 550px) and (max-width: 768px) {
padding: 2rem;
}
@media (min-height: 600px) and (min-width: 768px) {
padding: 2rem;
}
width: 100%;
height: 100%;
justify-content: center;
align-self: center;
margin: 0 auto;
box-shadow: 0px 0px 21px rgba(0, 0, 0, 0.07);
}
}
.slide-info {
background: white;
min-height: 230px;
padding-bottom: 20rem;
.info {
padding: 2rem;
.title {
align-items: center;
color: #060606;
font-weight: 500;
text-align: left;
}
.text {
font-size: 16px;
text-align: left;
color: rgb(46, 46, 46);
font-weight: 300;
padding-top: 15px;
padding-bottom: 30px;
}
}
}
}

.swiper-pagination {
text-align: left;
margin-left: 4rem;
margin-bottom: 1rem;
button.swiper-pagination-bullet {
width: 9px;
height: 9px;
}
}
}
.next-slide-button {
z-index: 1;
position: absolute;
bottom: 0.5rem;
right: 3rem;
color: color($colors, primary);
cursor: pointer;
text-transform: uppercase;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Component, ViewChild } from '@angular/core';
import { Slides, ViewController } from 'ionic-angular';

@Component({
selector: 'page-wallet-group-onboarding',
templateUrl: 'wallet-group-onboarding.html'
})
export class WalletGroupOnboardingPage {
@ViewChild('walletGroupOnboardingSlides')
walletGroupOnboardingSlides: Slides;

constructor(private viewCtrl: ViewController) {}

public nextSlide(): void {
this.walletGroupOnboardingSlides.slideNext();
}

public close(): void {
this.viewCtrl.dismiss();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@
<expandable-header-primary>
<span *ngIf="canSign">{{'Key Settings' | translate}}</span>
<span *ngIf="!canSign">{{'Read Only Wallets' | translate}}</span>
<div class="subtitle" *ngIf="wallets && canSign">
This key contains {{wallets.length}} wallets.
<div class="subtitle-container" *ngIf="wallets && canSign">
<div class="subtitle">
This key contains {{wallets.length}} wallets.
</div>
<div class="onboarding-modal" (click)="showWalletGroupOnboardingSlides()">
<ion-icon name="md-help-circle"></ion-icon>
</div>
</div>
</expandable-header-primary>
</ion-toolbar>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,20 @@ page-wallet-group-settings {
padding-bottom: 20px;
padding-left: 20px;

.subtitle {
font-size: 16px;
padding: 0;
margin-top: 10px;
font-weight: 100;
.subtitle-container {
display: flex;
justify-content: space-between;
.subtitle {
font-size: 16px;
padding: 0;
margin-top: 10px;
font-weight: 100;
}
.onboarding-modal {
cursor: pointer;
color: color($colors, light-grey);
margin-right: 2rem;
}
}
}

Expand Down
14 changes: 12 additions & 2 deletions src/pages/settings/wallet-group-settings/wallet-group-settings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { NavController, NavParams } from 'ionic-angular';
import { ModalController, NavController, NavParams } from 'ionic-angular';
import * as _ from 'lodash';

// providers
Expand All @@ -16,6 +16,7 @@ import { WalletProvider } from '../../../providers/wallet/wallet';
import { AddPage } from '../../add/add';
import { BackupKeyPage } from '../../backup/backup-key/backup-key';
import { WalletGroupNamePage } from '../wallet-group-settings/wallet-group-name/wallet-group-name';
import { WalletGroupOnboardingPage } from '../wallet-group-settings/wallet-group-onboarding/wallet-group-onboarding';
import { WalletSettingsPage } from '../wallet-settings/wallet-settings';
import { WalletExportPage } from '../wallet-settings/wallet-settings-advanced/wallet-export/wallet-export';
import { WalletGroupDeletePage } from './wallet-group-delete/wallet-group-delete';
Expand Down Expand Up @@ -50,7 +51,8 @@ export class WalletGroupSettingsPage {
private externalLinkProvider: ExternalLinkProvider,
private translate: TranslateService,
private keyProvider: KeyProvider,
private derivationPathHelperProvider: DerivationPathHelperProvider
private derivationPathHelperProvider: DerivationPathHelperProvider,
private modalCtrl: ModalController
) {
this.logger.info('Loaded: WalletGroupSettingsPage');
this.keyId = this.navParams.data.keyId;
Expand Down Expand Up @@ -209,4 +211,12 @@ export class WalletGroupSettingsPage {
keyId: this.keyId
});
}

public showWalletGroupOnboardingSlides() {
const modal = this.modalCtrl.create(WalletGroupOnboardingPage, {
showBackdrop: false,
enableBackdropDismiss: false
});
modal.present();
}
}

0 comments on commit 996d8e1

Please sign in to comment.