ropali / dockyard

A fast & beautiful Docker GUI client
MIT License
239 stars 16 forks source link

Streamline UI toast usage #26

Closed EldritchPlatypoctopus closed 1 month ago

EldritchPlatypoctopus commented 1 month ago

G'day,

This is an attempt at addressing https://github.com/ropali/dockyard/issues/10

I know there might still be discussion on this. It might be worth making wrapping functions over success and error (like react-toastify), that interface felt nicer, but it does feel like SweetAlert has some nice functionality also.

Cheers

Tamsin

EldritchPlatypoctopus commented 1 month ago

Appreciate your PR but this is not how I want to do this. I want to create a single interface like toast.toast_type_method() so that I can swap the back-end at anytime wither with SW2 or react-toast. I had started the work in the branch streamline-toast-messages.

You can check my implementation here https://github.com/ropali/dockyard/blob/feat/streamline-toast-messages/src/utils/toast.js

The main issue with Sw2 was making it compatible with different themes I have. Even the light and dark theme setting dynamically was struggle. You can expand on the existing work if you like.

Thanks!!!

Sure I'll take a look! I'll close this PR, thanks for the feedback!

EldritchPlatypoctopus commented 1 month ago

Appreciate your PR but this is not how I want to do this. I want to create a single interface like toast.toast_type_method() so that I can swap the back-end at anytime wither with SW2 or react-toast. I had started the work in the branch streamline-toast-messages.

You can check my implementation here https://github.com/ropali/dockyard/blob/feat/streamline-toast-messages/src/utils/toast.js

The main issue with Sw2 was making it compatible with different themes I have. Even the light and dark theme setting dynamically was struggle. You can expand on the existing work if you like.

Thanks!!!

@ropali Oooh, I figured it out, will issue a PR today after I clean up and verify. Do you want that against your branch or main?

ropali commented 1 month ago

You can raise it against the main if you think it is working properly.