{props.formatted.days
? ` ${props.formatted.days}d ${props.formatted.hours}h ${props.formatted.minutes}m ${props.formatted.seconds}s`
: ` ${props.formatted.hours}:${props.formatted.minutes}:${props.formatted.seconds}`}
}
/>}
>
)
}
export default function Rewards ({ ssrData }) {
// only poll for updates to rewards and not leaderboard
const { data: rewardsData } = useQuery(
REWARDS,
SSR ? {} : { pollInterval: 1000, nextFetchPolicy: 'cache-and-network' })
const { data } = useQuery(REWARDS_FULL)
if (!data && !ssrData) return
let { rewards: [{ total, sources, time, leaderboard }] } = useData(data, ssrData)
if (rewardsData?.rewards?.length > 0) {
total = rewardsData.rewards[0].total
sources = rewardsData.rewards[0].sources
time = rewardsData.rewards[0].time
}
function EstimatedReward ({ rank }) {
const totalRest = total - 1000000
return (
estimated reward: {numWithUnits(rank === 1 ? 1000000 : Math.floor(totalRest * proportions[rank - 2]))}
)
}
return (
bitcoin++ is a developer-focused conference series.
Join us in Austin May 1-4 for a deep dive into bitcoin script.
{leaderboard?.users &&
leaderboard
}
)
}
export function DonateButton () {
const showModal = useShowModal()
const toaster = useToast()
const strike = useLightning()
const [donateToRewards] = useMutation(
gql`
mutation donateToRewards($sats: Int!, $hash: String, $hmac: String) {
donateToRewards(sats: $sats, hash: $hash, hmac: $hmac)
}`)
return (
<>
>
)
}