-
Notifications
You must be signed in to change notification settings - Fork 13
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: Alerts refactor - create new Alert component for admin/FormBuilder #2446
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
🧪 Review environmenthttps://54bx26jaqkqdabbahefgbjjqkm0wsypr.lambda-url.ca-central-1.on.aws/ |
…forms-client into feature/alert-refactor
timarney
reviewed
Aug 2, 2023
timarney
reviewed
Aug 2, 2023
timarney
reviewed
Aug 2, 2023
timarney
reviewed
Aug 2, 2023
…forms-client into feature/alert-refactor
timarney
approved these changes
Aug 4, 2023
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.
Nice work @dsamojlenko
Let's get this merged and than implement a first one here as per the design in the security questions branch.
dsamojlenko
changed the title
Alerts refactor
feat: Alerts refactor - create new Alert component for admin/FormBuilder
Aug 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary | Résumé
Create a new Alert component for use on the Admin/FormBuilder side of the app. To replace the current
globals/Alert.tsx
andglobals/Attention/Attention.tsx
components.Includes extensive set of Cypress Component tests that serve as a good reference for how to use the Alert component.
Intention is to streamline all Admin/FormBuilder Alerts to line up with the figma designs and create a flexible and customizable component that can be used for each of the different alert styles unique to the Admin/FormBuilder section.
Usage
Simple Alert - includes default icon (see tests)
Custom icon
No icon
Dismissible - includes onDismiss action that removes the alert
Dismissible - custom onDismiss action
Focussable
Complex alerts
Alerts are highly customizable by providing children components for Icon, Title, and Body
Each of these inner components can accept custom class overrides, and you can specify a heading level on the Title
The body of the Alert can just be any arbitrary elements, but not plain text
Design
https://www.figma.com/file/93udAjdrHbzOOCxaC5lqN1/GC-Forms-component-library?type=design&node-id=19-640&mode=design&t=pC0kVSSf7AG1PKqi-0
cn()
Includes a new
cn
util function for resolving Tailwindcss priority/conflicts. When passing in custom classes to the various components, instead of just appending them to the end of existing classes, this utility will merge them and ensure classes added later will take precedence.TODO
This PR just includes the new component and related code. Future PRs will implement this Alert component everywhere that
components/Alert.tsx
andcomponents/Attention/Attention.tsx
are currently being used.