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

fix: responsive issues related to community hamburger in navbar #730

Merged
merged 56 commits into from
May 18, 2022

Conversation

Mcnoble1
Copy link
Contributor

@Mcnoble1 Mcnoble1 commented May 3, 2022

Description
Fixed the community dropdown in the Navigation bar to match the others.

Related issue(s)
Fixes #724

@mcturco

Mcnoble1 and others added 22 commits April 26, 2022 19:19
…ons in slack section for improved accessibility
@netlify
Copy link

netlify bot commented May 3, 2022

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9f9e3c3
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/6284b4dac3448b0008098645
😎 Deploy Preview https://deploy-preview-730--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

github-actions bot commented May 3, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 42
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🔴 PWA 30

Lighthouse ran on https://deploy-preview-730--asyncapi-website.netlify.app/

@mcturco
Copy link
Member

mcturco commented May 3, 2022

Hi @Mcnoble1 !
Thanks for raising this PR. I just checked out your PR and locally added the new icons that I have created for the community dropdown on my local server. Here is a preview:

Screen Shot 2022-05-03 at 4 09 20 PM

Let me know if it is okay to push these commits to the PR. Thanks! cc: @akshatnema

@Mcnoble1
Copy link
Contributor Author

Mcnoble1 commented May 3, 2022

This is super nice @mcturco. Neat and communicates the message. Do push the commits please.

@Mcnoble1
Copy link
Contributor Author

Mcnoble1 commented May 4, 2022

@akshatnema. I've made the necessary updates to mobile view and removed the commits from accessibility-fixes

Copy link
Member

@akshatnema akshatnema left a 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 }) {
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please do ask.

Copy link
Member

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 😄

Copy link
Member

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.' },
Copy link
Member

@akshatnema akshatnema May 5, 2022

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

@akshatnema akshatnema left a 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" />
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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 😄

@@ -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"/>
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed them.

@@ -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} />} */}
Copy link
Member

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.

Copy link
Contributor Author

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",
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 explain why these 2 new dependencies are needed in this PR?

Copy link
Contributor Author

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 :)` },
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thank you.

Copy link
Member

@magicmatatjahu magicmatatjahu left a 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:

image

Learning group has bigger padding that other and it doesn't look nice.

Comment on lines 40 to 47
<<<<<<< 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
Copy link
Member

Choose a reason for hiding this comment

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

Fix these leftover conflicts

Copy link
Contributor Author

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.

@Mcnoble1
Copy link
Contributor Author

@magicmatatjahu all fixed now.

Copy link
Member

@magicmatatjahu magicmatatjahu left a 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?

@magicmatatjahu
Copy link
Member

/rtm

@asyncapi-bot asyncapi-bot merged commit 694f9b9 into asyncapi:master May 18, 2022
@akshatnema akshatnema linked an issue Sep 1, 2022 that may be closed by this pull request
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.

Responsive issues related to Hamburger menu of Community in Navbar
6 participants