Исправлен нейминг в store и transactionsStore. Возвращены иконки юзеров на страницу ValidationLog

This commit is contained in:
DwCay
2022-07-13 14:30:11 +03:00
parent 8489bc375c
commit bc364d1b85
6 changed files with 75 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ class Store {
_userData = {}
_transactionInfo = {}
_transactionsInfo = {}
constructor() {
makeAutoObservable(this);
@@ -20,7 +20,7 @@ class Store {
this.fetchNodeInfo()
reaction(() => this.tokenKey, () => this.fetchNewAccountData())
reaction(() => this.tokenKey, () => this.fetchTransactionInfo())
reaction(() => this.tokenKey, () => this.fetchTransactionsInfo())
};
fetchNewAccountData() {
@@ -38,12 +38,12 @@ class Store {
.then(()=>this.fetchNewAccountData())
}
fetchTransactionInfo() {
fetchTransactionsInfo() {
fetchWrapper.getAuth(`http://3.125.47.101/api/account/transactions/b444b7ff3118cf2a30cbd54cfcdb8fd5d805017a?moduleID=1001&assetID=11`, {
networkIdentifier: this.nodeInfo.networkIdentifier,
lastBlockID: this.nodeInfo.lastBlockID
})
.then((res)=>this.saveInfoTransaction(res))
.then((res)=>this.saveInfoTransactions(res))
}
userDataFetchChange(res) {
@@ -54,8 +54,8 @@ class Store {
return this._userData
}
get transactionInfo() {
return this._transactionInfo
get transactionsInfo() {
return this._transactionsInfo
}
savePassPhrase(phrase) {
@@ -66,8 +66,8 @@ class Store {
this._accountData = data;
};
saveInfoTransaction(transaction) {
this._transactionInfo = transaction
saveInfoTransactions(transaction) {
this._transactionsInfo = transaction
}
fetchNodeInfo() {

View File

@@ -0,0 +1,51 @@
import {makeAutoObservable, reaction} from "mobx";
import {registrationStore} from "./store";
import User05 from "../../src/images/user-28-05.jpg";
import User08 from "../../src/images/user-28-08.jpg";
import User09 from "../../src/images/user-28-09.jpg";
import User06 from "../../src/images/user-28-06.jpg";
const labelMap = {
firstname: 'First name',
secondname: 'Second name',
gender: "Gender",
birthdate: "Birthdate"
};
const usersImages = [User08,User06,User05,User09];
class TransactionsStore {
_transactionsData = [];
constructor() {
makeAutoObservable(this)
reaction(() => ({data: registrationStore.transactionsInfo}), ({data}) => {
this._transactionsData = data.data;
})
}
get transactionsData() {
return this._transactionsData.map(item=>{
return {
id: item.id,
users_images: usersImages.map(image=>{
return {
image: image,
size: 24
}
}),
transaction: item.asset.features.map(asset=>{
return {
transaction_id: item.id,
address: item.asset.recipientAddress,
value: asset.value,
label: labelMap[asset.label],
}
})
}
})
}
}
export const transactionsStore = new TransactionsStore()