Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: navigate to 'PSM' and 'Analytics' from the navigation bar #200

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ export const branchBridgeHref = (branchName: string) =>
export const signerTarget = 'wallet';

export const disclaimerHref = 'https://docs.inter.trade/disclaimer';

export const psmHref = 'https://psm.inter.trade/';

export const analyticsHref = 'https://info.inter.trade/';
18 changes: 16 additions & 2 deletions src/views/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { NavLink, Outlet, useLocation, Navigate } from 'react-router-dom';
import ConnectWalletButton from '../components/ConnectWalletButton';
import React, { Suspense } from 'react';
import { HiExternalLink } from 'react-icons/hi';
import { psmHref, analyticsHref } from '../config';

const NetworkDropdown = React.lazy(
() => import('../components/NetworkDropdown'),
Expand All @@ -9,19 +11,25 @@ const NetworkDropdown = React.lazy(
type NavItemProps = {
label: string;
href: string;
isExternal?: boolean;
};

const NavItem = ({ label, href }: NavItemProps) => {
const NavItem = ({ label, href, isExternal = false }: NavItemProps) => {
return (
<li>
<NavLink
className="h-full justify-between flex flex-col font-serif"
to={href}
target={isExternal ? '_blank' : ''}
>
{({ isActive }) => (
<>
<div className="h-1.5"></div>
<span className="m-2 font-bold">{label}</span>
<span className="inline-flex items-center">
<span className="m-2 font-bold">{label}</span>
{isExternal && <HiExternalLink />}
</span>

<div
className={
isActive
Expand Down Expand Up @@ -61,6 +69,12 @@ const Root = () => {
<nav>
<ul className="h-24 flex flex-row space-x-12">
<NavItem label="Vaults" href="/vaults" />
<NavItem label="PSM" href={psmHref} isExternal={true} />
<NavItem
label="Analytics"
href={analyticsHref}
isExternal={true}
/>
</ul>
</nav>
</div>
Expand Down
Loading