-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c84a313
commit 20163fc
Showing
5 changed files
with
52 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Tabs } from 'antd' | ||
import router from 'next/router' | ||
import { useMyAddress } from 'src/components/auth/MyAccountsContext' | ||
|
||
export default function LeaderboardTabs({ | ||
activeKey, | ||
}: { | ||
activeKey: '' | 'user' | 'general' | 'stats' | ||
}) { | ||
const myAddress = useMyAddress() | ||
|
||
return ( | ||
<> | ||
<Tabs | ||
className='sm-hidden' | ||
activeKey={activeKey} | ||
onChange={key => { | ||
if (key === 'user') | ||
router.push(`/leaderboard/${myAddress}?role=staker`, undefined, { shallow: true }) | ||
else if (key === 'stats') router.push('/stats', undefined, { shallow: true }) | ||
else if (key === 'general') router.push('/leaderboard', undefined, { shallow: true }) | ||
}} | ||
> | ||
{myAddress && <Tabs.TabPane tab='My Staking Stats' key='user' />} | ||
<Tabs.TabPane tab='Global Staking Stats' key='general' /> | ||
<Tabs.TabPane tab='Polkaverse Activity' key='stats' /> | ||
</Tabs> | ||
<Tabs | ||
className='lg-hidden' | ||
activeKey={activeKey} | ||
onChange={key => { | ||
if (key === 'user') | ||
router.push(`/leaderboard/${myAddress}?role=staker`, undefined, { shallow: true }) | ||
else if (key === 'stats') router.push('/stats', undefined, { shallow: true }) | ||
else if (key === 'general') router.push('/leaderboard', undefined, { shallow: true }) | ||
}} | ||
> | ||
{myAddress && <Tabs.TabPane tab='My Activity' key='user' />} | ||
<Tabs.TabPane tab='Total Activity' key='general' /> | ||
<Tabs.TabPane tab='App Stats' key='stats' /> | ||
</Tabs> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters