Remove top creators and top followed from leaderboards

This commit is contained in:
James Grugett 2022-07-15 00:50:52 -05:00
parent bfc1f38477
commit c15292e2cb

View File

@ -46,9 +46,7 @@ export default function Leaderboards(props: {
topCreators: [], topCreators: [],
topFollowed: [], topFollowed: [],
} }
const { topFollowed } = props
const [topTradersState, setTopTraders] = useState(props.topTraders) const [topTradersState, setTopTraders] = useState(props.topTraders)
const [topCreatorsState, setTopCreators] = useState(props.topCreators)
const [isLoading, setLoading] = useState(false) const [isLoading, setLoading] = useState(false)
const [period, setPeriod] = useState<Period>('allTime') const [period, setPeriod] = useState<Period>('allTime')
@ -56,7 +54,6 @@ export default function Leaderboards(props: {
setLoading(true) setLoading(true)
queryLeaderboardUsers(period).then((res) => { queryLeaderboardUsers(period).then((res) => {
setTopTraders(res.props.topTraders as User[]) setTopTraders(res.props.topTraders as User[])
setTopCreators(res.props.topCreators as User[])
setLoading(false) setLoading(false)
}) })
}, [period]) }, [period])
@ -84,39 +81,11 @@ export default function Leaderboards(props: {
) : ( ) : (
<></> <></>
)} )}
<Leaderboard
title="🏅 Top creators"
users={topCreatorsState}
columns={[
{
header: 'Total bet',
renderCell: (user) =>
formatMoney(user.creatorVolumeCached[period]),
},
]}
/>
</> </>
) : ( ) : (
<LoadingIndicator spinnerClassName={'border-gray-500'} /> <LoadingIndicator spinnerClassName={'border-gray-500'} />
)} )}
</Col> </Col>
{period === 'allTime' ? (
<Col className="mx-4 my-10 items-center gap-10 lg:mx-0 lg:w-1/2 lg:flex-row">
<Leaderboard
title="🏅 Top followed"
users={topFollowed}
columns={[
{
header: 'Total followers',
renderCell: (user) => user.followerCountCached,
},
]}
/>
</Col>
) : (
<></>
)}
</> </>
) )
} }