Skip to content

refactor: convert call-to-action.js to Typescript#1223

Open
garvthakre wants to merge 4 commits intometabrainz:masterfrom
garvthakre:convert-call-to-action-to-typescript
Open

refactor: convert call-to-action.js to Typescript#1223
garvthakre wants to merge 4 commits intometabrainz:masterfrom
garvthakre:convert-call-to-action-to-typescript

Conversation

@garvthakre
Copy link
Contributor

Problem

This PR is part of the ongoing TypeScript migration of the BookBrainz codebase. The call-to-action component is currently written in JavaScript with PropTypes for type checking, which provides less type safety compared to TypeScript's compile-time type checking.

Solution

Converted the call-to-action component from JavaScript to TypeScript:
1.Renamed call-to-action.js to call-to-action.tsx
2.Removed PropTypes dependency and validation
3.Followed TypeScript patterns established in other converted components (e.g., admin-panel-search-field.tsx,admin-panel-search-results.tsx)

Areas of Impact

src\client\components\pages\parts\call-to-action.js to src\client\components\pages\parts\call-to-action.tsx (renamed and converted)

@garvthakre
Copy link
Contributor Author

hey @MonkeyDo , pls check this one and also can u close my previous PR's ,means alot to me for your time.

Copy link
Member

@MonkeyDo MonkeyDo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

You forgot to remove the original .js file, this currently creates a duplicate.

add the docs of props.query and fix the order of params and returns for better readability
@garvthakre
Copy link
Contributor Author

@MonkeyDo i guess this is also good to go now, and i am a bit confused about that interface vs types thing , so for that i need your opinion on that .

@MonkeyDo
Copy link
Member

@MonkeyDo i guess this is also good to go now, and i am a bit confused about that interface vs types thing , so for that i need your opinion on that .

To be honest I had to look up the differences between the two as well the other day, and I don't think the difference matters to us here.
Let's use type which we much more readily use in the codebase already.

@garvthakre
Copy link
Contributor Author

okay thanks for the clarification , i will change it asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments