Repository navigation
Expand file tree
/
Copy pathNav.tsx
More file actions
70 lines (63 loc) · 1.75 KB
/
Copy pathNav.tsx
File metadata and controls
70 lines (63 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
8629
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import React, { useState } from "react";
import { ArrowRight, Menu, X } from "react-feather";
import tw from "twin.macro";
import { Link } from "./Link";
import { Logo } from "./Logo";
import { Search } from "./Search";
import { MobileSidebar } from "./Sidebar";
import { ThemeSwitcher } from "./ThemeSwitcher";
export const Nav: React.FC = () => {
return (
<header
css={[tw`hidden md:flex`, tw`items-center justify-end`, tw`px-8 py-6`]}
>
<ul>
<li>
<Link
href="https://railway.app/login"
tw="flex items-center space-x-2 text-gray-400 text-sm hover:text-pink-500"
>
<span>Go to Railway</span>
<ArrowRight tw="w-4 h-4" />
</Link>
</li>
</ul>
</header>
);
};
export const MobileNav: React.FC = () => {
const [isNavOpen, setIsNavOpen] = useState(false);
return (
<>
<header
css={[
tw`flex items-center justify-between space-x-6 md:hidden`,
tw`px-4 md:px-8 py-4 text-center`,
]}
>
<Link href="/">
<Logo tw="w-10 h-10" />
</Link>
{/* <div tw="w-full block">
<Search />
</div> */}
<div tw="flex items-center space-x-4 md:space-x-4">
<button
tw=" w-6 h-6 md:w-4 md:h-4 cursor-pointer focus:outline-none"
=> setIsNavOpen(!isNavOpen)}
>
{isNavOpen ? (
<X width="100%" height="100%" />
) : (
<Menu width="100%" height="100%" />
)}
</button>
<div tw="flex items-center">
<ThemeSwitcher />
</div>
</div>
</header>
<MobileSidebar isOpen={isNavOpen} />
</>
);
};