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

Feature: Extract card message component #166

Merged
merged 13 commits into from
Feb 3, 2023

Conversation

Bilelkihal
Copy link
Collaborator

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.

Extract the popup we're using to show success messages ... to make it reusable
@Bilelkihal Bilelkihal self-assigned this Jan 23, 2023
@Bilelkihal Bilelkihal added the enhancement New feature or request label Jan 23, 2023
@Bilelkihal Bilelkihal changed the title Feature: extract popup message component Feature: extract card message component Jan 24, 2023
@Bilelkihal Bilelkihal changed the title Feature: extract card message component Feature: Extract card message component Jan 24, 2023
Copy link
Collaborator

@syphax-bouazzouni syphax-bouazzouni left a 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

app/assets/stylesheets/popup_message.scss Outdated Show resolved Hide resolved
app/components/popup_message_component.rb Outdated Show resolved Hide resolved
app/components/popup_message_component.rb Outdated Show resolved Hide resolved
@type = type
case type
when "success"
@icon = "green-check.svg"
Copy link
Collaborator

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
Copy link
Collaborator

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

@Bilelkihal Bilelkihal marked this pull request as ready for review February 1, 2023 11:53
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.

2 participants