Add link to serum academy in the menu

This commit is contained in:
Nathaniel Parke 2020-10-13 14:40:05 +08:00
parent 6783fbe8c8
commit 15c23bb11b
1 changed files with 12 additions and 1 deletions

View File

@ -33,6 +33,10 @@ const LogoWrapper = styled.div`
}
`;
const EXTERNAL_LINKS = {
'/learn': 'https://serum-academy.com/en/serum-dex/',
}
export default function TopBar() {
const { connected, wallet, providerUrl, setProvider } = useWallet();
const { endpoint, endpointInfo, setEndpoint, availableEndpoints, setCustomEndpoints } = useConnectionConfig();
@ -45,7 +49,9 @@ export default function TopBar() {
const handleClick = useCallback(
(e) => {
history.push(e.key);
if (!(e.key in EXTERNAL_LINKS)) {
history.push(e.key);
}
},
[history],
);
@ -123,6 +129,11 @@ export default function TopBar() {
}}
>
<Menu.Item key="/">TRADE</Menu.Item>
<Menu.Item key="/learn">
<a href={EXTERNAL_LINKS['/learn']} target="_blank" rel="noopener noreferrer">
LEARN
</a>
</Menu.Item>
</Menu>
<div>
<Row