fix claim flicker when no claim
This commit is contained in:
parent
26baa956dd
commit
3dc7a7edd4
|
@ -30,19 +30,18 @@ const Season = ({
|
|||
}: {
|
||||
setShowLeaderboards: (x: string) => void
|
||||
}) => {
|
||||
const { t } = useTranslation(['common', 'rewards'])
|
||||
const { t } = useTranslation(['common', 'governance', 'rewards'])
|
||||
const { wallet } = useWallet()
|
||||
const faqRef = useRef<HTMLDivElement>(null)
|
||||
const { mangoAccountAddress } = useMangoAccount()
|
||||
const [topAccountsTier, setTopAccountsTier] = useState('')
|
||||
const { data: seasonData, isLoading: loadingSeasonData } = useCurrentSeason()
|
||||
const { data: accountTier, isLoading: loadingAccountTier } = useAccountTier(
|
||||
mangoAccountAddress,
|
||||
seasonData?.season_id,
|
||||
)
|
||||
const { data: seasonData, isInitialLoading: loadingSeasonData } =
|
||||
useCurrentSeason()
|
||||
const { data: accountTier, isInitialLoading: loadingAccountTier } =
|
||||
useAccountTier(mangoAccountAddress, seasonData?.season_id)
|
||||
const {
|
||||
data: accountPointsAndRank,
|
||||
isLoading: loadingAccountPointsAndRank,
|
||||
isInitialLoading: loadingAccountPointsAndRank,
|
||||
refetch,
|
||||
} = useAccountPointsAndRank(mangoAccountAddress, seasonData?.season_id)
|
||||
|
||||
|
@ -187,7 +186,7 @@ const Season = ({
|
|||
</span>
|
||||
) : (
|
||||
<span className="flex items-center justify-center text-center font-body text-sm text-th-fgd-3">
|
||||
{t('connect-wallet')}
|
||||
{t('governance:connect-wallet')}
|
||||
</span>
|
||||
)
|
||||
) : (
|
||||
|
|
|
@ -100,8 +100,6 @@ const BalancesTable = () => {
|
|||
sortConfig,
|
||||
} = useSortableData(formattedTableData())
|
||||
|
||||
console.log(tableData)
|
||||
|
||||
return filteredBanks.length ? (
|
||||
showTableView ? (
|
||||
<Table>
|
||||
|
|
|
@ -78,7 +78,7 @@ export const useWalletPoints = (
|
|||
staleTime: 1000 * 60,
|
||||
retry: 3,
|
||||
refetchOnWindowFocus: false,
|
||||
enabled: !!wallet?.adapter && !!mangoAccountAddress,
|
||||
enabled: !!(wallet?.adapter && mangoAccountAddress),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ export const useIsAllClaimed = (
|
|||
prevSeason: number | undefined,
|
||||
walletPk: PublicKey | null,
|
||||
) => {
|
||||
const [isAllClaimed, setIsAllCliamed] = useState(false)
|
||||
const [isAllClaimed, setIsAllCliamed] = useState(true)
|
||||
const { data: distributionDataAndClient } = useDistribution(prevSeason)
|
||||
const distributionData = distributionDataAndClient?.distribution
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ export async function getStaticProps({ locale }: { locale: string }) {
|
|||
props: {
|
||||
...(await serverSideTranslations(locale, [
|
||||
'common',
|
||||
'governance',
|
||||
'notifications',
|
||||
'onboarding',
|
||||
'profile',
|
||||
|
@ -27,7 +28,7 @@ const Rewards: NextPage = () => {
|
|||
<div
|
||||
className={`pb-20 md:pb-0 ${themeData.fonts.rewards.variable} font-sans`}
|
||||
>
|
||||
{isWhiteListed && <RewardsPage />}
|
||||
{isWhiteListed ? <RewardsPage /> : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue