Change methods for new transactions data

This commit is contained in:
DwCay
2022-07-21 11:21:55 +03:00
parent b75a2349c2
commit f27edb97bb
3 changed files with 25 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ function ValidateRoadMap({ season }) {
<div className="w-32 shrink-0"> <div className="w-32 shrink-0">
<h2 className="text-xl leading-snug font-bold text-slate-800 xl:leading-7 mb-4 xl:mb-0">{''}</h2> <h2 className="text-xl leading-snug font-bold text-slate-800 xl:leading-7 mb-4 xl:mb-0">{''}</h2>
</div> </div>
<div className="grow pb-6"> <div className="grow pb-6 border-b border-slate-200">
<header> <header>
<div className="flex flex-nowrap items-center space-x-2 mb-6"> <div className="flex flex-nowrap items-center space-x-2 mb-6">
{/* Avatars */} {/* Avatars */}

View File

@@ -5,13 +5,13 @@ function ValidationSeasonItem({ length, item, index }) {
<li className="relative pt-2 pb-2.5"> <li className="relative pt-2 pb-2.5">
<div className="flex items-center mb-2.5"> <div className="flex items-center mb-2.5">
{length-1!==index && <div className="absolute left-0 h-full w-0.5 bg-slate-200 self-start ml-2.5 -translate-x-1/2 translate-y-3" aria-hidden="true"></div>} {length-1!==index && <div className="absolute left-0 h-full w-0.5 bg-slate-200 self-start ml-2.5 -translate-x-1/2 translate-y-3" aria-hidden="true"></div>}
<div className="absolute left-0 rounded-full bg-indigo-500" aria-hidden="true"> <div className={`${item.address ? "bg-indigo-500" : "bg-[#FF0000]"} absolute left-0 rounded-full`} aria-hidden="true">
<svg className="w-5 h-5 fill-current text-white" viewBox="0 0 20 20"> <svg className="w-5 h-5 fill-current text-white" viewBox="0 0 20 20">
<path d="M14.4 8.4L13 7l-4 4-2-2-1.4 1.4L9 13.8z"/> {item.address && <path d="M14.4 8.4L13 7l-4 4-2-2-1.4 1.4L9 13.8z"/>}
</svg> </svg>
</div> </div>
<h3 className="text-lg font-bold text-slate-800 pl-9"> <h3 className="text-lg font-bold text-slate-800 pl-9">
{`${item.label} by`} <a className="cursor-pointer font-bold text-indigo-500 hover:text-indigo-600 underline hover:no-underline" >{item.address}</a> {`${item.label} ${item.address ? "by" : "Updated"}`} <a className="cursor-pointer font-bold text-indigo-500 hover:text-indigo-600 underline hover:no-underline" >{item.address}</a>
</h3> </h3>
</div> </div>
<div className="block text-slate-800 w-fit pl-9"> <div className="block text-slate-800 w-fit pl-9">
@@ -20,7 +20,7 @@ function ValidationSeasonItem({ length, item, index }) {
</div> </div>
<div className="mb-3.5 block text-slate-800 w-fit pl-9"> <div className="mb-3.5 block text-slate-800 w-fit pl-9">
<div className="text-base font-semibold underline mb-[-10px]">{item.value}</div> <div className="text-base font-semibold underline mb-[-10px]">{item.value}</div>
<span className="font-normal text-slate-600 text-[10px]">Validated data</span> <span className="font-normal text-slate-600 text-[10px]">{item.address ? "Validated data" : "Updated data"}</span>
</div> </div>
<a className="cursor-pointer pl-9 font-normal text-sm text-indigo-500 hover:text-indigo-600">Explore -&gt;</a> <a className="cursor-pointer pl-9 font-normal text-sm text-indigo-500 hover:text-indigo-600">Explore -&gt;</a>
</li> </li>

View File

@@ -23,6 +23,8 @@ class Store {
_sharedData = [] _sharedData = []
_personalAccount = {}
_transactionsInfo = [] _transactionsInfo = []
constructor() { constructor() {
@@ -71,12 +73,23 @@ class Store {
} }
fetchTransactionsInfo() { fetchTransactionsInfo() {
fetchWrapper.get(`account/transactions/${this.accountMadeTransaction}?moduleID=1001&assetID=11`, { fetchWrapper.get(`account/transactions/${this.accountMadeTransaction}`, {
networkIdentifier: this.nodeInfo.networkIdentifier, networkIdentifier: this.nodeInfo.networkIdentifier,
lastBlockID: this.nodeInfo.lastBlockID lastBlockID: this.nodeInfo.lastBlockID
}).then((res) => this.saveInfoTransactions(res)) }).then((res) => this.saveInfoTransactions(res))
} }
fetchPersonalAccount() {
fetchWrapper.get(`account/${this.accountMadeTransaction}`, {
networkIdentifier: this.nodeInfo.networkIdentifier,
lastBlockID: this.nodeInfo.lastBlockID
}).then((res)=>this.savePersonalAccount(res))
}
savePersonalAccount(res) {
this._personalAccount=res.data
}
fetchSharedData() { fetchSharedData() {
this._keysArray.forEach((elem) => fetchWrapper.get(`data/shared/${elem}`).then((res) => this.changeSharedData(res))) this._keysArray.forEach((elem) => fetchWrapper.get(`data/shared/${elem}`).then((res) => this.changeSharedData(res)))
}; };
@@ -151,7 +164,7 @@ class Store {
transaction: item.asset.features.map(asset => { transaction: item.asset.features.map(asset => {
return { return {
transaction_id: item.id, transaction_id: item.id,
address: this.accountMadeTransaction, address: item.asset.recipientAddress && "b444b7ff3118cf2a30cbd54cfcdb8fd5d805017a",
value: asset.value, value: asset.value,
label: labelMap[asset.label], label: labelMap[asset.label],
} }
@@ -181,7 +194,11 @@ class Store {
} }
get accountMadeTransaction() { get accountMadeTransaction() {
return "b444b7ff3118cf2a30cbd54cfcdb8fd5d805017a" return "71ccaeefe22050abc9b36ce0c1744316c11c49e1"
}
get personalAccount() {
return this._personalAccount
} }
get keysArray() { get keysArray() {