Fix auto init bug and refactor code on button components#37
Merged
Conversation
14 tasks
14 tasks
This file contains hidden or 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
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.
This pull request introduces several changes to the
Button,FAB, andIconButtoncomponents in thesrc/Componentsdirectory, focusing on refactoring and improving the code structure. The changes include the introduction of enums for button variants, modifications to component properties, and updates to the rendering logic.Key changes include:
Button Component Refactoring:
Variantenum to manage button variants and updated theButtonclass to use this enum.attributesPreprocessmethod to include new attributes and refactored the method to use theVariantenum.getHtmlTagto determine the HTML tag based on attributes.labelattribute and component slot.FAB Component Refactoring:
Variantenum for FAB variants and updated theFABclass to use this enum.attributesPreprocessmethod to use theVariantenum. [1] [2]Variantenum for checking theminivariant.IconButton Component Refactoring:
attributesPreprocessmethod to handle new properties and refactored the logic for setting attributes.Enum Definitions:
Variantenums for bothButtonandFABcomponents to manage different variants. [1] [2]Blade Template Updates:
button.blade.phptemplate to use the newgetHtmlTagmethod and refactored the ripple effect logic. [1] [2]icon-button.blade.phptemplate to align with the changes in theIconButtoncomponent. [1] [2] [3] [4]These changes improve the maintainability and readability of the code by using enums for variants, encapsulating properties, and refining the rendering logic.