Skip to content

Commit

Permalink
adjust filter for POAP to include 2025 poap
Browse files Browse the repository at this point in the history
  • Loading branch information
encryptedDegen committed Jan 1, 2025
1 parent 0751d36 commit 409a394
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/navigation/components/wallet-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import { Avatar } from '#/components/avatar'
import { resolveEnsProfile } from '#/utils/ens'
import { fetchPoapLink } from '#/api/fetch-poap'
import { cn, truncateAddress } from '#/lib/utilities'
import { EARLY_POAP_EVENT_IDS } from '#/lib/constants'
import { useAutoConnect } from '#/hooks/useAutoConnect'
import LoadingCell from '#/components/loaders/loading-cell'
import GreenCheck from 'public/assets/icons/check-green.svg'
import { useEFPProfile } from '#/contexts/efp-profile-context'
import EarlyUserPoap2024 from 'public/assets/art/early-user-poap-2024.svg'
import EarlyUserPoap2025 from 'public/assets/art/early-user-poap-2025.svg'
import { useAchievements } from '#/components/user-profile-card/components/achievements/hooks/use-achievements'

Expand Down Expand Up @@ -83,15 +83,13 @@ const WalletMenu: React.FC<WalletMenuProps> = ({ isResponsive = true }) => {
address: userAddress,
list: selectedList
})
const hasEarlyPoap = ownedBadges.find(badge => badge.eventId === '178066')
const hasEarlyPoap = ownedBadges.find(badge => EARLY_POAP_EVENT_IDS.includes(badge.eventId))
const canMintEarlyPoap = !(isBadgesLoading || ensProfileIsLoading) && typeof lists?.primary_list === 'string' && (userAddress && !!ensProfile?.name && !hasEarlyPoap)

const { data: poap, isLoading: poapLoading } = useQuery({
queryKey: ['poap-link', canMintEarlyPoap, ensProfile, ownedBadges],
queryFn: async () => (canMintEarlyPoap ? await fetchPoapLink(userAddress) : null)
})
const now = new Date().getTime()
const is2025 = now > new Date('2025-01-01').getTime()

useAutoConnect()

Expand Down Expand Up @@ -252,8 +250,7 @@ const WalletMenu: React.FC<WalletMenuProps> = ({ isResponsive = true }) => {
<FiExternalLink className='text-2xl' />
<div className='flex gap-2 items-center'>
<p className='text-end'>{`${t('get poap')}`}</p>
<Image src={is2025 ? EarlyUserPoap2025 : EarlyUserPoap2024} alt='Early user Poap' width={30} height={30} />

<Image src={EarlyUserPoap2025} alt='Early user Poap' width={30} height={30} />
</div>
</Link>
)}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export const DEFAULT_TAGS_TO_ADD = ['irl', 'bff', 'based', 'degen', 'top8']

export const SORT_OPTIONS: FollowSortType[] = ['follower count', 'latest first', 'earliest first']

export const EARLY_POAP_EVENT_IDS = ['178066', '183182']

export const NAV_ITEMS = [
{
href: () => '/',
Expand Down

0 comments on commit 409a394

Please sign in to comment.