Polygon-Solutions / city-keep

CityKeep - Civic Issue Reporting App
https://www.citykeep.app
MIT License
0 stars 1 forks source link

WorkInProgress Tooltip for 'Remember Me' Feature #9

Open malakivandas opened 2 years ago

malakivandas commented 2 years ago

The WorkInProgress tooltip component uses a click-away listener to show/hide the tooltip. This functionality doesn't make too much sense for the 'Remember Me' feature on the sign-in page. It would make more sense for the tooltip to show when the checkbox is checked and hide when the checkbox is unchecked.

This will probably involve using the onChange callback function of the FormControlLabel component of the 'Remember Me' feature. Instead of having to handle the callback function within the SignIn component (and any other component that uses the tooltip with this functionality) it would be best to have the handler function within the tooltip component itself. For that reason, it would be best to make an additional WorkInProgress tooltip component instead of trying to modify the existing one.

Some ways that could be used to contain the handler function within the tooltip component include:

  1. Cloning the children and passing the handler function as a prop
  2. Using the useCallback hook somehow
  3. Idk

I found this SO thread that explains some way it can be done.

NOTE: This issue will become irrelevant if the 'Remember Me' feature is implemented, since there are no other feature that would use a tooltip with this functionality and instead just use the click-away listener version.