IDEMSInternational / open-app-builder

PLH App Frontend
GNU General Public License v3.0
5 stars 24 forks source link

[FEATURE] Consistency across button interactions #2232

Open jfmcquade opened 4 months ago

jfmcquade commented 4 months ago

What? Currently, button-like components can exhibit one of three different behaviours when clicked on:

  1. An animated ripple effect, e.g. most variations of the button component

https://github.com/IDEMSInternational/parenting-app-ui/assets/64838927/a157ce21-9724-45a7-978f-54f28134476a

  1. A static colour change, e.g. button with variant: card-portrait

https://github.com/IDEMSInternational/parenting-app-ui/assets/64838927/b0109fa7-afae-46f5-ba3a-2fc384d895f3

  1. No interaction, e.g. tile components

https://github.com/IDEMSInternational/parenting-app-ui/assets/64838927/cc4471eb-cc45-434a-be09-d85784b5d731

These interactions should be standardised across all button-like components, likely favouring the ripple effect.

Why? Ensuring that similar components feel and behave similarly improves the UX

How? We should be able to add the ion-ripple-effect to all relevant clickable components

kwAsant commented 1 week ago

Card-portrait cannot have ripple effect. Seems to be the same with the tile too.

jfmcquade commented 1 week ago

Card-portrait cannot have ripple effect. Seems to be the same with the tile too.

I got a version working on the card-portrait button. Demo:

https://github.com/IDEMSInternational/open-app-builder/assets/64838927/4c826876-9147-4e37-ac9b-bec678fbd6bf

Here are the code changes to src/app/shared/components/template/components/button/button.component.html:

Screenshot 2024-07-08 at 17 44 07

I copied the pattern from the ion-ripple-effect docs.

An issue with this quick implementation is that the ripple effect doesn't respect the rounded corners of the button component, so you could see if you can resolve that.