mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
rename meta props
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user