Skip to content

Commit

Permalink
fix rainbow profile links
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobar79 committed Dec 19, 2024
1 parent fde2ec0 commit 28c4198
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/buildRainbowUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ export function buildRainbowUrl(asset: UniqueAsset | null, accountENS: string, a
const address = accountENS || accountAddress;
const slug = asset?.collection?.slug;
const assetId = asset?.uniqueId;
const network = asset?.network ? (asset?.network + '_').replace('mainnet', 'ethereum') : '';

const familyString = slug ? `?family=${slug}` : '';
const assetString = slug && assetId?.toString() ? `&nft=${assetId?.toString()}` : '';
const assetString = slug && assetId?.toString() ? `&nft=${network}${assetId?.toString()}` : '';

const url = `${RAINBOW_PROFILES_BASE_URL}/${address}${familyString}${assetString}`;
const url = `${RAINBOW_PROFILES_BASE_URL}/profile/${address}${familyString}${assetString}`;
return url;
}

Expand Down

0 comments on commit 28c4198

Please sign in to comment.