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

feat: add text replacer tool functionality #31

Closed
wants to merge 0 commits into from
Closed

Conversation

EugSh1
Copy link
Collaborator

@EugSh1 EugSh1 commented Mar 5, 2025

Hi! I found the issue #10 regarding the text replacer tool and decided to work on it. This is my very first open-source contribution!

I’ve implemented the functionality to find and replace text within the textarea. The tool allows users to replace text based on a regular expression or a simple text string.

This is a great experience for me, and I’m excited to contribute to this project. Please let me know if there are any changes or improvements needed. Looking forward to your feedback!

Copy link
Owner

@iib0011 iib0011 left a comment

Choose a reason for hiding this comment

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

Nice job for a first contribution. Just need some changes. Look at my comments and use the ToolContent component. Git merge master. You will see it. It is a new component. There is an example usage on list/reverse

<SimpleRadio
onClick={() => {
updateField('mode', 'text');
compute({ ...values, mode: 'text' }, input);
Copy link
Owner

Choose a reason for hiding this comment

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

no need it is automatically computed

function compute(optionsValues: typeof initialValues, input: string) {
const { searchValue, searchRegexp, replaceValue, mode } = optionsValues;
setResult(
mode === 'text'
Copy link
Owner

Choose a reason for hiding this comment

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

change the replaceText method to take as argument all options

@EugSh1
Copy link
Collaborator Author

EugSh1 commented Mar 6, 2025

Hi!

I’ve made all the changes: refactored the replaceText method to accept all options as arguments, and removed compute from the SimpleRadio component. However, I couldn't find the ToolContent component mentioned in list/reverse. Let me know if I missed something!

@EugSh1
Copy link
Collaborator Author

EugSh1 commented Mar 6, 2025

I realized that I missed synchronizing the changes in my fork with the main repository. Because of this, I wasn’t able to see the ToolContent and other updates, which led to the confusion. I’m currently working on the changes, and I will update everything shortly. I apologize for the inconvenience.

@EugSh1
Copy link
Collaborator Author

EugSh1 commented Mar 6, 2025

Hi! Just to clarify, the previous pull request was automatically closed after a force push to the main branch by my account (though I didn’t manually push anything). I think it was caused by some unexpected synchronization or update, but I've opened a new PR with all the fixes. Everything should be good now. You can check it here: Link to the new PR.

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