Skip to content

Commit

Permalink
feat: update decentraland-ui2 v0.11.2 decentraland-dapps v24.1 (#2376)
Browse files Browse the repository at this point in the history
* feat: update decentraland-ui2 v0.11.1 and decentraland-dapps v24

* feat: update getAnalytics behavior

* chore: update decentraland-ui2 v0.11.2 decentraland-dapps v24.1
  • Loading branch information
braianj authored Feb 12, 2025
1 parent 5a437a0 commit 6ae9c2c
Show file tree
Hide file tree
Showing 23 changed files with 245 additions and 49 deletions.
220 changes: 208 additions & 12 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"dcl-catalyst-commons": "^9.0.1",
"decentraland-connect": "^9.0.0",
"decentraland-crypto-fetch": "^1.0.3",
"decentraland-dapps": "^23.28.2",
"decentraland-dapps": "^24.1.0",
"decentraland-transactions": "^2.18.3",
"decentraland-ui": "^6.12.1",
"decentraland-ui2": "^0.10.1",
"decentraland-ui2": "^0.11.2",
"ethers": "^5.6.8",
"graphql": "^14.7.0",
"history": "^4.10.1",
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/AssetFilters/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ export function trackBarChartComponentChange(
const [filterMinName, filterMaxName] = filterNames
const [minValue, maxValue] = value
const [prevMinValue, prevMaxValue] = prevValues
if (minValue !== prevMinValue) {
if (minValue !== prevMinValue && analytics) {
analytics.track(eventsByProperty[filterMinName], {
value: minValue,
component: 'BarChart',
source
})
}

if (maxValue !== prevMaxValue) {
if (maxValue !== prevMaxValue && analytics) {
analytics.track(eventsByProperty[filterMaxName], {
value: maxValue,
component: 'BarChart',
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/AssetImage/AssetImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const AssetImage = (props: Props) => {
const isPreview = asset.category === NFTCategory.WEARABLE && isDraggable

if (!isTracked && isPreview) {
getAnalytics().track(events.INIT_PREVIEW, {
getAnalytics()?.track(events.INIT_PREVIEW, {
mode: isTryingOn ? 'avatar' : 'wearable'
})
setIsTracked(true)
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/AssetList/AssetList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const AssetList = (props: Props) => {
const handleLoadMore = useCallback(
(newPage: number) => {
onBrowse({ page: newPage })
getAnalytics().track(events.LOAD_MORE, { page: newPage })
getAnalytics()?.track(events.LOAD_MORE, { page: newPage })
},
[onBrowse]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const BuyNFTButtons = ({

const handleBuyWithCard = useCallback(
(asset: Asset, order?: Order) => {
analytics.track(events.CLICK_GO_TO_BUY_NFT_WITH_CARD)
analytics?.track(events.CLICK_GO_TO_BUY_NFT_WITH_CARD)
!isNFT(asset) ? onBuyItemWithCard(asset) : onExecuteOrderWithCard(asset, order)
},
[analytics, onBuyItemWithCard, onExecuteOrderWithCard]
Expand All @@ -47,7 +47,7 @@ const BuyNFTButtons = ({
if (!isConnecting && !wallet && !isBuyingWithCryptoModalOpen) {
history.replace(locations.signIn(`${location.pathname}?buyWithCrypto=true`))
} else {
analytics.track(events.CLICK_BUY_NFT_WITH_CRYPTO)
analytics?.track(events.CLICK_BUY_NFT_WITH_CRYPTO)
onBuyWithCrypto(asset, order)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const BuyWithCryptoButton = (props: Props) => {
(e: React.MouseEvent<HTMLButtonElement, MouseEvent>, data: ButtonProps) => {
const isClaimingName = isNFT(asset) && asset.category === NFTCategory.ENS && !asset.tokenId
const isMint = !!asset.itemId || isClaimingName
getAnalytics().track(events.BUY_WITH_CRYPTO, {
getAnalytics()?.track(events.BUY_WITH_CRYPTO, {
transaction_type: isMint ? 'mint' : 'secondary',
contract_address: isClaimingName ? undefined : asset.contractAddress,
token_id: isClaimingName ? undefined : isNFT(asset) ? asset.tokenId : asset.itemId,
Expand Down
Loading

0 comments on commit 6ae9c2c

Please sign in to comment.