forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMobileNav.js
More file actions
212 lines (211 loc) · 6.48 KB
/
MobileNav.js
File metadata and controls
212 lines (211 loc) · 6.48 KB
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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
import React, { useState } from 'react';
import { Link } from 'gatsby';
import { motion, AnimatePresence } from 'framer-motion';
import Logo from '../../assets/images/logo.svg';
import {
MobileNav,
LogoWrapper,
LogoImage,
PopUpNav,
Headers,
Items,
Pricing,
} from './elements';
import SupportIcon from '../../assets/icons/Support';
import StatusIcon from '../../assets/icons/Status';
import PricingIcon from '../../assets/icons/Pricing';
// import LearnIcon from '../../assets/icons/Learn';
import DocsIcon from '../../assets/icons/Docs';
import BlogIcon from '../../assets/icons/Blog';
import IDEIcon from '../../assets/icons/Ide';
import EmbedIcon from '../../assets/icons/Embed';
import CIIcon from '../../assets/icons/Ci';
import TeamsIcon from '../../assets/icons/Teams';
import SearchIcon from '../../assets/icons/Search';
import HighlightedICon from '../../assets/icons/Highlighted';
import Button from '../Button';
// import NewIcon from '../../assets/icons/New';
export default () => {
const [open, setOpen] = useState(false);
return (
<>
<MobileNav>
<LogoWrapper to="/">
<LogoImage src={Logo} alt="CodeSandbox Logo" />
CodeSandbox
</LogoWrapper>
<div>
<a href="https://codesandbox.io/signin">Sign In</a>
{open ? (
<svg
onClick={() => setOpen(!open)}
width="19"
height="16"
viewBox="0 0 16 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M7.77698 8.7747L14.1421 15.1399L14.9524 14.3296L8.5872 7.96448L15.0711 1.48059L14.2609 0.670365L7.77698 7.15425L0.810227 0.1875L0 0.997727L6.96675 7.96448L0.118729 14.8125L0.928955 15.6227L7.77698 8.7747Z"
fill="white"
/>
</svg>
) : (
<svg
onClick={() => setOpen(!open)}
width="19"
height="16"
viewBox="0 0 19 16"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M19 2.14193H0V0.996094H19V2.14193ZM19 8.57552H0V7.42969H19V8.57552ZM0 15.0013H19V13.8555H0V15.0013Z"
fill="white"
/>
</svg>
)}
</div>
</MobileNav>
<AnimatePresence>
{open ? (
<motion.div
animate={{ height: 'calc(100vh - 48px)' }}
initial={{
height: 0,
overflow: 'auto',
position: 'relative',
zIndex: 999,
}}
exit={{ height: 0 }}
transition={{ ease: 'easeOut', duration: 0.25 }}
>
<PopUpNav>
<Headers>Features</Headers>
<Items>
<li>
<Link to="/ide">
<section>
<IDEIcon />
</section>
<span>IDE</span>
</Link>
</li>
<li>
<Link to="/embeds">
<section>
<EmbedIcon />
</section>
<span>Embed</span>
</Link>
</li>
<li>
<Link to="/ci">
<section>
<CIIcon />
</section>
<span>CI</span>
</Link>
</li>
<li>
<Link to="/team">
<section>
<TeamsIcon />
</section>
<span>Teams</span>
</Link>
</li>
</Items>
<Headers>Explore</Headers>
<Items>
<li>
<Link to="/explore">
<section>
<HighlightedICon />
</section>
<span>Featured Sandboxes</span>
</Link>
</li>
<li>
<a href="/search">
<section>
<SearchIcon />
</section>
<span>Search Sandboxes</span>
</a>
</li>
</Items>
<Headers>Resources</Headers>
<Items>
<li>
<Link to="/docs">
<section>
<DocsIcon />
</section>
<span>Documentation</span>
</Link>
</li>
<li>
<Link to="/blog">
<section>
<BlogIcon />
</section>
<span>Blog</span>
</Link>
</li>
</Items>
<Headers>Support</Headers>
<Items>
<li>
<a href="mailto:hello@codesandbox.io" title="Support">
<section>
<SupportIcon />
</section>
<span>Contact Support</span>
</a>
</li>
<li>
<a
target="_blank"
rel="noopener noreferrer"
href="https://status.codesandbox.io"
title="Status"
>
<section>
<StatusIcon />
</section>
<span>Status</span>
</a>
</li>
<Headers>Pricing</Headers>
<Pricing>
<Link to="/pricing">
<section>
<PricingIcon />
</section>
<span>Pricing</span>
</Link>
</Pricing>
</Items>
<Button
css={`
margin-top: 4rem;
display: block;
padding: 6px 21px;
`}
className="button"
href="/s"
>
Create Sandbox
</Button>
</PopUpNav>
</motion.div>
) : null}
</AnimatePresence>
</>
);
};