Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/karma-button-topbar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'hub': patch
---

integrate KarmaButton components back into TopBar
6 changes: 3 additions & 3 deletions apps/hub/src/app/_components/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FeedbackPopover, Link } from '@status-im/status-network/components'
import Image from 'next/image'

import { ConnectButton } from './connect-button'
// import { KarmaButton } from './karma-button'
import { KarmaButton } from './karma-button'

interface TopBarProps {
onMenuToggle: () => void
Expand Down Expand Up @@ -79,8 +79,8 @@ export function TopBar({ onMenuToggle }: TopBarProps) {
</div>

{/* Karma Button */}
{/* <KarmaButton size="24" className="md:hidden" />
<KarmaButton size="32" className="hidden md:flex" /> */}
<KarmaButton size="24" className="md:hidden" />
<KarmaButton size="32" className="hidden md:flex" />

{/* Connect Wallet Button */}
<ConnectButton
Expand Down
5 changes: 3 additions & 2 deletions apps/hub/src/app/_hooks/useKarmaRewardsDistributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useQuery, type UseQueryResult } from '@tanstack/react-query'
import { type Address } from 'viem'
import { useAccount, useChainId, useConfig } from 'wagmi'
import { readContract } from 'wagmi/actions'
import { statusSepolia } from 'wagmi/chains'

import { CACHE_CONFIG, REWARDS } from '~constants/index'

Expand Down Expand Up @@ -178,8 +179,8 @@ export function useKarmaRewardsDistributor(
refetchInterval = CACHE_CONFIG.MP_REFETCH_INTERVAL,
} = options

// Use provided address or fall back to connected address
const targetAddress = queryAddress ?? connectedAddress
const isStatusNetworkSepolia = chainId === statusSepolia.id

return useQuery<KarmaRewardsBalanceData>({
queryKey: [QUERY_KEY_PREFIX, targetAddress, chainId] as const,
Expand Down Expand Up @@ -209,7 +210,7 @@ export function useKarmaRewardsDistributor(
throw error
}
},
enabled: enabled && !!targetAddress,
enabled: enabled && !!targetAddress && isStatusNetworkSepolia,
staleTime,
refetchInterval,
retry: 3,
Expand Down
Loading