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

feat: SiteAlert child enhancement #1215

Merged
merged 5 commits into from
Sep 8, 2021
Merged

Conversation

ghost
Copy link

@ghost ghost commented May 7, 2021

Summary

Modifies the SiteAlert component to also accept simple text strings and multiple components as children. If the child is a simple string, the component will wrap it in <p className="usa-alert__text">, which aligns with what the USWDS component is doing. (Single child components and multiple child components are deliberately left alone, as users may already be passing in content for the alert wrapped in a p tag.)

There is a desire to further enhance this functionality by creating an AlertText sub-component, but as I'm still trying to figure out how that could practically work (as it's possible to also use it in the Alert component as well but that might introduce a breaking change?), I'm making this intermediate PR since it's already a value add at this point.

Related Issues or PRs

Addresses (but does not fully close, see above + issue discussion) #1191

How To Test

Check out this branch, run yarn test to execute tests, and yarn storybook to see the updated component functionality in the additional stories for the SiteAlert component.

@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook May 7, 2021 17:47 Inactive
@ghost ghost linked an issue May 10, 2021 that may be closed by this pull request
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook May 27, 2021 16:33 Inactive
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook May 27, 2021 19:49 Inactive
@haworku haworku added the status: stale Work in progress but no discussion or movement for 30+ days. label Sep 8, 2021
@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook September 8, 2021 19:23 Inactive
Copy link
Contributor

@haworku haworku left a comment

Choose a reason for hiding this comment

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

Thank you ⭐

@trussworks-infra-zz trussworks-infra-zz temporarily deployed to storybook September 8, 2021 20:01 Inactive
@haworku haworku merged commit 3cd70f9 into main Sep 8, 2021
@haworku haworku deleted the kh-sitealert-enhancement-1191 branch September 8, 2021 20:21
@haworku haworku mentioned this pull request Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: stale Work in progress but no discussion or movement for 30+ days.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] SiteAlert children enhancement
3 participants