add link variable type to the interpretation (#3068)

* add link variable type to the interpretation

* add margin for dex and other links
This commit is contained in:
Igor Stuev
2025-10-16 20:14:14 +02:00
committed by GitHub
parent e3adb0b47d
commit 1554c57ed7
2 changed files with 16 additions and 3 deletions
+12 -2
View File
@@ -21,7 +21,8 @@ export type TxInterpretationVariable =
TxInterpretationVariableAddress |
TxInterpretationVariableDomain |
TxInterpretationVariableMethod |
TxInterpretationVariableDex;
TxInterpretationVariableDex |
TxInterpretationVariableLink;
export type TxInterpretationVariableType =
'string' |
@@ -32,7 +33,8 @@ export type TxInterpretationVariableType =
'address' |
'domain' |
'method' |
'dexTag';
'dexTag' |
'link';
export type TxInterpretationVariableString = {
type: 'string';
@@ -87,3 +89,11 @@ export type TxInterpretationVariableDex = {
app_icon?: string;
};
};
export type TxInterpretationVariableLink = {
type: 'link';
value: {
name: string;
url: string;
};
};
@@ -173,12 +173,15 @@ const TxInterpretationElementByType = (
})();
return (
<chakra.span display="inline-flex" alignItems="center" verticalAlign="top" _notFirst={{ marginLeft: 1 }} gap={ 1 }>
<chakra.span display="inline-flex" alignItems="center" verticalAlign="top" _notFirst={{ marginLeft: 1 }} gap={ 1 } mr={ 2 }>
{ icon && <Image src={ icon } alt={ value.name } width={ 5 } height={ 5 }/> }
{ name }
</chakra.span>
);
}
case 'link': {
return <Link external href={ value.url }>{ value.name }</Link>;
}
}
};