Conversation
Codecov Report
@@ Coverage Diff @@
## master #188 +/- ##
==========================================
+ Coverage 96.94% 96.99% +0.04%
==========================================
Files 29 29
Lines 262 266 +4
Branches 32 32
==========================================
+ Hits 254 258 +4
Misses 8 8
Continue to review full report at Codecov.
|
Could still use a little work (especially on mobile) but it's a good start: https://en-rlyghioczn.now.sh/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be overlooking something since I'm on mobile, but where is this nav not at the top of the page? I can take a closer look later, but there are some small changes that we should definitely correct just to maintain a consistent look before merging. (Adding the prop to the nav on all pages.)
components/layout.js
Outdated
@@ -37,18 +37,25 @@ const Wrapper = glamorous.div((props, {fonts, colors}) => ({ | |||
}, | |||
})) | |||
|
|||
function Layout({pathname, children, contributors}) { | |||
function Layout({pathname, children, contributors, topNav = false}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to default it to false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs pages (most of the pages) will have it on the left.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it makes more sense after seeing the desktop version.
components/nav.js
Outdated
[mediaQueries.mediumUp]: { | ||
display: 'flex', | ||
justifyContent: top ? 'center' : 'flex-start', | ||
flexDirection: top ? 'row' : 'column', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this line the mobile version is breaking on any page we don't update to have top={true}
. Since this is a new prop only index and Getting Started are correct on mobile right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you move the mediumDown
media query underneath this I think it'll fix the mobile styles for all pages. The idea is that it's sidebar on desktop wherever we don't say it's a top nav, and across the top on mobile on all pages without needing a prop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to override the width
, maxHeight
, justifyContent
, and flexDirection
on mobile.
@@ -57,7 +57,7 @@ function CodePreview() { | |||
|
|||
function Page({url}) { | |||
return ( | |||
<Layout pathname={url ? url.pathname : ''}> | |||
<Layout pathname={url ? url.pathname : ''} topNav={true}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be on all pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only applies to getting-started
and index
. All the others are not on the top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even on mobile? I would think that on mobile it would be on top on all pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, on mobile we'll use media queries I think.
@@ -25,7 +25,7 @@ const PageWrapper = glamorous.div((props, {colors}) => ({ | |||
'& > h3': { | |||
width: '100%', | |||
margin: '20px auto', | |||
maxWidth: '50rem', | |||
maxWidth: '70rem', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a global variable or something I think... 🤔
Im on iPhone right now so I looked a bit more later but in iPhone I have a different color for the bottom border of the menu to the left On mobile the button get started is really big or the text is too long Other than that, it looks really cool on iPhone :) |
@wcastand the border is a |
components/layout.js
Outdated
<Div position="relative" zIndex={1}> | ||
<Div display="flex" justifyContent="flex-end" alignItems="center"> | ||
<Nav pathname={pathname} /> | ||
<Div position="relative" zIndex={1} display={topNav ? null : 'flex'}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be responsive to media queries, so probably want to pull this out of the inline css props syntax.
components/layout.js
Outdated
<Div position="relative" zIndex={1} display={topNav ? null : 'flex'}> | ||
<Div | ||
display="flex" | ||
justifyContent={topNav ? 'flex-end' : 'flex-start'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dupe: This needs to be responsive to media queries, so probably want to pull this out of the inline css props syntax.
components/layout.js
Outdated
display="flex" | ||
justifyContent={topNav ? 'flex-end' : 'flex-start'} | ||
alignItems="center" | ||
flexDirection={topNav ? 'row' : 'column'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dupe: This needs to be responsive to media queries, so probably want to pull this out of the inline css props syntax.
components/layout.js
Outdated
> | ||
<Nav pathname={pathname} top={topNav} /> | ||
</Div> | ||
<Div flex="1"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dupe: This needs to be responsive to media queries, so probably want to pull this out of the inline css props syntax.
@kentcdodds I pushed some changes to respect the top/sidebar versions and make both responsive for mobile screens. If you take a look and approve then go for it! If you have improvements to make I'll review what you add in. |
Not sure about the failing CI... 😕 |
My bad. I broke the scripts. Will fix in a moment. |
97722bb
to
7c5933b
Compare
This is great! I love the opacity stuff. There are a few issues you'll probably notice pretty quickly as you resize the window. I don't have time to get that fixed in the next few days, so feel free if you have time :) |
…ous-website into pr/improve-nav-styling
…switch nav to largeDown
@kentcdodds I updated the nav to switch to the "mobile" layout on tablets. The overflowing nav is too much content to make look good once you get around 1000px. I also increased the |
Sorry, can you circle the issue? IDK what I'm looking for. 😅 |
It's the |
What: Moves the nav to the left.
Why: Closes #121
How: code and stuff