scaleflex / filerobot-image-editor

Edit, resize, and filter any image! Any questions or issues, please report to https://github.com/scaleflex/filerobot-image-editor/issues
MIT License
1.37k stars 341 forks source link

finishButtonLabel fails to change button label #150

Closed pantpoorti closed 2 years ago

pantpoorti commented 2 years ago

Hi,

I am looking into this library to include in my React project. So far it looks great! I wanted to change the label of the "Download" button to "Update". I found the finishButtonLabel property while going through the documentation. But the button still appears as "Download".

I am using it like below, <FilerobotImageEditor src={lastImage.current || 'https://picsum.photos/2000'} finishButtonLabel="Update" onClose={() => { setShowImageEditor(false) }} onBeforeComplete={(props:any) => { lastImage.current = (props.canvas.toDataURL()) return false }} show={showImageEditor} />

Am I using it incorrectly?

AhmeeedMostafa commented 2 years ago

Hey @pantpoorti , You should provide it inside config property config={{ finishButtonLabel: 'update' }}

Also I advice you to switch to V4 (it still in BETA but very soon it'll be in prod.) as it has more features, customizations & fixed some bugs in latest v3 release

pantpoorti commented 2 years ago

Hello!

Thanks for the response. I have include V4 in the project. Will test it out! The config doesn't seem to work. Still showing 'Download' label.

This is a react application. I saw the config setup in the VanillaJS example.

My code now looks like this, <FilerobotImageEditor src={lastImage.current || 'https://picsum.photos/20000'} config={{ finishButtonLabel: 'Update' }} onClose={() => { setShowImageEditor(false) }} onBeforeComplete={(props:any) => { lastImage.current = (props.canvas.toDataURL()) return false }} show={showImageEditor} />

Your help is much appreciated!

AhmeeedMostafa commented 2 years ago

Could you please make an example on codesandbox or some other platform and share it? It should work fine if you made it config={{ finishButtonLabel: 'Update' }} image

pantpoorti commented 2 years ago

Sure, I added the change to one of the samples. Here is a link.

I am also facing an issue in integrating V4. I have React version 16.10.2 and styled-component version 5.1.0, which should meet the requirements.

I am getting the below error,

./node_modules/react-filerobot-image-editor/lib/components/common/Slider/Slider.styled.js Module not found: Can't resolve '@scaleflex/ui/core/continuous-slider' in '..\ReactApp\node_modules\react-filerobot-image-editor\lib\components\common\Slider'

Any ideas?

AhmeeedMostafa commented 2 years ago

the issue for finishButtonLabel doesn't work cause u're using an old version, that propery is supported starting from +v3.12.15,

for V4 issue could u tell me which BETA version are u using?

pantpoorti commented 2 years ago

Using version => image

AhmeeedMostafa commented 2 years ago

We should close this issue, so could u open a new issue with that issue and mention some helpful details to check? It would be nice also to provide version & dependencies properties mentioned in node_modules/react-filerobot-image-editor In that new issue as it might help

AhmeeedMostafa commented 2 years ago

Closed for answering, for the other issue of V4 please install the latest NPM version and if u still have that issue please open another issue/thread