stacker.news/components/footer-rewards.js
Keyan 0b0e36e3cb
Monthly rewards (#890)
* show placeholder for hidden stackers in top

* top rewardability views

* make territory revenue idependent job

* monthly rewards and leaderboard on rewards pages

* fix earn reschedule

* add query for rewards leaderboard

* reduce likelihood of rewards racing with views

* fix earn and refine values views
2024-03-01 10:28:55 -06:00

24 lines
647 B
JavaScript

import { gql, useQuery } from '@apollo/client'
import Link from 'next/link'
import { RewardLine } from '../pages/rewards'
import { SSR } from '../lib/constants'
const REWARDS = gql`
{
rewards {
total
time
}
}`
export default function Rewards () {
const { data } = useQuery(REWARDS, SSR ? { ssr: false } : { pollInterval: 60000, nextFetchPolicy: 'cache-and-network' })
const total = data?.rewards?.[0]?.total
const time = data?.rewards?.[0]?.time
return (
<Link href='/rewards' className='nav-link p-0 p-0 d-inline-flex'>
{total ? <span><RewardLine total={total} time={time} /></span> : 'rewards'}
</Link>
)
}