Added location statuses for account data
This commit is contained in:
@@ -15,7 +15,7 @@ const Profile = observer (() => {
|
||||
value: '',
|
||||
seed: String(Math.floor(Math.random() * 90000000000000000000), 10),
|
||||
};
|
||||
|
||||
|
||||
const [sidebarOpen, setSidebarOpen] = useState(false);
|
||||
const [buttonPanelOpen, setButtonPanelOpen] = useState(true);
|
||||
const [removePanelOpen, setRemovePanelOpen] = useState(false);
|
||||
|
||||
@@ -43,7 +43,7 @@ function ProfileTable({
|
||||
image={defaultData.image}
|
||||
value={data.value.charAt(0).toUpperCase()+data.value.slice(1)}
|
||||
property={data.label}
|
||||
status={defaultData.status}
|
||||
status={data.status}
|
||||
transactions={defaultData.transactions}
|
||||
avatars={defaultData.avatars}
|
||||
handleClick={handleClick}
|
||||
@@ -69,7 +69,7 @@ function ProfileTable({
|
||||
image={defaultData.image}
|
||||
value={data.value.charAt(0).toUpperCase()+data.value.slice(1)}
|
||||
property={data.label}
|
||||
status={defaultData.status}
|
||||
status={data.status}
|
||||
transactions={defaultData.transactions}
|
||||
avatars={defaultData.avatars}
|
||||
handleClick={handleClick}
|
||||
@@ -95,7 +95,7 @@ function ProfileTable({
|
||||
image={defaultData.image}
|
||||
value={data.value.charAt(0).toUpperCase()+data.value.slice(1)}
|
||||
property={data.label}
|
||||
status={defaultData.status}
|
||||
status={data.status}
|
||||
transactions={defaultData.transactions}
|
||||
avatars={defaultData.avatars}
|
||||
handleClick={handleClick}
|
||||
@@ -121,7 +121,7 @@ function ProfileTable({
|
||||
image={defaultData.image}
|
||||
value={data.value}
|
||||
property={data.label}
|
||||
status={defaultData.status}
|
||||
status={data.status}
|
||||
transactions={defaultData.transactions}
|
||||
avatars={defaultData.avatars}
|
||||
handleClick={handleClick}
|
||||
|
||||
@@ -5,7 +5,7 @@ function ProfileTableItem(props) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<tr className={`${props.status !== 'Progress' || 'bg-[#eaf0f6]'}`}>
|
||||
<tr>
|
||||
<td className="pl-4 pr-4 py-3 whitespace-nowrap w-px">
|
||||
<div className="flex items-center">
|
||||
<label className="inline-flex">
|
||||
@@ -19,7 +19,7 @@ function ProfileTableItem(props) {
|
||||
<div className="w-9 h-9 shrink-0 mr-2 sm:mr-4">
|
||||
<img className="rounded-full" src={props.image} width="40" height="40" alt={props.property} />
|
||||
</div>
|
||||
<div className="flex flex-col w-60">
|
||||
<div className="flex flex-col w-60">
|
||||
<div className="font-semibold text-slate-800 text-base">{props.value}</div>
|
||||
<div className="font-normal text-xxs">{props.property}</div>
|
||||
</div>
|
||||
@@ -27,10 +27,10 @@ function ProfileTableItem(props) {
|
||||
</td>
|
||||
<td className="py-3 whitespace-nowrap w-px">
|
||||
<div className="w-fit text-xs inline-flex font-medium px-2.5 py-1">
|
||||
{(props.status === 'Progress') ? (
|
||||
{(props.status === 'Blockchained') ? (
|
||||
<div className="bg-amber-100 text-amber-600 rounded-full text-center px-2.5 py-1">
|
||||
{props.status}
|
||||
</div>) :
|
||||
</div>) :
|
||||
(props.status === 'Stored') ? (
|
||||
<div className="bg-slate-700 text-slate-100 rounded-full text-center px-2.5 py-1">
|
||||
{props.status}
|
||||
@@ -89,7 +89,7 @@ function ProfileTableItem(props) {
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr className={`${!descriptionOpen && 'hidden'} ${props.status !== 'Progress' || 'bg-[#eaf0f6]'}` }>
|
||||
<tr className={`${!descriptionOpen && 'hidden'}` }>
|
||||
<td colSpan="10" className="px-12 pt-3.5 pb-[14px]">
|
||||
<div className="flex items-center gap-x-5">
|
||||
<div>
|
||||
@@ -139,7 +139,7 @@ function ProfileTableItem(props) {
|
||||
Explore ->
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -213,12 +213,44 @@ class Store {
|
||||
}
|
||||
|
||||
get decryptedAccountData() {
|
||||
return this._accountData.map((elem) => {
|
||||
const [seed, value] = cryptography.decryptMessageWithPassphrase(elem.value, elem.value_nonce, this.passPhrase, this.pubKey).split(':');
|
||||
return {
|
||||
const allAccountData=this._accountData.concat(this.accountFeatures.filter(item=>!this._accountData.find(elem=>elem.label===item.label)))
|
||||
return allAccountData.map((elem) => {
|
||||
const initialData={
|
||||
...elem,
|
||||
key: elem.label,
|
||||
label: labelMap[elem.label] || elem.label,
|
||||
status: '',
|
||||
value: '',
|
||||
seed: ''
|
||||
}
|
||||
if(!this._accountData.find(item=>item.label===elem.label)) {
|
||||
return {
|
||||
...initialData,
|
||||
status: 'Blockchained',
|
||||
value: `${elem.value.slice(0,4)}****${elem.value.slice(elem.value.length-4)}`
|
||||
}
|
||||
}
|
||||
const [seed, value] = cryptography.decryptMessageWithPassphrase(elem.value, elem.value_nonce, this.passPhrase, this.pubKey).split(':');
|
||||
const hashValue=cryptography.hash(Buffer.concat([Buffer.from(seed, 'utf8'), cryptography.hash(value, 'utf8')])).toString('hex')
|
||||
if(!this.accountFeatures.find(item=>item.label===elem.label)) {
|
||||
return {
|
||||
...initialData,
|
||||
status: 'Stored',
|
||||
value,
|
||||
seed
|
||||
}
|
||||
}
|
||||
if(this.accountFeatures.find(item=>item.label===elem.label).value!==hashValue) {
|
||||
return {
|
||||
...initialData,
|
||||
status: 'Incorrect',
|
||||
value,
|
||||
seed
|
||||
}
|
||||
}
|
||||
return {
|
||||
...initialData,
|
||||
status: 'Completed',
|
||||
value,
|
||||
seed
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user