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

Implement Snackbar component #6

Merged
merged 8 commits into from
Jun 17, 2024
Merged

Conversation

chessurisme
Copy link
Member

@chessurisme chessurisme commented May 14, 2024

❓ What type of PR is this?

  • Refactor ♻️
  • Feature ✨
  • Bug Fix 🛠️
  • Optimization 🚀
  • Documentation Update 📄
  • CI/CD 🤖

💬 Description

This PR includes a Snackbar component class with methods of creation and removal.

This is responsible for creating a snackbar in the DOM.

🎟️ Related Tickets & Documents

🃏 Added/updated tests?

We encourage you to keep the code coverage percentage at 90% and above.

  • Yes
  • No, because this is not necessary.
  • No, and this is why: I haven't write it yet.
  • I need help with writing tests

📚 Resources for Reviewers

🌿 What branch would you like to merge this into?

feature/components

📷 [optional] What gif best describes this PR or how it makes you feel?

@chessurisme chessurisme added the ✨ enhancement New feature or request label May 14, 2024
@chessurisme chessurisme added this to the Quiz Manager 1.0 milestone May 14, 2024
@chessurisme chessurisme self-assigned this May 14, 2024
Implement the Snackbar component to handle snackbar creation and removal
based on the provided configuration. The Snackbar class consists of a
constructor method that initializes the configuration, a create method
to create snackbars, and a remove method to remove snackbars. This
implementation ensures that the provided configuration is verified
before creating or removing snackbars.
Replaced the `createSnackbar` method with the `renderSnackbar` method in
the Snackbar class to streamline the process of rendering. Directly
rendering the Snackbar makes more sense and reduces complexity when
using the Snackbar class.
Removed an unnecessary parameter from the `removeSnackbar` method to
streamline its implementation and improve clarity.
Merged the render and remove methods in the Snackbar class to simplify
its interface and enhance clarity. The unnecessary parameter has been
removed, resulting in a more streamlined and user-friendly implementation.
This feature introduces a new function for rendering a snackbar message
and then automatically removing it after a certain duration. The
function combines the rendering and removal processes into a single
action, enhancing usability and reducing complexity.
@chessurisme chessurisme marked this pull request as ready for review May 24, 2024 10:56
Updated import paths in component files to use module resolution aliases
defined in jsconfig.json. This change improves code readability and
maintainability by replacing relative paths with aliases.
Combine multiple test files into a single test file to reduceunnecessary module tests. This change simplifies navigation and improvescodebase organization.
Add tests to verify that the Snackbar component correctly renders and
removes messages with valid configurations.
@chessurisme
Copy link
Member Author

Just like the Button component, Snackbar's files were merged into one single file. There are so many changes happening while editing into a single file. Here are some:

  • using static parameters when queuing multiple messages
  • handling multiple messages gracefully

Impressive! ❤️

@chessurisme chessurisme merged commit 8554ef9 into feature/components Jun 17, 2024
1 check passed
@chessurisme chessurisme deleted the feature/snackbar branch June 17, 2024 03:11
chessurisme added a commit that referenced this pull request Jun 18, 2024
* feat: implement Snackbar component

Implement the Snackbar component to handle snackbar creation and removal
based on the provided configuration. The Snackbar class consists of a
constructor method that initializes the configuration, a create method
to create snackbars, and a remove method to remove snackbars. This
implementation ensures that the provided configuration is verified
before creating or removing snackbars.

* refactor: replace create method with render method

Replaced the `createSnackbar` method with the `renderSnackbar` method in
the Snackbar class to streamline the process of rendering. Directly
rendering the Snackbar makes more sense and reduces complexity when
using the Snackbar class.

* refactor: remove unnecessary parameter

Removed an unnecessary parameter from the `removeSnackbar` method to
streamline its implementation and improve clarity.

* refactor: merge render and remove methods

Merged the render and remove methods in the Snackbar class to simplify
its interface and enhance clarity. The unnecessary parameter has been
removed, resulting in a more streamlined and user-friendly implementation.

* feat: add render then remove snackbar function

This feature introduces a new function for rendering a snackbar message
and then automatically removing it after a certain duration. The
function combines the rendering and removal processes into a single
action, enhancing usability and reducing complexity.

* refactor: update import paths for module resolution

Updated import paths in component files to use module resolution aliases
defined in jsconfig.json. This change improves code readability and
maintainability by replacing relative paths with aliases.

* test: merge test files into one

Combine multiple test files into a single test file to reduceunnecessary module tests. This change simplifies navigation and improvescodebase organization.

* test: ensure rendering and removal works properly

Add tests to verify that the Snackbar component correctly renders and
removes messages with valid configurations.
@chessurisme chessurisme mentioned this pull request Jun 18, 2024
10 tasks
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.

1 participant