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

[Issue #440] add github CTA to Hero #441

Merged
merged 3 commits into from
Aug 30, 2023
Merged

Conversation

andycochran
Copy link
Collaborator

Summary

Fixes #440

Time to review: 1 mins

Changes proposed

  • Add a button linking to this GitHub repo in the Hero component.

Context for reviewers

per Lucas's request to make this call-to-action more prominent

Additional information

image

href={ExternalRoutes.GITHUB_REPO}
target="_blank"
>
<Icon.Github className="usa-icon usa-icon--size-3 margin-right-1 text-middle tablet:margin-top-neg-2px" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using the Truss Icon component gives this error:

"<svg> elements with an img role must have an alternative text (svg-img-alt)"

…which was reported in the Truss repo, which indicates it's working as-intended.

Not sure how to resolve this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@SammySteiner @daphnegold … halp pleeeze

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, you just need to add aria-label. I'm pushing a fix upstream now.

@@ -8,14 +11,22 @@ const Hero = () => {

return (
<div data-testid="hero" className="usa-dark-background bg-primary">
<GridContainer className="padding-y-1 tablet:padding-y-3 tablet-lg:padding-y-10 desktop-lg:padding-y-15">
<GridContainer className="padding-y-1 tablet:padding-y-3 tablet-lg:padding-y-10 desktop-lg:padding-y-15 position-relative">
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added positioning so that the child link can be positioned relative to this element.

Comment on lines +42 to +49
$position-settings: (
output: true,
responsive: true,
active: false,
focus: false,
hover: false,
visited: false
),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is required to add positioning only on larger screens. I'm only changing the responsive values, but it only seems to work if you include all position settings. I think this happened before with breakpoints. I'm confused as to when you can override an individual setting and when you have to include all. Maybe we can get clarity on this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure either, that's so interesting. I thought you'd be able to do that.

<h1 className="tablet:font-sans-2xl desktop-lg:font-sans-3xl text-ls-neg-2">
<span>{t("title")}</span>
</h1>
<p className="usa-intro font-sans-md tablet:font-sans-lg desktop-lg:font-sans-xl">
<span className="text-yellow text-bold">{t("beta")}</span>&nbsp;
{t("content")}
</p>
<Link
className="usa-button usa-button--outline usa-button--inverse font-sans-2xs tablet:font-sans-md margin-bottom-3 desktop:position-absolute top-3 right-0 desktop:margin-y-3 desktop:margin-x-4"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A lot of classes here, but it's basically a small link on small screens, then on larger screens it's a bit bigger and positioned at the top-right of the Hero.

@andycochran andycochran marked this pull request as ready for review August 30, 2023 20:15
Copy link
Contributor

@daphnegold daphnegold left a comment

Choose a reason for hiding this comment

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

Looks amazing! I love it in mobile especially

<h1 className="tablet:font-sans-2xl desktop-lg:font-sans-3xl text-ls-neg-2">
<span>{t("title")}</span>
</h1>
<p className="usa-intro font-sans-md tablet:font-sans-lg desktop-lg:font-sans-xl">
<span className="text-yellow text-bold">{t("beta")}</span>&nbsp;
{t("content")}
</p>
<Link
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really a particular reason to use Link here since it's navigating off page, but doesn't matter, I think if we use a or Link tags. Not a change request, just pondering out loud. :D

Comment on lines +42 to +49
$position-settings: (
output: true,
responsive: true,
active: false,
focus: false,
hover: false,
visited: false
),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure either, that's so interesting. I thought you'd be able to do that.

@andycochran andycochran merged commit 87d084f into main Aug 30, 2023
@andycochran andycochran deleted the andycochran/github-header-link branch August 30, 2023 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Add GitHub CTA to the top of site
2 participants