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

Add Types & Refactor Card Components (useHooks) #2365

Merged
merged 3 commits into from
Jun 26, 2024
Merged

Conversation

Cristhianzl
Copy link
Collaborator

This pull request introduces two improvements:

Type Annotations for Custom Hooks: Enhances code readability and maintainability by adding type annotations to our custom hooks. This will improve IDE support and help catch potential errors early in the development process.

Card Component Refactor (useHooks): Refactors card components to leverage the useHooks pattern. This improves code organization and potentially simplifies component logic.

These changes improve the overall codebase quality and make it easier to understand and maintain.

- Add `useDataEffect` to handle data-related side effects
- Add `useInstallComponent` to manage component installation logic
- Add `useLikeComponent` to handle like functionality
- Add `useDragStart` to manage drag start events
- Add `usePlaygroundEffect` to handle playground-related side effects

✨ (cardComponent): add custom hooks for data, install, like, drag start, and playground effects
♻️ (cardComponent): rename state variables for consistency and readability
✨ (MainPage): add CollectionCard component to handle card rendering and interactions

✨ (index.tsx): add CollectionCard component to ComponentsComponent
♻️ (index.tsx): refactor to use CollectionCard instead of inline code
…fety

💡 (index.tsx): add non-null assertion operator to playground variable
♻️ (use-on-file-drop.tsx): add type annotations for folderId and folderChangeCallback
♻️ (use-auto-resize-text-area.tsx): add type annotations for value and inputRef
♻️ (use-drag-and-drop.tsx): add type annotations for setIsDragging, setFiles, currentFlowId, and setErrorData
♻️ (use-focus-unlock.tsx): add type annotations for lockChat and inputRef
♻️ (use-upload.tsx): add type annotations for uploadFile, currentFlowId, setFiles, and lockChat
♻️ (use-column-defs.tsx): add type annotation for myData
♻️ (use-row-data.tsx): add type annotations for myData and open
♻️ (index.tsx): remove commented-out code
♻️ (use-filtered-flows.tsx): add type annotations for flowsFromFolder, searchFlowsComponents, and setAllFlows
💡 (index.tsx): add non-null assertion operator to flowsFromFolder variable
…fety

💡 (use-dropdown-options.tsx): add TypeScript types to function parameters

💡 (use-api-keys.tsx): add TypeScript types to function parameters

💡 (use-handle-delete-key.tsx): add TypeScript types to function parameters

💡 (use-preload-images.tsx): add TypeScript types to function parameters

💡 (use-patch-password.tsx): add TypeScript types to function parameters

💡 (use-patch-profile-picture.tsx): add TypeScript types to function parameters

💡 (use-save-key.tsx): add TypeScript types to function parameters

💡 (use-scroll-to-element.tsx): add TypeScript types to function parameters

💡 (use-messages-table.tsx): add TypeScript types to function parameters

💡 (use-remove-messages.tsx): add TypeScript types to function parameters

💡 (use-updateMessage.tsx): add type annotations to setSuccessData and setErrorData for better type safety and code clarity
@Cristhianzl Cristhianzl self-assigned this Jun 25, 2024
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jun 25, 2024
@dosubot dosubot bot added the enhancement New feature or request label Jun 25, 2024
@ogabrielluiz ogabrielluiz merged commit 51fd1cc into dev Jun 26, 2024
8 of 9 checks passed
@ogabrielluiz ogabrielluiz deleted the cz/addTypes branch June 26, 2024 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants