-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
Conversation
Deploying this :) |
I forgot to push my changes :) |
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 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:
- 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?
@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. |
I agree with you then 👍 We need to this. |
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.
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
components/Anchor.js
Outdated
@@ -13,7 +13,7 @@ const InvisibleAnchor = styled.div.attrs({ | |||
visibility: hidden; | |||
height: 0; | |||
|
|||
top: ${rem(-20)}; | |||
top: ${rem(-80)}; | |||
|
|||
${mobile(css` | |||
top: ${rem(-90)}; |
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.
Have you checked whether this needs some changes on mobile?
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.
Oh, No. I'll check.
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.
It's now good on both mobile and desktop IMO.
components/DocsLayout.js
Outdated
</Title> | ||
onSideFold = () => { | ||
let isSideFolded = !this.state.isSideFolded | ||
// if(!isSideFolded) { |
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.
Can you remove the commented out code here? If you need it back we'll have the git history anyway 😉
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! It was my pre-git habit. You won't see this kind of commenting later on.
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.
No worries! I sometimes forget this stuff too :)
components/DocsLayout.js
Outdated
// document.body.classList.remove('sticky') | ||
// } | ||
this.setState({ | ||
isSideFolded: isSideFolded |
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.
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
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.
Yeah, you're right, I forgot to refactor the old code here. Sorry!
components/Nav/MobileNavbar.js
Outdated
import Link from '../Link' | ||
import NavLinks from './NavLinks' | ||
import Social from './Social' | ||
// import Search from './Search' |
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.
to be removed
components/Nav/MobileNavbar.js
Outdated
padding: 0 ${rem(20)}; | ||
transition: height 0.1s; | ||
|
||
-webkit-user-select: none; |
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.
user-select
is prefixed only for webkit here. The prefix can be removed
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.
Good catch!
components/Nav/MobileNavbar.js
Outdated
`} | ||
` | ||
|
||
const PaddedSocial = styled(Social)` |
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'm not too happy about wrapping the Social
component here, since it's our own :/
It goes against the container -> structural -> presentational components order
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.
You're totally right. I didn't think of this before container -> structural -> presentational
but it makes sense for me, too.
components/Nav/MobileNavbar.js
Outdated
<SecondaryMenu open={isMenuOpen}> | ||
<NavLinks /> | ||
<NavSeparator /> | ||
{/* <Search /> */} |
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.
to be removed due to git history; see above
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.
Done.
components/Nav/NavButton.js
Outdated
} | ||
|
||
svg { | ||
display: inline-block; |
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'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
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.
Done.
components/Nav/Navbar.js
Outdated
import Link from '../Link' | ||
import NavLinks from './NavLinks' | ||
import Social from './Social' | ||
// import Search from './Search' |
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.
to be removed
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.
Done.
components/Nav/Navbar.js
Outdated
</StartWrapper> | ||
|
||
<EndWrapper> | ||
{/* <Search /> */} |
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.
to be removed
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.
Done.
We should also link to our medium publication from the navbar! https://medium.com/styled-components |
Oh, how did I miss that?! Sure. |
@morajabi the nav ui looks & feels excellent! Have you thought about making these styles redistributable as a package? Keep up the good work! |
@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 ❤️ |
@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. |
@morajabi No worries 👍 Let's get this merged and iterate on it later. Thanks again, it's really some impressive piece of UI 💟 |
It's almost done now, wait 1 minute :) |
@philpl @mxstbr I think I've fixed issues addressed here! Please take a look :) https://styled-components-docs-vwoqqgftqx.now.sh/docs |
So awesome 😍 Thanks so much @morajabi! |
Ok, only thing is that we should update the navbar items 😄 We can do that after merging, I guess |
@philpl Sounds good! |
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! |
@mxstbr do you want to approve and merge? We can subsequently open more issues with iterations on the navbar |
Lots more coming soon 😎 |
@mxstbr Let's hold up until we figure out what to put in the navbar? :) |
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.