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

Enhancement/Issue 68 add anchor link to header logo #69

Conversation

umavl6
Copy link
Contributor

@umavl6 umavl6 commented Jul 7, 2024

Related Issue

Resolves #68

Summary of Changes

  1. Added anchor link on header logo
  2. Provided test case for the same.

Copy link

netlify bot commented Jul 7, 2024

Deploy Preview for super-tapioca-5987ce ready!

Name Link
🔨 Latest commit 24181c1
🔍 Latest deploy log https://app.netlify.com/sites/super-tapioca-5987ce/deploys/668fee9d063c6d000886a011
😎 Deploy Preview https://deploy-preview-69--super-tapioca-5987ce.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 configuration.

Copy link
Member

@thescientist13 thescientist13 left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! Just left you a couple comments, let me know if you have any questions.

@@ -16,9 +16,11 @@ export default class Header extends HTMLElement {
this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = `
<header>
<a href="/" title="Greenwood Logo">
Copy link
Member

@thescientist13 thescientist13 Jul 7, 2024

Choose a reason for hiding this comment

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

A couple thoughts here:

  1. For the title of this link, I think we might probably want it to say Greenwood home page instead
  2. I think we might want to wrap the <a> tag from inside the div (thus having the inline element(s) nested inside the block level element), e.g.
    <div class="logo-bar">
      <a href="/" title="Greenwood home page">
        ${greenwoodLogo}
      </a>
    </div>

Copy link

@Umavula Umavula Jul 8, 2024

Choose a reason for hiding this comment

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

@thescientist13 sometimes, we wrap clickable elements like cards, buttons with hyperlinks like below screenshot:

image

Reference: https://developer.mozilla.org/en-US/curriculum/. Let me now if that's okay.

I will proceed with other changes. Thanks!

Copy link
Member

@thescientist13 thescientist13 Jul 8, 2024

Choose a reason for hiding this comment

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

Thanks for that, and yeah was more so just confirming that<a> tags can contain block level elements within them, and so per this article, seems like what you have here should be fine. 👍


expect(anchor).to.not.equal(undefined);
expect(anchor.getAttribute("href")).to.equal("/");
expect(logo).to.not.equal(undefined);
Copy link
Member

@thescientist13 thescientist13 Jul 7, 2024

Choose a reason for hiding this comment

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

expect(logo).to.not.equal(undefined);

We already test for the logo / <svg> in a preview it block, so I think instead of this line, let's test for a proper title attribute on the link instead (which would be good for a11y), e.g.

expect(anchor.getAttribute("title")).to.equal("Greenwood home page");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thescientist13 Updated the files as per the suggestions.Thanks!

@thescientist13 thescientist13 added the enhancement New feature or request label Jul 7, 2024
Copy link
Member

@thescientist13 thescientist13 left a comment

Choose a reason for hiding this comment

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

Awesome, thank you so much!

<div class="logo-bar">
${greenwoodLogo}
</div>
<a href="/" title="Greenwood Home Page">
Copy link
Member

Choose a reason for hiding this comment

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

Just made a small indentation tweak here

@thescientist13 thescientist13 merged commit 3a0e5cd into ProjectEvergreen:main Jul 11, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clicking the greenwood logo in the header should link to the home page
3 participants