Commit 1cea43f7 authored by Max Alekseenko's avatar Max Alekseenko

rename meta props

parent 349813a8
......@@ -16,15 +16,15 @@ export default function parseMetaPayload(meta: AddressMetadataTag['meta']): Addr
const stringFields: Array<keyof MetaParsed> = [
'textColor',
'bgColor',
'actionURL',
'appID',
'logoURL',
'text',
'tagUrl',
'tooltipIcon',
'tooltipTitle',
'tooltipDescription',
'tooltipUrl',
'appID',
'appMarketplaceURL',
'appLogoURL',
'appActionButtonText',
];
for (const stringField of stringFields) {
......
......@@ -26,9 +26,9 @@ export interface AddressMetadataTagApi extends Omit<AddressMetadataTag, 'meta'>
tooltipTitle?: string;
tooltipDescription?: string;
tooltipUrl?: string;
actionURL?: string;
appID?: string;
logoURL?: string;
text?: string;
appMarketplaceURL?: string;
appLogoURL?: string;
appActionButtonText?: string;
} | null;
}
......@@ -21,9 +21,9 @@ const AppActionButton = ({ data, className, txHash, source }: Props) => {
const defaultTextColor = useColorModeValue('blue.600', 'blue.300');
const defaultBg = useColorModeValue('gray.100', 'gray.700');
const { appID, textColor, bgColor, text, logoURL } = data;
const { appID, textColor, bgColor, appActionButtonText, appLogoURL } = data;
const actionURL = data.actionURL?.replace('{chainId}', config.chain.id || '').replace('{txHash}', txHash || '');
const actionURL = data.appMarketplaceURL?.replace('{chainId}', config.chain.id || '').replace('{txHash}', txHash || '');
const handleClick = React.useCallback(() => {
const info = appID || actionURL;
......@@ -35,14 +35,14 @@ const AppActionButton = ({ data, className, txHash, source }: Props) => {
const content = (
<>
<Image
src={ logoURL }
alt={ `${ text } button` }
src={ appLogoURL }
alt={ `${ appActionButtonText } button` }
boxSize={ 5 }
borderRadius="sm"
mr={ 2 }
/>
<Text fontSize="sm" fontWeight="500" color="currentColor">
{ text }
{ appActionButtonText }
</Text>
</>
);
......
......@@ -7,7 +7,7 @@ export default function useAppActionData(address: string | undefined = '') {
const { data } = useAddressMetadataInfoQuery(memoizedArray);
const metadata = data?.addresses[address?.toLowerCase()];
const tag = metadata?.tags?.find(({ tagType }) => tagType === 'protocol');
if (tag?.meta?.actionURL || tag?.meta?.appID) {
if (tag?.meta?.appMarketplaceURL || tag?.meta?.appID) {
return tag.meta;
}
return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment