refactor: refactor the button component using `forwardRef`
Description
refactor the button component using forwardRef
The previous button component was disguised as a div, which would lose the original capabilities of HTML, such as form submission. This will prevent users from submitting when JavaScript capabilities are turned off. But when we follow web standards, we can bring a better experience
This submission includes three contents:
- Use forwardRef to reconstruct the button component
- Change the original
typeattribute tovariant. Type is the original attribute of button. We should not modify it. - Removed
memo. As a basic component, memo is not required Fixes # (issue)
Type of Change
Please delete options that are not relevant.
- [x] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
How Has This Been Tested?
All button components should behave the same as before
Suggested Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings
- [x] I ran
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods
After this submission merge, all events related to Form submission can be triggered using HTML instead of using JavaScript methods.
@TinsFox Hello there is a conflict in this pr.
@crazywoola All conflicts have been resolved.
@TinsFox
Compared to the feature main, following files should change the original type attribute to variant
app/components/tools/add-tool-modal/index.tsx app/components/tools/add-tool-modal/tools.tsx app/components/tools/provider/detail.tsx app/components/tools/workflow-tool/index.tsx app/components/tools/workflow-tool/confirm-modal/index.tsx app/components/workflow/nodes/parameter-extractor/components/extract-parameter/update.tsx app/(shareLayout)/webapp-signin/page.tsx