-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature: Extract card message component #166
Conversation
Extract the popup we're using to show success messages ... to make it reusable
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.
Add screenshot in your description
@type = type | ||
case type | ||
when "success" | ||
@icon = "green-check.svg" |
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.
Add the SVG files to this PR
@@ -0,0 +1,16 @@ | |||
class CardMessageComponent < ViewComponent::Base | |||
def initialize(title: ,message:, button_text:, type:) | |||
#if title == "no-title" then the component has no title |
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.
don't do comments , write code
Problem:
On different occasions, we need to show the user a message for success, failure ...
in these messages, we use the same design and we change just the content,
so we gonna have a repeated code in several places of our app.
Solution:
I extracted the message popup as a reusable component that we can change the message, icon, and text button of it.