• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

decentraland / marketplace / 17803484780

17 Sep 2025 03:58PM UTC coverage: 67.558% (-0.002%) from 67.56%
17803484780

Pull #2490

github

braianj
fix: Refactor Navigation container
Pull Request #2490: fix: Refactor Navigation container

2928 of 5548 branches covered (52.78%)

Branch coverage included in aggregate %.

11 of 12 new or added lines in 1 file covered. (91.67%)

2 existing lines in 1 file now uncovered.

8394 of 11211 relevant lines covered (74.87%)

79.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.48
/webapp/src/modules/routing/selectors.ts
1
import { matchPath } from 'react-router'
34✔
2
import { getSearch as getRouterSearch, getLocation } from 'connected-react-router'
34✔
3
import { createSelector } from 'reselect'
34✔
4
import { EmotePlayMode, GenderFilterOption, Network, Rarity } from '@dcl/schemas'
34✔
5
import { t } from 'decentraland-dapps/dist/modules/translation/utils'
34✔
6
import { isOfEnumType } from '../../utils/enums'
34✔
7
import { AssetStatusFilter } from '../../utils/filters'
34✔
8
import { getAddress as getAccountAddress } from '../account/selectors'
34✔
9
import { AssetType } from '../asset/types'
34✔
10
import { RootState } from '../reducer'
11
import { getView } from '../ui/browse/selectors'
34✔
12
import { View } from '../ui/types'
13
import { isLandSection, isListsSection } from '../ui/utils'
34✔
14
import { Section, Sections } from '../vendor/routing/types'
34✔
15
import { VendorName } from '../vendor/types'
34✔
16
import { isVendor } from '../vendor/utils'
34✔
17
import { getAddress as getWalletAddress } from '../wallet/selectors'
34✔
18
import { locations } from './locations'
34✔
19
import { getDefaultOptionsByView, getURLParamArray, getURLParam, getURLParamArrayNonStandard, SEARCH_ARRAY_PARAM_SEPARATOR } from './search'
34✔
20
import { BrowseOptions, PageName, SortBy, SortByOption } from './types'
34✔
21

22
const getPathName = createSelector<RootState, ReturnType<typeof getLocation>, string>(getLocation, location => location.pathname)
34✔
23

24
export const getVendor = createSelector<RootState, string, VendorName>(getRouterSearch, search => {
34✔
25
  const vendor = getURLParam<VendorName>(search, 'vendor')
1✔
26
  if (vendor && isVendor(vendor)) {
1!
27
    return vendor
×
28
  }
29
  return VendorName.DECENTRALAND
1✔
30
})
31

32
export const getSection = createSelector<RootState, string, ReturnType<typeof getPathName>, VendorName, Section>(
37✔
33
  getRouterSearch,
34
  getPathName,
35
  getVendor,
36
  (search, pathname, vendor) => {
37
    const section = getURLParam<string>(search, 'section') ?? ''
8✔
38
    if (!section && pathname === locations.lands()) {
8✔
39
      return Sections.decentraland.LAND
1✔
40
    }
41

42
    if (!section && pathname === locations.names()) {
7✔
43
      return Sections.decentraland.ENS
1✔
44
    }
45

46
    if (
6✔
47
      (!section || (isOfEnumType(section, Sections[vendor]) && section === Sections[vendor].ALL)) &&
19✔
48
      pathname === locations.browse() &&
49
      vendor === VendorName.DECENTRALAND
50
    ) {
51
      return Sections.decentraland.WEARABLES
2✔
52
    }
53

54
    if (!section || !(section.toUpperCase() in Sections[vendor])) {
4✔
55
      return Sections[vendor].ALL
2✔
56
    }
57

58
    return section as Section
2✔
59
  }
60
)
61

62
export const getPageNumber = createSelector<RootState, string, number>(getRouterSearch, search => {
34✔
63
  const page = getURLParam(search, 'page')
×
64
  return page === null || isNaN(+page) ? 1 : +page
×
65
})
66

67
export const getSortBy = createSelector<RootState, string, View | undefined, Section, SortBy | undefined>(
34✔
68
  getRouterSearch,
69
  getView,
70
  getSection,
71
  (search, view, section) => {
72
    return getURLParam<SortBy>(search, 'sortBy') || getDefaultOptionsByView(view, section).sortBy
7✔
73
  }
74
)
75

76
export const getOnlyOnSale = createSelector<RootState, string, View | undefined, Section | undefined, boolean | undefined>(
34✔
77
  getRouterSearch,
78
  getView,
79
  getSection,
80
  (search, view, section) => {
81
    const onlyOnSale = getURLParam(search, 'onlyOnSale')
1✔
82
    switch (onlyOnSale) {
1!
83
      case 'true':
84
        return true
×
85
      case 'false':
86
        return false
×
87
      default:
88
        return isLandSection(section) ? undefined : getDefaultOptionsByView(view, section).onlyOnSale!
1!
89
    }
90
  }
91
)
92

93
export const getOnlyOnRent = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search => {
34✔
94
  const onlyOnRent = getURLParam(search, 'onlyOnRent')
4✔
95
  switch (onlyOnRent) {
4✔
96
    case 'true':
97
      return true
1✔
98
    case 'false':
99
      return false
1✔
100
    default:
101
      return undefined
2✔
102
  }
103
})
104

105
export const getAllSortByOptions = () => ({
34✔
106
  [SortBy.NEWEST]: { value: SortBy.NEWEST, text: t('filters.newest') },
107
  [SortBy.NAME]: { value: SortBy.NAME, text: t('filters.name') },
108
  [SortBy.RECENTLY_SOLD]: {
109
    value: SortBy.RECENTLY_SOLD,
110
    text: t('filters.recently_sold')
111
  },
112
  [SortBy.CHEAPEST]: {
113
    value: SortBy.CHEAPEST,
114
    text: t('filters.cheapest')
115
  },
116
  [SortBy.MOST_EXPENSIVE]: {
117
    value: SortBy.MOST_EXPENSIVE,
118
    text: t('filters.most_expensive')
119
  },
120
  [SortBy.MAX_RENTAL_PRICE]: {
121
    value: SortBy.MAX_RENTAL_PRICE,
122
    text: t('filters.cheapest')
123
  },
124
  [SortBy.RECENTLY_LISTED]: {
125
    value: SortBy.RECENTLY_LISTED,
126
    text: t('filters.recently_listed')
127
  },
128
  [SortBy.RENTAL_LISTING_DATE]: {
129
    value: SortBy.RENTAL_LISTING_DATE,
130
    text: t('filters.recently_listed_for_rent')
131
  }
132
})
133

134
export const getStatus = createSelector<RootState, string, AssetStatusFilter>(
34✔
135
  getRouterSearch,
136
  search => getURLParamArray<AssetStatusFilter>(search, 'status', Object.values(AssetStatusFilter))[0]
1✔
137
)
138

139
export const getSortByOptions = createSelector<RootState, boolean | undefined, boolean | undefined, string, SortByOption[]>(
34✔
140
  getOnlyOnRent,
141
  getOnlyOnSale,
142
  getStatus,
143
  (onlyOnRent, onlyOnSale, status) => {
144
    const SORT_BY_MAP = getAllSortByOptions()
6✔
145
    let orderByDropdownOptions: SortByOption[] = []
6✔
146
    if (status && isOfEnumType(status, AssetStatusFilter)) {
6✔
147
      const baseFilters = [
4✔
148
        SORT_BY_MAP[SortBy.NEWEST],
149
        SORT_BY_MAP[SortBy.RECENTLY_LISTED],
150
        SORT_BY_MAP[SortBy.RECENTLY_SOLD],
151
        SORT_BY_MAP[SortBy.CHEAPEST],
152
        SORT_BY_MAP[SortBy.MOST_EXPENSIVE]
153
      ]
154
      switch (status) {
4✔
155
        case AssetStatusFilter.ON_SALE:
156
        case AssetStatusFilter.ONLY_MINTING:
157
        case AssetStatusFilter.ONLY_LISTING:
158
          orderByDropdownOptions = baseFilters
3✔
159
          break
3✔
160
        case AssetStatusFilter.NOT_FOR_SALE:
161
          orderByDropdownOptions = [SORT_BY_MAP[SortBy.NEWEST]]
1✔
162
          break
1✔
163
      }
164
      return orderByDropdownOptions
4✔
165
    }
166
    if (onlyOnRent) {
2✔
167
      orderByDropdownOptions = [
1✔
168
        {
169
          value: SortBy.RENTAL_LISTING_DATE,
170
          text: t('filters.recently_listed_for_rent')
171
        },
172
        { value: SortBy.NAME, text: t('filters.name') },
173
        { value: SortBy.NEWEST, text: t('filters.newest') },
174
        { value: SortBy.MAX_RENTAL_PRICE, text: t('filters.cheapest') }
175
      ]
176
    } else {
177
      orderByDropdownOptions = [
1✔
178
        { value: SortBy.NEWEST, text: t('filters.newest') },
179
        { value: SortBy.NAME, text: t('filters.name') }
180
      ]
181
    }
182

183
    if (onlyOnSale) {
2✔
184
      orderByDropdownOptions = [
1✔
185
        {
186
          value: SortBy.RECENTLY_LISTED,
187
          text: t('filters.recently_listed')
188
        },
189
        {
190
          value: SortBy.RECENTLY_SOLD,
191
          text: t('filters.recently_sold')
192
        },
193
        {
194
          value: SortBy.CHEAPEST,
195
          text: t('filters.cheapest')
196
        },
197
        ...orderByDropdownOptions
198
      ]
199
    }
200

201
    return orderByDropdownOptions
2✔
202
  }
203
)
204

205
export const getIsSoldOut = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search => {
34✔
206
  const isSoldOut = getURLParam(search, 'isSoldOut')
×
207
  return isSoldOut === 'true'
×
208
})
209

210
export const getIsMap = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search => {
34✔
211
  const isMap = getURLParam(search, 'isMap')
3✔
212
  return isMap === null ? undefined : isMap === 'true'
3✔
213
})
214

215
export const getItemId = createSelector<RootState, string, string | undefined>(getRouterSearch, search => {
34✔
216
  const itemId = getURLParam(search, 'itemId')
×
217
  return itemId ? itemId : undefined
×
218
})
219

220
export const getIsFullscreen = createSelector<RootState, string, boolean | undefined, boolean | undefined>(
34✔
221
  getRouterSearch,
222
  getIsMap,
223
  (search, isMap) => {
UNCOV
224
    const isFullscreen = getURLParam(search, 'isFullscreen')
×
UNCOV
225
    return isFullscreen === null ? undefined : isMap && isFullscreen === 'true'
×
226
  }
227
)
228

229
export const getRarities = createSelector<RootState, string, Rarity[]>(getRouterSearch, search =>
34✔
230
  getURLParamArrayNonStandard<Rarity>(search, 'rarities', Object.values(Rarity).filter(value => typeof value === 'string') as string[])
14✔
231
)
232

233
export const getWearableGenders = createSelector<RootState, string, GenderFilterOption[]>(getRouterSearch, search =>
34✔
234
  getURLParamArrayNonStandard<GenderFilterOption>(search, 'genders', Object.values(GenderFilterOption))
1✔
235
)
236

237
export const getContracts = createSelector<RootState, string, string[]>(
34✔
238
  getRouterSearch,
239
  search => getURLParam<string>(search, 'contracts')?.split(SEARCH_ARRAY_PARAM_SEPARATOR) || []
2✔
240
)
241

242
export const getCreators = createSelector<RootState, string, string[]>(getRouterSearch, search =>
34✔
243
  getURLParamArray<string>(search, 'creators')
2✔
244
)
245

246
export const getSearch = createSelector<RootState, string, string>(getRouterSearch, search => getURLParam(search, 'search') || '')
34!
247

248
export const getNetwork = createSelector<RootState, string, Network | undefined>(
34✔
249
  getRouterSearch,
250
  search => (getURLParam(search, 'network') as Network) || undefined
1✔
251
)
252

253
export const getAssetType = createSelector<RootState, string, string, VendorName, AssetType>(
34✔
254
  getRouterSearch,
255
  getPathName,
256
  getVendor,
257
  (search, pathname, vendor) => {
258
    const assetTypeParam = getURLParam(search, 'assetType') ?? ''
5✔
259

260
    if (!assetTypeParam || !(assetTypeParam.toUpperCase() in AssetType)) {
5✔
261
      if (vendor === VendorName.DECENTRALAND && pathname === locations.browse()) {
4✔
262
        return AssetType.ITEM
2✔
263
      }
264

265
      return AssetType.NFT
2✔
266
    }
267
    return assetTypeParam as AssetType
1✔
268
  }
269
)
270

271
export const getEmotePlayMode = createSelector<RootState, string, EmotePlayMode[] | undefined>(
34✔
272
  getRouterSearch,
273
  search => getURLParamArray<EmotePlayMode>(search, 'emotePlayMode') || undefined
1!
274
)
275

276
export const getViewAsGuest = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search =>
34✔
277
  getURLParam(search, 'viewAsGuest') ? getURLParam(search, 'viewAsGuest') === 'true' : undefined
3✔
278
)
279
export const getOnlySmart = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search =>
34✔
280
  getURLParam(search, 'onlySmart') ? getURLParam(search, 'onlySmart') === 'true' : undefined
4✔
281
)
282

283
export const getMinPrice = createSelector<RootState, string, string>(
34✔
284
  getRouterSearch,
285
  search => (getURLParam(search, 'minPrice') as string) || ''
1!
286
)
287

288
export const getMaxPrice = createSelector<RootState, string, string>(
34✔
289
  getRouterSearch,
290
  search => (getURLParam(search, 'maxPrice') as string) || ''
1!
291
)
292

293
export const getMinEstateSize = createSelector<RootState, string, string>(
34✔
294
  getRouterSearch,
295
  search => (getURLParam(search, 'minEstateSize') as string) || ''
2✔
296
)
297

298
export const getMaxEstateSize = createSelector<RootState, string, string>(
34✔
299
  getRouterSearch,
300
  search => (getURLParam(search, 'maxEstateSize') as string) || ''
2✔
301
)
302

303
export const getRentalDays = createSelector<RootState, string, number[]>(getRouterSearch, search =>
34✔
304
  getURLParamArray(search, 'rentalDays').map(value => Number.parseInt(value))
1✔
305
)
306

307
export const getMinDistanceToPlaza = createSelector<RootState, string, string>(
34✔
308
  getRouterSearch,
309
  search => (getURLParam(search, 'minDistanceToPlaza') as string) || ''
1✔
310
)
311

312
export const getMaxDistanceToPlaza = createSelector<RootState, string, string>(
34✔
313
  getRouterSearch,
314
  search => (getURLParam(search, 'maxDistanceToPlaza') as string) || ''
1✔
315
)
316

317
export const getAdjacentToRoad = createSelector<RootState, string, boolean>(
34✔
318
  getRouterSearch,
319
  search => getURLParam(search, 'adjacentToRoad') === 'true'
1✔
320
)
321

322
export const getEmoteHasSound = createSelector<RootState, string, boolean>(
34✔
323
  getRouterSearch,
324
  search => getURLParam(search, 'emoteHasSound') === 'true'
1✔
325
)
326

327
export const getEmoteHasGeometry = createSelector<RootState, string, boolean>(
34✔
328
  getRouterSearch,
329
  search => getURLParam(search, 'emoteHasGeometry') === 'true'
1✔
330
)
331

332
export const getWithCredits = createSelector<RootState, string, boolean | undefined>(getRouterSearch, search =>
34✔
333
  getURLParam(search, 'withCredits') ? getURLParam(search, 'withCredits') === 'true' : undefined
×
334
)
335

336
export const getCurrentLocationAddress = createSelector<RootState, string, string | undefined, string | undefined, string | undefined>(
34✔
337
  getPathName,
338
  getWalletAddress,
339
  getAccountAddress,
340
  (pathname, walletAddress, accountAddress) => {
341
    let address: string | undefined
342

343
    if (pathname === locations.currentAccount()) {
×
344
      address = walletAddress
×
345
    } else {
346
      address = accountAddress
×
347
    }
348

349
    return address ? address.toLowerCase() : undefined
×
350
  }
351
)
352

353
export const getPaginationUrlParams = createSelector(getPageNumber, getSortBy, getSearch, (page, sortBy, search) => ({
34✔
354
  page,
355
  sortBy,
356
  search
357
}))
358

359
export const getAssetsUrlParams = createSelector(
34✔
360
  getOnlyOnSale,
361
  getOnlySmart,
362
  getIsSoldOut,
363
  getItemId,
364
  getContracts,
365
  getCreators,
366
  getSearch,
367
  getWithCredits,
368
  (onlyOnSale, onlySmart, isSoldOut, itemId, contracts, creators, search, withCredits) => ({
×
369
    onlyOnSale,
370
    onlySmart,
371
    isSoldOut,
372
    itemId,
373
    contracts,
374
    creators,
375
    search,
376
    withCredits
377
  })
378
)
379

380
export const getLandsUrlParams = createSelector(
34✔
381
  getIsMap,
382
  getIsFullscreen,
383
  getMinEstateSize,
384
  getMaxEstateSize,
385
  getMinDistanceToPlaza,
386
  getMaxDistanceToPlaza,
387
  getAdjacentToRoad,
388
  getRentalDays,
389
  (isMap, isFullscreen, minEstateSize, maxEstateSize, minDistanceToPlaza, maxDistanceToPlaza, adjacentToRoad, rentalDays) => ({
×
390
    isMap,
391
    isFullscreen,
392
    minEstateSize,
393
    maxEstateSize,
394
    minDistanceToPlaza,
395
    maxDistanceToPlaza,
396
    adjacentToRoad,
397
    rentalDays
398
  })
399
)
400

401
export const getWearablesUrlParams = createSelector(
34✔
402
  getRarities,
403
  getWearableGenders,
404
  getView,
405
  getViewAsGuest,
406
  getMinPrice,
407
  getMaxPrice,
408
  getStatus,
409
  (rarities, wearableGenders, view, viewAsGuest, minPrice, maxPrice, status) => ({
×
410
    rarities,
411
    wearableGenders,
412
    view,
413
    viewAsGuest,
414
    minPrice,
415
    maxPrice,
416
    status
417
  })
418
)
419

420
export const getEmoteUrlParams = createSelector(
34✔
421
  [getEmotePlayMode, getEmoteHasGeometry, getEmoteHasSound],
422
  (emotePlayMode, emoteHasGeometry, emoteHasSound) => ({
×
423
    emotePlayMode,
424
    emoteHasGeometry,
425
    emoteHasSound
426
  })
427
)
428

429
export const getCurrentBrowseOptions = createSelector(
66✔
430
  [
431
    getAssetType,
432
    getCurrentLocationAddress,
433
    getVendor,
434
    getSection,
435
    getNetwork,
436
    getPaginationUrlParams,
437
    getAssetsUrlParams,
438
    getLandsUrlParams,
439
    getWearablesUrlParams,
440
    getOnlyOnRent,
441
    getOnlyOnSale,
442
    getEmoteUrlParams
443
  ],
444
  (
445
    assetType,
446
    address,
447
    vendor,
448
    section,
449
    network,
450
    paginationUrlParams,
451
    AssetsUrlParams,
452
    landsUrlParams,
453
    wearablesUrlParams,
454
    onlyOnRent,
455
    onlyOnSale,
456
    emoteUrlParams
457
  ) =>
458
    ({
×
459
      assetType,
460
      address,
461
      vendor,
462
      section,
463
      network,
464
      ...emoteUrlParams,
465
      ...AssetsUrlParams,
466
      ...paginationUrlParams,
467
      ...landsUrlParams,
468
      ...wearablesUrlParams,
469
      onlyOnRent,
470
      onlyOnSale
471
    }) as BrowseOptions
472
)
473

474
export const getCurrentSearch = createSelector([getAssetsUrlParams], AssetsUrlParams => {
34✔
475
  const { search } = AssetsUrlParams
×
476
  return search
×
477
})
478

479
export const hasFiltersEnabled = createSelector<RootState, BrowseOptions, boolean>(getCurrentBrowseOptions, browseOptions => {
34✔
480
  const {
481
    network,
482
    wearableGenders,
483
    rarities,
484
    contracts,
485
    emotePlayMode,
486
    onlyOnRent,
487
    onlyOnSale,
488
    minPrice,
489
    maxPrice,
490
    minEstateSize,
491
    maxEstateSize,
492
    section,
493
    minDistanceToPlaza,
494
    maxDistanceToPlaza,
495
    adjacentToRoad,
496
    creators,
497
    rentalDays,
498
    status,
499
    onlySmart,
500
    emoteHasGeometry,
501
    emoteHasSound
502
  } = browseOptions
17✔
503
  const isLand = isLandSection(section as Section)
17✔
504

505
  if (isListsSection(section as Section)) return false
17✔
506

507
  if (isLand) {
16✔
508
    const hasOnSaleFilter = onlyOnSale === true
2✔
509
    const hasOnRentFilter = onlyOnRent === true
2✔
510
    return (
2✔
511
      (hasOnSaleFilter && !hasOnRentFilter) ||
11!
512
      (hasOnRentFilter && !hasOnSaleFilter) ||
513
      !!minPrice ||
514
      !!maxPrice ||
515
      !!minEstateSize ||
516
      !!maxEstateSize ||
517
      !!minDistanceToPlaza ||
518
      !!maxDistanceToPlaza ||
519
      !!adjacentToRoad ||
520
      !!rentalDays?.length
521
    )
522
  }
523

524
  const hasNetworkFilter = network !== undefined
14✔
525
  const hasGenderFilter = wearableGenders && wearableGenders.length > 0
14✔
526
  const hasRarityFilter = rarities && rarities.length > 0
14✔
527
  const hasContractsFilter = contracts && contracts.length > 0
14✔
528
  const hasCreatorFilter = creators && creators.length > 0
14✔
529
  const hasEmotePlayModeFilter = emotePlayMode && emotePlayMode.length > 0
14✔
530
  const hasNotOnSaleFilter = onlyOnSale === false
14✔
531

532
  return (
14✔
533
    hasNetworkFilter ||
124✔
534
    hasGenderFilter ||
535
    onlySmart ||
536
    hasRarityFilter ||
537
    hasContractsFilter ||
538
    hasCreatorFilter ||
539
    hasEmotePlayModeFilter ||
540
    !!minPrice ||
541
    !!maxPrice ||
542
    hasNotOnSaleFilter ||
543
    emoteHasSound ||
544
    emoteHasGeometry ||
545
    (!!status && status !== AssetStatusFilter.ON_SALE)
546
  )
547
})
548

549
export const getIsBuyWithCardPage = createSelector<RootState, string, boolean>(getRouterSearch, search => {
34✔
550
  const withCard = getURLParam(search, 'withCard')
×
551
  return withCard !== null && withCard === 'true'
×
552
})
553

554
const buildExactMatchProps = (path: string) => {
34✔
555
  return { path, exact: true }
43✔
556
}
557

558
export const getPageName = createSelector<RootState, string, PageName>(getPathName, pathname => {
34✔
559
  if (pathname === '/') {
23✔
560
    return PageName.HOME
1✔
561
  } else if (matchPath(pathname, buildExactMatchProps(locations.manage('anAddress', 'anId')))) {
22✔
562
    return PageName.MANAGE_NFT
1✔
563
  } else if (matchPath(pathname, buildExactMatchProps(locations.buyStatusPage(AssetType.NFT)))) {
21✔
564
    return PageName.BUY_NFT_STATUS
1✔
565
  } else if (matchPath(pathname, locations.buyStatusPage(AssetType.ITEM))) {
20✔
566
    return PageName.BUY_ITEM_STATUS
1✔
567
  } else if (matchPath(pathname, locations.cancel())) {
19✔
568
    return PageName.CANCEL_NFT_SALE
1✔
569
  } else if (matchPath(pathname, locations.transfer())) {
18✔
570
    return PageName.TRANSFER_NFT
1✔
571
  } else if (matchPath(pathname, locations.bid())) {
17✔
572
    return PageName.BID_NFT
1✔
573
  } else if (matchPath(pathname, locations.signIn())) {
16✔
574
    return PageName.SIGN_IN
1✔
575
  } else if (matchPath(pathname, locations.settings())) {
15✔
576
    return PageName.SETTINGS
1✔
577
  } else if (matchPath(pathname, locations.lands())) {
14✔
578
    return PageName.LANDS
1✔
579
  } else if (matchPath(pathname, locations.names())) {
13!
580
    return PageName.NAMES
×
581
  } else if (matchPath(pathname, locations.collection())) {
13✔
582
    return PageName.COLLECTION
1✔
583
  } else if (matchPath(pathname, locations.browse())) {
12✔
584
    return PageName.BROWSE
1✔
585
  } else if (matchPath(pathname, locations.campaign())) {
11✔
586
    return PageName.CAMPAIGN
1✔
587
  } else if (matchPath(pathname, locations.currentAccount())) {
10✔
588
    return PageName.ACCOUNT
1✔
589
  } else if (matchPath(pathname, locations.list())) {
9✔
590
    return PageName.LIST
1✔
591
  } else if (matchPath(pathname, locations.lists())) {
8✔
592
    return PageName.LISTS
1✔
593
  } else if (matchPath(pathname, locations.account())) {
7✔
594
    return PageName.ACCOUNTS
1✔
595
  } else if (matchPath(pathname, locations.nft())) {
6✔
596
    return PageName.NFT_DETAIL
1✔
597
  } else if (matchPath(pathname, locations.item())) {
5✔
598
    return PageName.ITEM_DETAIL
1✔
599
  } else if (matchPath(pathname, locations.parcel())) {
4✔
600
    return PageName.PARCEL_DETAIL
1✔
601
  } else if (matchPath(pathname, locations.estate())) {
3✔
602
    return PageName.ESTATE_DETAIL
1✔
603
  } else if (matchPath(pathname, locations.activity())) {
2✔
604
    return PageName.ACTIVITY
1✔
605
  }
606
  throw new Error('Unknown page')
1✔
607
})
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc