Skip to content

Commit

Permalink
fix: add mainnet campaignId
Browse files Browse the repository at this point in the history
  • Loading branch information
schmanu committed May 22, 2024
1 parent b0ea801 commit 3375132
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/components/Points/CampaignLeaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { CHAIN_SHORT_NAME, SAFE_URL } from '@/config/constants'
import { ExternalLink } from '../ExternalLink'
import { Campaign } from '@/hooks/useCampaigns'
import { floorNumber } from '@/utils/boost'
import { useGlobalCampaignId } from '@/hooks/useGlobalCampaignId'

const PAGE_SIZE = 10

Expand Down Expand Up @@ -236,7 +237,9 @@ export const CampaignLeaderboard = ({ campaign }: { campaign?: Campaign }) => {
const [pages, setPages] = useState(1)
const { data: ownEntry } = useOwnCampaignRank(campaign?.resourceId)

const isGlobal = campaign?.resourceId === 'global'
const globalCampaignId = useGlobalCampaignId()

const isGlobal = campaign?.resourceId === globalCampaignId

return (
<Box key={campaign?.resourceId}>
Expand Down
7 changes: 6 additions & 1 deletion src/components/Points/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { GLOBAL_CAMPAIGN_IDS } from '@/config/constants'
import { useCampaignInfo, useCampaignPage } from '@/hooks/useCampaigns'
import { useChainId } from '@/hooks/useChainId'
import { Grid, Typography, Stack, Box } from '@mui/material'
import { useState } from 'react'
import { chain } from 'lodash'

Check failure on line 5 in src/components/Points/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint Results

unused-imports/no-unused-imports-ts

'chain' is defined but never used.
import { useEffect, useState } from 'react'
import { ExternalLink } from '../ExternalLink'
import PaperContainer from '../PaperContainer'
import SafePassDisclaimer from '../SafePassDisclaimer'
Expand All @@ -27,6 +28,10 @@ const Points = () => {

const [selectedTab, setSelectedTab] = useState(0)

useEffect(() => {
setSelectedCampaignId(GLOBAL_CAMPAIGN_IDS[chainId])
}, [chainId])

const onTabChange = (index: number) => {
setSelectedTab(index)
if (index === 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ export const SEASON1_START = 33

export const GLOBAL_CAMPAIGN_IDS: ChainConfig<string> = {
[Chains.SEPOLIA]: 'fa9f462b-8e8c-4122-aa41-2464e919b721',
[Chains.MAINNET]: 'fa9f462b-8e8c-4122-aa41-2464e919b721',
[Chains.MAINNET]: '9ed78b8b-178d-4e25-9ef2-1517865991ee',
}

0 comments on commit 3375132

Please sign in to comment.