Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement snackbar component (#6)
* 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.
- Loading branch information