Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSES #560] Add logic to make sure that if one card has a tooltip then another shouldn't be opened #562

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

epixieme
Copy link
Collaborator

[CLOSES #560] Add logic to make sure that if one card has a tooltip then another shouldn't be opened

Description

Add logic so that if the screen is scrolled outside of the current screen's height, then the tooltip fades out. So in summary, if we scroll and it passes the current threshold set in the code it closes the tooltip.

Changes Made

  • Returned fadeOut from the useCMTooltip hook
  • Added the following logic to the ClimateFeedScreen
 const handleScroll = (event: { nativeEvent: { contentOffset: { y: number } } }) => {
    // Set the threshold for scrolling
    const threshold = Dimensions.get('window').height;
    // Check if the user has scrolled beyond the threshold
    if (event.nativeEvent.contentOffset.y > threshold) {
      // Fade out the tooltip
      fadeOut();
    }
  };

Screenshots

If applicable, add screenshots to showcase the changes visually.

Checklist

  • I will open the PR as a draft and will look at the 'Files Changed' tab to remove all unnecessary changes.

Additional Comments

Add any additional comments or notes for reviewers.

Copy link

github-actions bot commented Apr 12, 2024

🚀 Expo preview is ready!

  • Project → climate-mind
  • Platforms → android, ios
  • Runtime Version → exposdk:50.0.0
  • More info

Learn more about 𝝠 Expo Github Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add logic make sure that if one card has tooltip then another shouldn’t be opened.
2 participants