RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://www.npmjs.com/package/@embeddedchat/react
107 stars 214 forks source link

fix: Theming system, major UI bugs, redesign minimalist RC-like UI. #579

Closed Spiral-Memory closed 1 month ago

Spiral-Memory commented 1 month ago

Brief Title

Fixing Theming System; Redesigning Minimalist RC-like UI

Acceptance Criteria Fulfillment

Fixes #577 Fixes #539

Video/Screenshots

Before: (with no theming system, no dark mode, no multiple themes, lots of UI bugs, and inconsistent stylings)

https://github.com/RocketChat/EmbeddedChat/assets/78961432/3cccc9fc-2030-4545-a127-c865f7d0fcd5

After: (after all the mentioned fixes)

https://github.com/RocketChat/EmbeddedChat/assets/78961432/d9fea331-fa32-44df-8322-36c9fb2baa6c

https://github.com/RocketChat/EmbeddedChat/assets/78961432/ec89ab0c-25a4-4fc1-9644-d034ccf61e0c

Spiral-Memory commented 1 month ago

Hey sidmohanty11

This PR is now ready for review! It mainly focuses on resolving all major UI bugs in the app and making the app consistent with theming colors, z-index, shadows, etc., as defined in the theme files. Previously, these were applied randomly, resulting in a very messy project with inconsistent colors throughout.

I've done my best to ensure everything matches across multiple themes (refer to the video). Dark mode is also supported in all themes.

You can compare the differences between the "Before" and "After" videos to see the improvements. The app now looks much more polished and ready to use.

I will add different designs and flexibility to configure designs in future PRs.

Please review this PR. Once it's merged, I will start working on other design enhancements. A minimalist RC-like design with multiple themes is now ready.

Thanks!

Spiral-Memory commented 1 month ago

We might need to rethink how we structure styles. While the hooks approach is good, it may not be very feasible in the future. This looks odd that we are creating hooks to get just "styles" for each component

I also felt it was a little odd, but I researched it, and it's not a problem. We can't do it without hooks because we have to call useTheme(), which is a hook, and hooks can only be called inside a hook or a functional component.

If you notice, whenever calling useTheme() is not required, I am exporting it as an object or a normal function, not as hooks.

Another way is to call useTheme() in a functional component and pass it to component.styles.js.

P.S.: If I figure out a better way later, I will surely update the structure!