Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 0252946

Browse files
authored
Merge pull request #494 from ArkEcosystem/hotfix/1.7.1
release: hotfix 1.7.1
2 parents 721f0b4 + 41c45ed commit 0252946

50 files changed

Lines changed: 862 additions & 263 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<widget id="io.ark.wallet.mobile" version="1.7.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
2+
<widget id="io.ark.wallet.mobile" version="1.7.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
33
<name>Ark Mobile</name>
44
<description>ARK</description>
55
<author email="mobile@ark.io" href="http://ark.io/">Ark Ecosystem</author>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ark-mobile",
3-
"version": "1.7.0",
3+
"version": "1.7.1",
44
"author": "Ark Ecosystem <mobile@ark.io>",
55
"homepage": "https://github.com/ArkEcosystem/mobile-wallet#readme",
66
"scripts": {

src/app/app-routing.module.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ const routes: Routes = [
1212
{
1313
path: "network-status",
1414
loadChildren: () =>
15-
import("./pages/network-status/network-status.module").then(
15+
import("./pages/network/network-status/network-status.module").then(
1616
m => m.NetworkStatusPageModule,
1717
),
1818
},
19+
{
20+
path: "network-overview",
21+
loadChildren: () =>
22+
import(
23+
"./pages/network/network-overview/network-overview.module"
24+
).then(m => m.NetworkOverviewPageModule),
25+
},
1926
{
2027
path: "login",
2128
loadChildren: () =>

src/app/components/address-list/address-list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h3 class="item-title">{{ item.key }}</h3>
1414
color="medium"
1515
fill="clear"
1616
class="more disable-hover"
17-
*ngIf="icon"
17+
*ngIf="icon && item.hasMore"
1818
(click)="onMore(item.index)"
1919
>
2020
<ion-icon slot="icon-only" [name]="icon"></ion-icon>

src/app/components/amount/amount.html

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/app/components/amount/amount.model.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/app/components/amount/amount.ts

Lines changed: 0 additions & 111 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<ion-row>
2+
<ion-col>
3+
<ion-grid no-padding class="amount-container">
4+
<ion-row>
5+
<ion-col class="pl-0">
6+
<ion-item>
7+
<ion-label position="stacked">{{
8+
currentNetwork?.token
9+
}}</ion-label>
10+
<input-currency
11+
name="amount"
12+
formControlName="amount"
13+
[fractionDigits]="tokenFractionDigits"
14+
placeholder="0"
15+
></input-currency>
16+
</ion-item>
17+
</ion-col>
18+
<ion-col class="ml-1 pr-0" appMarketNetOnly>
19+
<ion-item>
20+
<ion-label position="stacked">{{
21+
marketCurrency?.code | uppercase
22+
}}</ion-label>
23+
<input-currency
24+
name="amountEquivalent"
25+
formControlName="amountEquivalent"
26+
[fractionDigits]="fiatFractionDigits"
27+
></input-currency>
28+
</ion-item>
29+
</ion-col>
30+
</ion-row>
31+
</ion-grid>
32+
</ion-col>
33+
</ion-row>

src/app/components/amount/amount.scss renamed to src/app/components/input-amount/input-amount.component.scss

File renamed without changes.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import * as constants from "@/app/app.constants";
2+
import { MarketCurrency } from "@/models/model";
3+
import { MarketDataProvider } from "@/services/market-data/market-data";
4+
import { SettingsDataProvider } from "@/services/settings-data/settings-data";
5+
import { UserDataProvider } from "@/services/user-data/user-data";
6+
import BigNumber, { SafeBigNumber } from "@/utils/bignumber";
7+
import { Component, OnInit } from "@angular/core";
8+
import {
9+
ControlContainer,
10+
FormControl,
11+
FormGroupDirective,
12+
} from "@angular/forms";
13+
import { Network } from "ark-ts/model";
14+
15+
@Component({
16+
selector: "input-amount",
17+
templateUrl: "input-amount.component.html",
18+
styleUrls: ["input-amount.component.scss"],
19+
viewProviders: [
20+
{
21+
provide: ControlContainer,
22+
useExisting: FormGroupDirective,
23+
},
24+
],
25+
})
26+
export class InputAmountComponent implements OnInit {
27+
public tokenFractionDigits = constants.ARKTOSHI_DP;
28+
public fiatFractionDigits = 2;
29+
public marketCurrency: MarketCurrency;
30+
public currentNetwork: Network;
31+
32+
public constructor(
33+
private userDataProvider: UserDataProvider,
34+
private marketDataProvider: MarketDataProvider,
35+
private settingsDataProvider: SettingsDataProvider,
36+
private parentForm: FormGroupDirective,
37+
) {
38+
this.currentNetwork = this.userDataProvider.currentNetwork;
39+
}
40+
41+
public ngOnInit() {
42+
this.parentForm.form.addControl("amount", new FormControl("amount"));
43+
this.parentForm.form.addControl(
44+
"amountEquivalent",
45+
new FormControl("amountEquivalent"),
46+
);
47+
48+
this.parentForm.form.controls.amount.valueChanges.subscribe(value =>
49+
this.onInputToken(value),
50+
);
51+
this.parentForm.form.controls.amountEquivalent.valueChanges.subscribe(
52+
value => this.onInputFiat(value),
53+
);
54+
55+
this.marketDataProvider.ticker.subscribe(ticker => {
56+
this.settingsDataProvider.settings.subscribe(settings => {
57+
this.marketCurrency = ticker.getCurrency({
58+
code: settings.currency,
59+
});
60+
this.fiatFractionDigits =
61+
this.marketCurrency.code === "btc" ? 8 : 3;
62+
});
63+
});
64+
}
65+
66+
public onInputToken(currency: string | BigNumber) {
67+
const fiatAmount = new SafeBigNumber(currency).multipliedBy(
68+
this.marketCurrency.price,
69+
);
70+
this.parentForm.form.controls.amountEquivalent.setValue(fiatAmount, {
71+
emitEvent: false,
72+
});
73+
}
74+
75+
public onInputFiat(currency: string | BigNumber) {
76+
const tokenAmount = new SafeBigNumber(currency).dividedBy(
77+
this.marketCurrency.price,
78+
);
79+
this.parentForm.form.controls.amount.setValue(tokenAmount, {
80+
emitEvent: false,
81+
});
82+
}
83+
}

0 commit comments

Comments
 (0)