-
Notifications
You must be signed in to change notification settings - Fork 74
/
Header.tsx
38 lines (36 loc) · 933 Bytes
/
Header.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import Link from "next/link";
import { usePathname } from "next/navigation";
import { Connector, ConnectButton } from "@ant-design/web3";
import styles from "./styles.module.css";
export default function WtfHeader() {
const pathname = usePathname();
const isSwapPage = pathname === "/wtfswap";
return (
<div className={styles.header}>
<div className={styles.title}>WTFSwap</div>
<div className={styles.nav}>
<Link
href="/wtfswap"
className={isSwapPage ? styles.active : undefined}
>
Swap
</Link>
<Link
href="/wtfswap/pool"
className={!isSwapPage ? styles.active : undefined}
>
Pool
</Link>
</div>
<div>
<Connector
modalProps={{
mode: "simple",
}}
>
<ConnectButton type="text" />
</Connector>
</div>
</div>
);
}