Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

improve some stuff around the nav #188

Merged
merged 10 commits into from Jul 2, 2017
Merged

Conversation

kentcdodds
Copy link
Owner

What: Moves the nav to the left.

Why: Closes #121

How: code and stuff

@codecov
Copy link

codecov bot commented Jul 1, 2017

Codecov Report

Merging #188 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
components/hero.js 100% <ø> (ø) ⬆️
pages/index/index.js 100% <ø> (ø) ⬆️
components/docs-page.js 100% <ø> (ø) ⬆️
styles/global-styles.js 100% <ø> (ø) ⬆️
components/nav.js 83.33% <100%> (+5.55%) ⬆️
components/layout.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca058f9...aff71d6. Read the comment docs.

@kentcdodds
Copy link
Owner Author

Could still use a little work (especially on mobile) but it's a good start: https://en-rlyghioczn.now.sh/

Copy link
Collaborator

@paulmolluzzo paulmolluzzo left a 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.)

@@ -37,18 +37,25 @@ const Wrapper = glamorous.div((props, {fonts, colors}) => ({
},
}))

function Layout({pathname, children, contributors}) {
function Layout({pathname, children, contributors, topNav = false}) {
Copy link
Collaborator

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?

Copy link
Owner Author

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.

Copy link
Collaborator

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.

[mediaQueries.mediumUp]: {
display: 'flex',
justifyContent: top ? 'center' : 'flex-start',
flexDirection: top ? 'row' : 'column',
Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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}>
Copy link
Collaborator

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.

Copy link
Owner Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I'm referring to:

img_6064
img_6065

Copy link
Owner Author

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',
Copy link
Collaborator

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... 🤔

@wcastand
Copy link
Contributor

wcastand commented Jul 1, 2017

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
I don't know if that's something you wanted or not.

On mobile the button get started is really big or the text is too long

Other than that, it looks really cool on iPhone :)
Looking forward the desktop version :)

@paulmolluzzo
Copy link
Collaborator

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
I don't know if that's something you wanted or not.

@wcastand the border is a div with three colors left to right. That's how it was designed. 😀

@paulmolluzzo
Copy link
Collaborator

Three more issues for me:

The default option is missing in the nav I think:
screen shot 2017-07-01 at 5 04 20 pm
screen shot 2017-07-01 at 5 04 27 pm

The colors for contributors and the sidebar is identical, so this part looks odd. Maybe we want a right border on the sidebar?
screen shot 2017-07-01 at 5 04 16 pm

<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'}>
Copy link
Collaborator

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.

<Div position="relative" zIndex={1} display={topNav ? null : 'flex'}>
<Div
display="flex"
justifyContent={topNav ? 'flex-end' : 'flex-start'}
Copy link
Collaborator

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.

display="flex"
justifyContent={topNav ? 'flex-end' : 'flex-start'}
alignItems="center"
flexDirection={topNav ? 'row' : 'column'}
Copy link
Collaborator

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.

>
<Nav pathname={pathname} top={topNav} />
</Div>
<Div flex="1">
Copy link
Collaborator

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.

@paulmolluzzo
Copy link
Collaborator

@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.

@paulmolluzzo
Copy link
Collaborator

Not sure about the failing CI... 😕

@kentcdodds
Copy link
Owner Author

kentcdodds commented Jul 2, 2017

My bad. I broke the scripts. Will fix in a moment.

@kentcdodds
Copy link
Owner Author

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 :)

https://en-glamorous-jabjandwxo.now.sh

@paulmolluzzo
Copy link
Collaborator

@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 h1 size on mobile and tablets. It was way too small.

@kentcdodds
Copy link
Owner Author

Looking much better! But we need to fix this (shouldn't clip the right off).

screen shot 2017-07-02 at 8 32 35 am

screen shot 2017-07-02 at 8 32 40 am

@paulmolluzzo
Copy link
Collaborator

Sorry, can you circle the issue? IDK what I'm looking for. 😅

@kentcdodds
Copy link
Owner Author

screen shot 2017-07-02 at 8 32 40 am

screen shot 2017-07-02 at 8 32 35 am

@paulmolluzzo
Copy link
Collaborator

It's the flex. Off to the pool now so I'll fix later. 😎

@kentcdodds kentcdodds merged commit 663e539 into master Jul 2, 2017
@kentcdodds kentcdodds deleted the pr/improve-nav-styling branch July 2, 2017 16:47
@paulmolluzzo paulmolluzzo mentioned this pull request Jul 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move the nav menu and maybe the Title/logo/button on the homepage
3 participants