Skip to content

Commit

Permalink
fix: Remove exotic rarity (#2226)
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed Apr 22, 2024
1 parent f033cc9 commit dabe432
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { connect } from 'react-redux'
import { isLoadingType } from 'decentraland-dapps/dist/modules/loading/selectors'
import { fetchRankingsRequest, FETCH_RANKINGS_REQUEST } from '../../modules/analytics/actions'
import { getRankingsData, getLoading } from '../../modules/analytics/selectors'
import { getIsExoticRarityEnabled } from '../../modules/features/selectors'
import { RootState } from '../../modules/reducer'
import RankingsTable from './RankingsTable'
import { MapStateProps, MapDispatch, MapDispatchProps } from './RankingsTable.types'
Expand All @@ -11,7 +10,6 @@ const mapState = (state: RootState): MapStateProps => {
const data = getRankingsData(state)
return {
data,
isExoticRarityEnabled: getIsExoticRarityEnabled(state),
isLoading: isLoadingType(getLoading(state), FETCH_RANKINGS_REQUEST)
}
}
Expand Down
13 changes: 5 additions & 8 deletions webapp/src/components/RankingsTable/RankingsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const INITIAL_FILTERS = {
const TABS_PREFIX = '#rankings-'

const RankingsTable = (props: Props) => {
const { isLoading, isExoticRarityEnabled, onFetchRankings, data } = props
const { isLoading, onFetchRankings, data } = props

const history = useHistory()
const location = useLocation()
Expand Down Expand Up @@ -113,13 +113,10 @@ const RankingsTable = (props: Props) => {
value={currentFilters.rarity || ALL_FILTER}
direction="right"
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
options={[ALL_FILTER, ...Rarity.getRarities()]
.filter(rarity => isExoticRarityEnabled || (rarity as Rarity) !== Rarity.EXOTIC)
.map(rarity => ({
value: rarity,
text:
rarity === ALL_FILTER ? t('home_page.analytics.rankings.all_rarities') : t(`rarity.${convertToOutputString(rarity)}`)
}))}
options={[ALL_FILTER, ...Rarity.getRarities()].map(rarity => ({
value: rarity,
text: rarity === ALL_FILTER ? t('home_page.analytics.rankings.all_rarities') : t(`rarity.${convertToOutputString(rarity)}`)
}))}
onChange={registerHandleFilterChange('rarity')}
/>
</>
Expand Down
3 changes: 1 addition & 2 deletions webapp/src/components/RankingsTable/RankingsTable.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import { RankingEntity } from '../../modules/analytics/types'
export type Props = {
data: RankingEntity[] | null
isLoading: boolean
isExoticRarityEnabled: boolean
onFetchRankings: typeof fetchRankingsRequest
}

export type MapStateProps = Pick<Props, 'data' | 'isLoading' | 'isExoticRarityEnabled'>
export type MapStateProps = Pick<Props, 'data' | 'isLoading'>
export type MapDispatchProps = Pick<Props, 'onFetchRankings'>
export type MapDispatch = Dispatch<FetchRankingsRequestAction>
7 changes: 0 additions & 7 deletions webapp/src/modules/features/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,3 @@ export const getIsLandCrossChainEnabled = (state: RootState) => {
}
return false
}

export const getIsExoticRarityEnabled = (state: RootState) => {
if (hasLoadedInitialFlags(state)) {
return getIsFeatureEnabled(state, ApplicationName.DAPPS, FeatureName.EXOTIC_RARITY)
}
return false
}
3 changes: 1 addition & 2 deletions webapp/src/modules/features/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ export enum FeatureName {
SMART_WEARABLES_FTU = 'smart-wearables-ftu',
MARKETPLACE_SERVER = 'marketplace-server',
CHAIN_SELECTOR = 'chain-selector',
CROSS_CHAIN_LANDS = 'cross-chain-lands',
EXOTIC_RARITY = 'exotic-rarity'
CROSS_CHAIN_LANDS = 'cross-chain-lands'
}

0 comments on commit dabe432

Please sign in to comment.