OvidijusParsiunas / deep-chat

Fully customizable AI chatbot component for your website
https://deepchat.dev
MIT License
1.26k stars 170 forks source link

fix: Submit Button Style Changes Affect Stop and Loading Icons' SVGs Too #146

Closed buzhou9 closed 3 months ago

buzhou9 commented 3 months ago

fix issues link

OvidijusParsiunas commented 3 months ago

Hey @buzhou9. Your code was really good and it made me think a little more about the submit button functionality. Unfortunately the code you had uploaded did not work for a case where submitButtonStyles had code like this as the custom submit button would still be used in the loading and stop states:

{
  submit: {svg: {content: 'test'}, container: {default: {backgroundColor: 'yellow'}}},
  stop: {svg: {styles: {default: {backgroundColor: 'blue'}}}},
}

I made a quick fix for it and refactored the code to make it a little easier to understand. Thankyou for your initial code!

OvidijusParsiunas commented 3 months ago

Please note that when this branch was merged, the latest Deep Chat package version was 1.4.11. The change in this PR will be available in the next version. The code also carries non-backward-compatible changes, hence devs that use submitButtonStyles in the new version will need to update their component configuration.

buzhou9 commented 3 months ago

Hey @buzhou9. Your code was really good and it made me think a little more about the submit button functionality. Unfortunately the code you had uploaded did not work for a case where submitButtonStyles had code like this as the custom submit button would still be used in the loading and stop states:

{
  submit: {svg: {content: 'test'}, container: {default: {backgroundColor: 'yellow'}}},
  stop: {svg: {styles: {default: {backgroundColor: 'blue'}}}},
}

I made a quick fix for it and refactored the code to make it a little easier to understand. Thankyou for your initial code!

Thank you