Skip to content
This repository was archived by the owner on Apr 19, 2021. It is now read-only.

Commit 5567266

Browse files
Collapse header navigation at a smaller breakpoint (#914)
Fix gitpod-io/website#881
1 parent 79fb835 commit 5567266

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/components/Nav.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import styled from '@emotion/styled'
44
import { Link } from 'gatsby'
55
import GitpodLogoDark from '../resources/gitpod-logo-dark.svg'
66
import { colors, sizes, borders } from '../styles/variables'
7-
import DropDown from '../components/DropDown'
87
import { Global, css } from '@emotion/core'
98

109
const StyledNav = styled.nav`
@@ -14,7 +13,7 @@ const StyledNav = styled.nav`
1413
padding: 4rem 0;
1514
position: relative;
1615
17-
@media(max-width: ${sizes.breakpoints.lg}) {
16+
@media(max-width: 1040px) {
1817
font-size: 110%;
1918
display: block;
2019
}
@@ -41,7 +40,7 @@ const StyledNav = styled.nav`
4140
display: flex;
4241
align-items: center;
4342
44-
@media(max-width: ${sizes.breakpoints.lg}) {
43+
@media(max-width: 1040px) {
4544
flex-direction: column;
4645
width: 100%;
4746
padding-top: 8rem;
@@ -55,7 +54,7 @@ const StyledNav = styled.nav`
5554
}
5655
}
5756
58-
@media(max-width: ${sizes.breakpoints.lg}) {
57+
@media(max-width: 1040px) {
5958
.navIsRendered {
6059
display: flex;
6160
}
@@ -68,13 +67,13 @@ const StyledNav = styled.nav`
6867
.nav__item {
6968
cursor: pointer;
7069
71-
@media(min-width: calc(${sizes.breakpoints.lg} + 1px)) {
70+
@media(min-width: 1041px) {
7271
&:not(:last-child) {
7372
margin-right: 5rem;
7473
}
7574
}
7675
77-
@media(max-width: ${sizes.breakpoints.lg}) {
76+
@media(max-width: 1040px) {
7877
width: 100%;
7978
padding: 2rem 0;
8079
@@ -92,7 +91,7 @@ const StyledNav = styled.nav`
9291
display: flex;
9392
align-items: center;
9493
95-
@media(min-width: calc(${sizes.breakpoints.lg} + 1px)) {
94+
@media(min-width: 1041px) {
9695
display: none;
9796
}
9897
@@ -161,7 +160,7 @@ const StyledNav = styled.nav`
161160
}
162161
}
163162
164-
@media(min-width: calc(${sizes.breakpoints.lg} + 1px)) {
163+
@media(min-width: 1041px) {
165164
display: none;
166165
}
167166
@@ -172,7 +171,7 @@ const StyledNav = styled.nav`
172171
}
173172
174173
175-
@media(max-width: ${sizes.breakpoints.lg}) {
174+
@media(max-width: 1040px) {
176175
.shown {
177176
opacity: 1;
178177
transform: scale(1) translateX(0);
@@ -212,7 +211,7 @@ const Nav = () => {
212211
const [isNavRendered, setIsNavRendered] = useState(false)
213212

214213
const unLock = () => {
215-
if (window.innerWidth >= 1240) {
214+
if (window.innerWidth >= 1040) {
216215
setIsNavRendered(false)
217216
}
218217
}

0 commit comments

Comments
 (0)