-
-
Notifications
You must be signed in to change notification settings - Fork 589
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
fix: responsive issues related to community hamburger in navbar #730
Conversation
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-730--asyncapi-website.netlify.app/ |
Hi @Mcnoble1 ! Let me know if it is okay to push these commits to the PR. Thanks! cc: @akshatnema |
This is super nice @mcturco. Neat and communicates the message. Do push the commits please. |
@akshatnema. I've made the necessary updates to mobile view and removed the commits from |
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.
Don't use the SVG code of the icons directly as a component. Instead, add them as an image in the repository and then use them.
@@ -0,0 +1,25 @@ | |||
export default function IconContributing ({ className }) { |
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.
The icons added for the menu should not be added as the SVG code inside components. All the illustrations used should be added inside /public/img/illustrations/icons/
folder and not in the form of code, but in the SVG format. Remove this icons
folder inside the components
folder and place the files under the right directory. Also, don't forget to change the path of icons in the CommunityItems.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.
For the icons, I met them in the components/icons
folder. I wasn't the one that created them there. So I'm not sure I will want to change the location since I didn't make the folder structure.
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.
Actually, the components/icons
folder has been made to structures some special types of icons like GitHub.js, Modelina.js, Parser.js, etc. whereas the type of SVG icons are directly added to the /public/img/illustrations/icons/
in order to use it. So, it will be better you directly export the SVG icons to the above directory and then use it.
I also ask @magicmatatjahu here if the present addition of icons are correct or it should be under public
folder.
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.
Please do ask.
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 think the way @Mcnoble1 implemented the icons is correct as this is the behavior for the other SVG icons in the nav menu. I would refrain from restructuring the files in this PR, if there is a better way to handle the files we should suggest that idea in a separate issue. But of course, looking at @magicmatatjahu for final say on code 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.
I always use icons (svg) as React component, so I prefer to change them to the JS function rather to have them as normal svgs - remember that we applied in some places styles for them, so it's easier to treat them as components.
{ icon: IconTools, title: 'Tools & Services', href: '/docs/community/tooling', description: 'Explore the tools and services our awesome community has created.' }, |
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.
Don't change the name of the icons (inside the text
) as such. Revert the names changed by you and add the path of the icons in the icon
field.
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 really do not get this. I simply followed the naming convention used in navigation/learningItems.js
and navigation/toolingItems.js
which are the other navbar items.
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 that I wrongly get it in the first instance. What I want to propose here is to use the camelCase format for writing the variable names here because we usually use the camelCase format to write the names.
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.
The icons here are not variable names but function names.
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 know that they are function names, but what I see in the repository is that camelCase is preferable. So, I suggested you for that. Let's wait for the view of code owners towards 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.
I don't understand 😅 The IconTools
is a function (React component) so now it's good.
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.
Added a few more comments to remove certain code added in the PR.
rel={isExternalHref ? "noopener noreferrer" : undefined} | ||
> | ||
<div className={`flex-shrink-0 flex items-center justify-center h-10 w-10 rounded-lg border border-gray-800 bg-secondary-100 text-gray-900 sm:h-12 sm:w-12 ${item.comingSoon && 'opacity-50'}`}> | ||
<item.icon className="h-6 w-6" /> | ||
<item.icon className="h-8 w-8" /> |
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.
Any specific reason why the size of the icons is increased?
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 think it's for more visibility. @mcturco suggested we do that in the comment section above. She'll have her reasons for that.
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.
Yep like @Mcnoble1 said, I increased the size of all the icons so that you can see the detail better. Eventually we will replace the icons in the other menus as well to match the new icons in this PR 😄
components/navigation/NavBar.js
Outdated
@@ -53,6 +52,8 @@ export default function NavBar ({ | |||
<svg className="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24"> | |||
<title>Menu</title> | |||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16M4 18h16" /> | |||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16M4 18h16"/> |
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.
The 2 lines added here are not needed as they overwrite the existence of 3 parallel lines of Menu. You can remove 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.
I've removed them.
components/navigation/NavBar.js
Outdated
@@ -69,7 +70,8 @@ export default function NavBar ({ | |||
|
|||
<div className="relative"> | |||
<NavItem text="Community" onClick={() => showMenu('community')} hasDropdown /> | |||
{open === 'community' && <NavMenu items={communityItems} />} | |||
{/* {open === 'community' && <NavMenu items={communityItems} />} */} |
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 certain piece of code is not needed, you can remove it instead of commenting it. Please do remove this comment.
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.
Yikes, must have been an oversight, thanks. removed.
package.json
Outdated
@@ -60,6 +60,8 @@ | |||
"react-dom": "^17.0.2", | |||
"react-ga": "^3.1.2", | |||
"react-gtm-module": "^2.0.11", | |||
"react-helmet": "^6.1.0", |
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 explain why these 2 new dependencies are needed in this PR?
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.
Another oversight would have happened while I was reverting some commits. I've removed them. Thanks so much @akshatnema
{ icon: IconTools, title: 'Tools & Services', href: '/docs/community/tooling', description: 'Explore the tools and services our awesome community has created.' }, | ||
{ icon: IconGithubOrganization, title: 'Github Organization', href: 'https://github.com/asyncapi', target: '_blank', description: 'Want to sneak in the code? Everything we do is open-sourced in our Github organization.' }, | ||
{ icon: IconSlack, title: 'Slack Workspce', href: 'https://asyncapi.com/slack-invite', target: '_blank', description: `Need help? Want to share something? Join our Slack workspace. We're nice people :)` }, |
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.
Correct the spelling of Workspace
here.
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. Thank you.
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.
@Mcnoble1 Sorry for such a delay! Awesome work btw! I have some comments, please refer to them and also I found one "bug":
I think that we should try to fix these indendations in mobile views:
Learning
group has bigger padding that other and it doesn't look nice.
package-lock.json
Outdated
<<<<<<< HEAD | ||
"react-helmet": "^6.1.0", | ||
<<<<<<< HEAD | ||
"react-router-hash-link": "^2.4.3", | ||
======= | ||
>>>>>>> parent of 14d36f9... fix: add html lang attribute for improved accessibility | ||
======= | ||
>>>>>>> parent of 5e19416... feat: add skip link to the navbar |
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.
Fix these leftover conflicts
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.
@magicmatatjahu, will do that now. Thank you.
@magicmatatjahu all fixed 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.
LGTM! @akshatnema @mcturco Do you wanna add something before merge?
/rtm |
Description
Fixed the community dropdown in the Navigation bar to match the others.
Related issue(s)
Fixes #724
@mcturco