Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the new navbar and refactor the sidebar #109

Merged
merged 26 commits into from
Sep 25, 2017
Merged

Add the new navbar and refactor the sidebar #109

merged 26 commits into from
Sep 25, 2017

Conversation

morajabi
Copy link
Member

@morajabi morajabi commented Sep 6, 2017

Fix #83

First, I'm sorry for latency, I was in the middle of a heavy project.

I think it's now complete (check designs), so take a look and tell me what you think.
I know some parts can be refactored so don't merge, please :)

We can start implementing search after merging this.

Thanks for your time and help.

@morajabi morajabi changed the title Add the new navbar and refactor the sidebar Add the new navbar and refactor the sidebar (closes #83) Sep 6, 2017
@SaraVieira
Copy link
Member

Deploying this :)

@morajabi
Copy link
Member Author

morajabi commented Sep 6, 2017

I forgot to push my changes :)

@SaraVieira
Copy link
Member

Copy link
Member

@mxstbr mxstbr left a comment

Choose a reason for hiding this comment

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

This is so so awesome, great great great work! I can't wait to ship this 😊

A couple of minor improvements:

  • When I'm on e.g. /docs/basics all the other sections in the NavBar should be collapsed:

screen shot 2017-09-06 at 7 38 56 pm

  • The social media icons should have the same hover animation/transitions as the other menu items
  • Let's comment out the Twitter icon for now since styled-components doesn't have a Twitter account (yet?)
  • Let's comment out the search input since we don't have search yet?

@morajabi
Copy link
Member Author

morajabi commented Sep 6, 2017

@mxstbr Your comment is beyond my expectations :) Thanks, Max! I wanted to make it solid both in code and design, and hopefully, it is so.

Your points are completely right and I agree too. If it's OK, I will do them tomorrow.

@morajabi morajabi self-assigned this Sep 10, 2017
@morajabi
Copy link
Member Author

morajabi commented Sep 11, 2017

@philpl

They're overlapping. Having two floating menus open at the same time is something I'd generally consider as bad practice and kind of "lazy". I think we can close one when the other is opened, which is just as valuable and makes sure that the user can always focus on a single one. Also I think their order is fixed, so that means a specific one will always overlap the other. I haven't checked now which one overlaps which, but this makes a really annoying experience.

I agree with you then 👍 We need to this.

Copy link
Member

@kitten kitten left a comment

Choose a reason for hiding this comment

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

In general I have three nits:

  • commented out code should be removed and the git history should be relied upon instead. And if needed a TODO comment should be added instead
  • All the svg should be abstracted and extracted, and the very generic selector that is targeting them should be moved to them. You can probably just create a styled-svg component and change width/height
  • Wrapping structural components in another presentational styled() wrapper should be avoided for refactorability

@@ -13,7 +13,7 @@ const InvisibleAnchor = styled.div.attrs({
visibility: hidden;
height: 0;

top: ${rem(-20)};
top: ${rem(-80)};

${mobile(css`
top: ${rem(-90)};
Copy link
Member

Choose a reason for hiding this comment

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

Have you checked whether this needs some changes on mobile?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, No. I'll check.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's now good on both mobile and desktop IMO.

</Title>
onSideFold = () => {
let isSideFolded = !this.state.isSideFolded
// if(!isSideFolded) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove the commented out code here? If you need it back we'll have the git history anyway 😉

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry! It was my pre-git habit. You won't see this kind of commenting later on.

Copy link
Member

Choose a reason for hiding this comment

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

No worries! I sometimes forget this stuff too :)

// document.body.classList.remove('sticky')
// }
this.setState({
isSideFolded: isSideFolded
Copy link
Member

Choose a reason for hiding this comment

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

Small nit, can you remove the variable above? Also it won't need to be a let. We generally use the const before let convention

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, you're right, I forgot to refactor the old code here. Sorry!

import Link from '../Link'
import NavLinks from './NavLinks'
import Social from './Social'
// import Search from './Search'
Copy link
Member

Choose a reason for hiding this comment

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

to be removed

padding: 0 ${rem(20)};
transition: height 0.1s;

-webkit-user-select: none;
Copy link
Member

Choose a reason for hiding this comment

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

user-select is prefixed only for webkit here. The prefix can be removed

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch!

`}
`

const PaddedSocial = styled(Social)`
Copy link
Member

Choose a reason for hiding this comment

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

I'm not too happy about wrapping the Social component here, since it's our own :/

It goes against the container -> structural -> presentational components order

Copy link
Member Author

Choose a reason for hiding this comment

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

You're totally right. I didn't think of this before container -> structural -> presentational but it makes sense for me, too.

<SecondaryMenu open={isMenuOpen}>
<NavLinks />
<NavSeparator />
{/* <Search /> */}
Copy link
Member

Choose a reason for hiding this comment

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

to be removed due to git history; see above

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

}

svg {
display: inline-block;
Copy link
Member

Choose a reason for hiding this comment

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

I'd much rather have this be placed with the SVGs themselves. Surely we can choose an abstraction component for them instead of just chugging them into MobileNavbar.js

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

import Link from '../Link'
import NavLinks from './NavLinks'
import Social from './Social'
// import Search from './Search'
Copy link
Member

Choose a reason for hiding this comment

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

to be removed

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

</StartWrapper>

<EndWrapper>
{/* <Search /> */}
Copy link
Member

Choose a reason for hiding this comment

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

to be removed

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@mxstbr
Copy link
Member

mxstbr commented Sep 14, 2017

We should also link to our medium publication from the navbar! https://medium.com/styled-components

@morajabi
Copy link
Member Author

Oh, how did I miss that?! Sure.

@LorbusChris
Copy link

LorbusChris commented Sep 24, 2017

@morajabi the nav ui looks & feels excellent!

Have you thought about making these styles redistributable as a package?
I guess it would come in handy to many (like me 😃) and be worth the other ⭐ or 🌟
Don't feel pressured into taken that oss burden though, one can easily fork away from here, too!

Keep up the good work!

@kitten kitten changed the title Add the new navbar and refactor the sidebar (closes #83) Add the new navbar and refactor the sidebar Sep 25, 2017
@kitten
Copy link
Member

kitten commented Sep 25, 2017

@morajabi Anything I can do to get this merged soon 😉 Should I pick up my nits and just go fix them? Or do you have time soon. Sorry for being pushy, but it's really awesome and we should get this merged soon ❤️

@morajabi
Copy link
Member Author

@philpl I'm really sorry for this. I've been busy with my new startup these days, but I'm doing this right now. Again, I'm sorry and I'll fix these issues right now.

@kitten
Copy link
Member

kitten commented Sep 25, 2017

@morajabi No worries 👍 Let's get this merged and iterate on it later. Thanks again, it's really some impressive piece of UI 💟

@morajabi
Copy link
Member Author

It's almost done now, wait 1 minute :)

@morajabi
Copy link
Member Author

@philpl @mxstbr I think I've fixed issues addressed here! Please take a look :) https://styled-components-docs-vwoqqgftqx.now.sh/docs

@mxstbr
Copy link
Member

mxstbr commented Sep 25, 2017

So awesome 😍 Thanks so much @morajabi!

@kitten
Copy link
Member

kitten commented Sep 25, 2017

Ok, only thing is that we should update the navbar items 😄 We can do that after merging, I guess

@morajabi
Copy link
Member Author

@philpl Sounds good!

@morajabi
Copy link
Member Author

morajabi commented Sep 25, 2017

Thank you too @mxstbr and @philpl. I've learned so much from you! Sorry again for the latency...

@mxstbr P.S I love the spectrum.chat UI, libraries and building blocks. Just saw the @withspectrum OSS projects on Github, great work there!

@kitten
Copy link
Member

kitten commented Sep 25, 2017

@mxstbr do you want to approve and merge? We can subsequently open more issues with iterations on the navbar

@mxstbr
Copy link
Member

mxstbr commented Sep 25, 2017

Just saw the @withspectrum OSS projects on Github, great work there!

Lots more coming soon 😎

Great work @morajabi, want to deploy this @philpl?

@kitten
Copy link
Member

kitten commented Sep 25, 2017

@mxstbr Let's hold up until we figure out what to put in the navbar? :)

@kitten kitten merged commit a53e606 into master Sep 25, 2017
@mxstbr mxstbr deleted the add-nav branch September 25, 2017 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants