Skip to content

Enhancing Social Media Icons with Hover Effects and Tooltips for Better UX #1199

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

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

Conversation

srinjoy933
Copy link
Contributor

Resolves issues1168

Add the PR description here.

solves the issue:
When hovering over an icon, it should slightly enlarge (scale effect).

The icon's color should change to match the original brand color of the respective app.

A tooltip should appear, showing the platform name (e.g., "Discord", "Instagram", "LinkedIn", "YouTube").

Copy link
Contributor

coderabbitai bot commented Mar 28, 2025

Summary by CodeRabbit

  • New Features

    • Enhanced icon interactions with smooth transitions and dynamic, context-sensitive color changes for improved visual feedback.
  • Style

    • Updated tooltip behavior with refined placement for a more responsive and streamlined user experience.

Walkthrough

The pull request updates the DisplayIcon component to enhance its functionality and styling. The import for Tooltip has been modified to source from @heroui/tooltip, and the previous TooltipRecipe import has been removed. Icon styling has been improved with transition effects and hover scaling through a new function, getBrandColorClass, which assigns dynamic color classes. Additionally, the tooltip props have been adjusted, with some removed and others replaced for better management. The overall structure of the component has been simplified to improve clarity.

Changes

File(s) Change Summary
frontend/src/components/DisplayIcon.tsx - Updated Tooltip import from components/ui/tooltip to @heroui/tooltip
- Removed TooltipRecipe import
- Modified icon styling to use transition effects and hover scaling via a new getBrandColorClass function
- Updated tooltip props (recipe and openDelay removed, positioning replaced by placement)

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6f76ff9 and ea6bb54.

📒 Files selected for processing (1)
  • frontend/src/components/DisplayIcon.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/DisplayIcon.tsx

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@srinjoy933
Copy link
Contributor Author

srinjoy933 commented Mar 28, 2025

can you please review @arkid15r whether any changes are required or not?

@srinjoy933
Copy link
Contributor Author

is it okay @arkid15r ?

Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. Left some comments!

style={{ backgroundColor: level.color }}
>
<FontAwesomeIconWrapper icon={level.icon} className="text-white" />
</span>
</Tooltip>
)}
{/* Project title and link */}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep these as they separate logic blocks 👍🏼

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like these new colorful icons 🤔 Can we keep them in the same color? Possibly, showing brand colors on hover.
This is how they looked like before. We can keep blue, or the grey that you have by default.
Screenshot 2025-03-29 at 12 12 19 PM
Screenshot 2025-03-29 at 1 56 43 PM

Copy link
Contributor Author

@srinjoy933 srinjoy933 Mar 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kasya can you clarify a little bit more on this issue, exactly would you like me to change the colours to their brand colurs, or let it be blue or grey?thank you!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srinjoy933 yes, I meant that we should show a single color - blue or grey, I'm fine with the grey one 👍🏼

className={cn(
'flex h-8 w-8 items-center justify-center rounded-full text-xs shadow'
)}
className="flex h-8 w-8 items-center justify-center rounded-full shadow"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we show tooltip at the bottom of the icon? This way it won't cover chapter members avatars.
Screenshot 2025-03-29 at 1 54 15 PM

@srinjoy933 srinjoy933 requested a review from kasya March 29, 2025 22:44
@srinjoy933
Copy link
Contributor Author

srinjoy933 commented Mar 29, 2025

i have made the changes @kasya as you have suggested , can you review those once @arkid15r ,@kasya thank you!

Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested some changes ⬇️

.join(' ')
const iconClassName = `transition-colors duration-200 ${
hovered ? Icons[item as IconKeys]?.colorClass || 'text-gray-600' : 'text-gray-600 dark:text-gray-300'
}`

return icons[item] ? (
<Tooltip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made the changes you suggested.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srinjoy933 still no tooltips on Social links. I do see tooltips everywhere else.

@srinjoy933
Copy link
Contributor Author

@kasya, @arkid15r can you review the changes once. thank you!

@srinjoy933 srinjoy933 requested a review from kasya March 31, 2025 16:37
Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srinjoy933
Copy link
Contributor Author

made some changes ,i guest it will appear now, please see it once @kasya .thank you

@srinjoy933 srinjoy933 requested a review from kasya April 3, 2025 03:13
.join(' ')
const iconClassName = `transition-colors duration-200 ${
hovered ? Icons[item as IconKeys]?.colorClass || 'text-gray-600' : 'text-gray-600 dark:text-gray-300'
}`

return icons[item] ? (
<Tooltip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srinjoy933 still no tooltips on Social links. I do see tooltips everywhere else.

const iconClassName = [
'text-gray-600 dark:text-gray-300',
item === 'stars_count' || item === 'starsCount' ? 'icon-rotate' : '',
item === 'forks_count' ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These don't have animation they had before. I'd prefer we keep it.

@srinjoy933 srinjoy933 requested a review from kasya April 9, 2025 13:57
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3b9183 and cca71a2.

📒 Files selected for processing (1)
  • frontend/src/components/DisplayIcon.tsx (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
frontend/src/components/DisplayIcon.tsx (2)
frontend/src/utils/data.ts (2)
  • Icons (66-107)
  • IconKeys (109-109)
frontend/src/components/ui/tooltip.tsx (1)
  • Tooltip (13-44)
🔇 Additional comments (5)
frontend/src/components/DisplayIcon.tsx (5)

47-47: Good improvement to number formatting.

Adding precision to millify ensures consistent number formatting with one decimal place.


53-53: Type safety improvement for icon reference.

Using the IconKeys type is more type-safe than the previous approach with keyof typeof Icons.


22-24:

❓ Verification inconclusive

The hover effects align with PR objectives, but check GitHub metric icons.

The transition, scaling, and brand colors on hover match the PR requirements. However, previous review comments indicated these changes may have affected existing hover animations for GitHub metrics icons (stars, forks, etc.).


🏁 Script executed:

#!/bin/bash
# Check if there were specific styles for GitHub metric icons that might have been affected

echo "Checking for existing icon styles in CSS files:"
find frontend/src -name "*.css" -o -name "*.scss" | xargs grep -l "icon-rotate\|icon-flip"

echo -e "\nChecking for any icon-related classes:"
find frontend/src -name "*.css" -o -name "*.scss" | xargs grep -l "\.icon-\|rotate-container\|flip-container"

Length of output: 448


Action Required: Verify GitHub Metric Icons Hover Behavior

The updated hover classes in frontend/src/components/DisplayIcon.tsx (lines 22–24) meet the PR objectives. However, our CSS search shows that the only file referencing potential GitHub metric icon styles (e.g., for rotation/flip effects) is frontend/src/index.css. Please double-check that the new hover effects do not inadvertently override or conflict with the hover animations for GitHub metric icons (such as stars and forks):

  • Ensure that any rules in frontend/src/index.css (or elsewhere) targeting classes like icon-rotate, icon-flip, or similar remain intact.
  • Confirm via manual QA that GitHub metric icons retain their intended animations without interference from the transition-transform, hover:scale-110, or brand color classes applied to non-metric icons.

39-39:

❓ Verification inconclusive

Update tooltip props to match new package API.

The tooltip props have been adjusted to work with the @heroui/tooltip package, but previous review comments indicate tooltips aren't appearing. Ensure that the new props (delay instead of openDelay, placement instead of positioning) are correct for the new package.

Also applies to: 42-42


🏁 Script executed:

#!/bin/bash
# Check the documentation or type definitions for @heroui/tooltip

echo "Checking tooltip props in @heroui/tooltip:"
find node_modules/@heroui/tooltip -name "*.d.ts" | xargs grep -A 20 "interface.*TooltipProps\|type.*TooltipProps"

# Look for examples of tooltip usage in the codebase
echo -e "\nChecking for other usage examples of @heroui/tooltip:"
grep -r "import.*@heroui/tooltip" --include="*.tsx" frontend/src/ | grep -v "DisplayIcon.tsx"
grep -r "<Tooltip.*delay=" --include="*.tsx" frontend/src/ | grep -v "DisplayIcon.tsx"
grep -r "<Tooltip.*placement=" --include="*.tsx" frontend/src/ | grep -v "DisplayIcon.tsx"

Length of output: 669


Action Required: Confirm Tooltip API Prop Changes

The tooltip component in frontend/src/components/DisplayIcon.tsx (lines 39 and 42) now uses the new props (delay instead of openDelay, and placement instead of positioning). However, our automated search couldn’t locate the @heroui/tooltip package or usage examples in the codebase to verify these changes. Please manually verify that these updated prop names align with the package’s current API.

  • File: frontend/src/components/DisplayIcon.tsx
  • Lines: 39 and 42
  • Issue: Tooltip props updated to match @heroui/tooltip API; ensure that using delay and placement is correct per the package documentation.

60-69:

❓ Verification inconclusive

Brand color hover effects meet requirements but check applicability.

The implementation of brand colors on hover aligns with the PR objectives. However, ensure this is only applied to social media icons and not to GitHub metrics icons per previous review comments.

Also verify there's a consistent approach to color handling by examining:


🏁 Script executed:

#!/bin/bash
# Check where this component is used and with what item values

echo "Looking for DisplayIcon usage with social media items:"
grep -r "<DisplayIcon" --include="*.tsx" frontend/src/ | grep -E "item=['\"]discord|instagram|linkedin|youtube"

echo -e "\nLooking for all DisplayIcon usages:"
grep -r "<DisplayIcon" --include="*.tsx" frontend/src/

Length of output: 440


🌐 Web query:

What are best practices for handling hover effects and brand colors for social media icons in React applications?

💡 Result:

To handle hover effects and brand colors for social media icons in React effectively, follow these best practices:

1. Use Dedicated Icon Libraries

  • Leverage React-specific libraries like react-icons or react-social-icons to simplify implementation and ensure performance. These libraries provide optimized SVG icons and eliminate the need to load entire icon sets[5][6][10].

    // Example using react-social-icons[5]
    import { SocialIcon } from 'react-social-icons';
    
    <SocialIcon url="https://twitter.com" bgColor="#1DA1F2" /> 
  • Import icons selectively to reduce bundle size:

    // Instead of importing all icons[6][10]
    import { FaTwitter } from 'react-icons/fa';

2. Brand Color Implementation

  • Apply platform-specific brand colors using official HEX values:

    /* CSS class approach[1][8] */
    .twitter { color: #1DA1F2; }
    .youtube { color: #FF0000; }
    // Inline style method[2][5]
    <MDBBtn style={{ backgroundColor: '#1DA1F2' }}>
  • Use dynamic props for color theming:

    <FontAwesomeIcon icon={faTwitter} color={isDarkMode ? '#fff' : '#1DA1F2'} />[1][4]

3. Hover Effects

  • CSS transitions for smooth animations[1][3][8]:

    .social-icon {
      transition: transform 0.3s ease;
    }
    .social-icon:hover {
      transform: translateY(-3px);
      opacity: 0.8;
    }
  • State-driven hover effects for complex interactions[3][9]:

    const [hovered, setHovered] = useState(false);
    
    <FaTwitter 
      color={hovered ? '#0D8ECF' : '#1DA1F2'}
      onMouseEnter={() => setHovered(true)}
      onMouseLeave={() => setHovered(false)}
    />

4. Accessibility & Semantics

  • Add ARIA labels for screen readers[5][10]:

    <SocialIcon 
      aria-label="Follow us on Twitter"
      url="https://twitter.com"
    />
  • Use semantic HTML:

    <a href="https://twitter.com" role="button">
      <FaTwitter />
    </a>

5. Performance Optimization

  • Global icon configuration with IconContext.Provider[6][10]:

    <IconContext.Provider value={{ size: '2em', className: 'global-icons' }}>
      <FaTwitter />
      <FaFacebook />
    </IconContext.Provider>
  • Lazy load non-critical icons using dynamic imports:

    const TwitterIcon = React.lazy(() => import('react-icons/fa').then(module => ({ default: module.FaTwitter })));

6. Responsive Design

  • Use relative units for sizing[7][8]:

    <FaTwitter size="clamp(1.5rem, 3vw, 2rem)" />
  • Media queries for hover behavior[3]:

    @media (hover: hover) {
      .social-icon:hover { /* styles */ }
    }

Recommended Implementation

import { SocialIcon } from 'react-social-icons';

const SocialIcons = () => (
  <div className="social-container">
    <SocialIcon 
      url="https://twitter.com" 
      bgColor="transparent"
      fgColor="#1DA1F2"
      className="social-icon"
      aria-label="Twitter"
    />
    <SocialIcon
      url="https://facebook.com"
      bgColor="transparent" 
      fgColor="#1877F2"
      className="social-icon"
      aria-label="Facebook"
    />
  </div>
);
.social-icon {
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin: 0 12px;
}

.social-icon:hover {
  transform: translateY(-3px);
  opacity: 0.8;
}

@media (prefers-reduced-motion) {
  .social-icon {
    transition: none;
  }
}

This approach combines brand authenticity (using official colors[1][5]), accessibility[3][10], and performance[6][7] while maintaining visual polish through CSS transitions[1][8]. For complex use cases, consider combining with state management for dynamic interactions[3][9].

Citations:


Action Required: Verify That Hover Effects Are Limited to Social Media Icons
The implementation of hover effects via getBrandColorClass conforms to the PR objectives and best practices for social media icon branding. However, please confirm that these brand-specific hover styles are only applied when the icon represents a social media channel (e.g. Discord, Instagram, LinkedIn, YouTube) and are not inadvertently used for GitHub metrics icons. In particular, note that our search located a usage in frontend/src/components/Card.tsx without clear evidence that it’s a social media icon. Verify that any such usage is appropriate or adjust the logic accordingly.

Comment on lines 39 to 42
delay={150}
closeDelay={100}
showArrow
positioning={{ placement: 'top' }}
placement="top"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Ensure tooltips appear for all icon types.

Previous review comments repeatedly mentioned that tooltips weren't appearing for social links after your changes. Test the tooltip functionality for all icon types, particularly social media icons.

Since multiple reviewers have mentioned this issue, please verify that tooltips appear for all icon types after your changes. Make sure the delay and placement properties are correctly implemented for the @heroui/tooltip package.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (2)
frontend/src/components/DisplayIcon.tsx (2)

47-47: Consider making precision configurable

Adding precision to millify is good, but consider making it configurable for different contexts.

-? millify(icons[item], { precision: 1 })
+? millify(icons[item], { precision: getPrecisionForItem(item) })

// Add somewhere in the file:
function getPrecisionForItem(item: string): number {
  // Default precision is 1, but can be customized for specific items
  return 1;
}

60-69: Improve the brand color implementation

The implementation matches the requirements but can be enhanced for better maintainability.

Consider these improvements:

function getBrandColorClass(item: string): string {
  const brandColors: Record<string, string> = {
    discord: 'hover:text-[#5865F2]',
    instagram: 'hover:text-[#E4405F]',
    linkedin: 'hover:text-[#0077B5]',
    youtube: 'hover:text-[#FF0000]',
+    // Add other platforms as needed
  }

-  return brandColors[item.toLowerCase()] || 'text-gray-600 dark:text-gray-300'
+  // Only apply hover color to social media icons
+  const isSocialMediaIcon = Object.keys(brandColors).includes(item.toLowerCase())
+  return isSocialMediaIcon 
+    ? brandColors[item.toLowerCase()] 
+    : 'text-gray-600 dark:text-gray-300'
}

This approach explicitly checks if the icon is a social media icon before applying brand colors, which is more intentional and maintainable.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cca71a2 and 6f76ff9.

📒 Files selected for processing (1)
  • frontend/src/components/DisplayIcon.tsx (3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
frontend/src/components/DisplayIcon.tsx (2)
frontend/src/utils/data.ts (2)
  • Icons (66-107)
  • IconKeys (109-109)
frontend/src/components/ui/tooltip.tsx (1)
  • Tooltip (13-44)
🔇 Additional comments (1)
frontend/src/components/DisplayIcon.tsx (1)

7-58:

❓ Verification inconclusive

Test tooltip functionality for all icon types

Previous review comments repeatedly mentioned tooltips weren't appearing for social links.

Please verify tooltip functionality for all icon types, particularly social media icons. Run this script to check for potential issues:


🏁 Script executed:

#!/bin/bash
# Check if @heroui/tooltip package is installed
echo "Checking if @heroui/tooltip is installed:"
if [ -d "node_modules/@heroui/tooltip" ]; then
  echo "Package found in node_modules."
else
  echo "Package NOT found in node_modules. This could explain tooltip issues."
fi

# Check package.json for dependency
echo -e "\nChecking package.json dependencies:"
grep -E "@heroui/tooltip" package.json || echo "Not found in package.json"

# Check for other tooltip implementations
echo -e "\nChecking for tooltip component implementations:"
find frontend/src/components -type f -name "*.tsx" | xargs grep -l "Tooltip" | sort

Length of output: 984


Action Required: Verify Custom Tooltip Functionality for All Icon Types

The code in frontend/src/components/DisplayIcon.tsx now relies on our local Tooltip component (see frontend/src/components/ui/tooltip.tsx) rather than the external @heroui/tooltip package—which is neither installed in node_modules nor listed in the dependency file. Please manually test the tooltip behavior for all icon types, with particular focus on social media icons. Ensure that on hover the tooltip appears as expected with the correct delay and content. If any issues persist (especially with social links), further investigation into the custom Tooltip implementation may be required.

Comment on lines +22 to +24
'transition-transform duration-200',
'hover:scale-110',
getBrandColorClass(item),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Ensure hover effects don't interfere with existing animations

Your implementation adds nice hover effects but might be interfering with existing animations for GitHub metrics icons.

Consider a more contextual approach that preserves original animations:

const iconClassName = [
  'transition-transform duration-200',
  'hover:scale-110',
-  getBrandColorClass(item),
+  // Only apply brand colors to social media icons
+  isSocialMediaIcon(item) ? getBrandColorClass(item) : 'text-gray-600 dark:text-gray-300',
  item === 'stars_count' || item === 'starsCount' ? 'icon-rotate' : '',
  item === 'forks_count' ||
  item === 'contributors_count' ||
  item === 'forksCount' ||
  item === 'contributionCount'
    ? 'icon-flip'
    : '',
]

Add a helper function to determine if an icon is a social media icon:

function isSocialMediaIcon(item: string): boolean {
  return ['discord', 'instagram', 'linkedin', 'youtube'].includes(item.toLowerCase())
}

@@ -1,12 +1,10 @@
import { Tooltip } from '@heroui/tooltip'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Resolve the dependency issue with @heroui/tooltip

Previous review comments indicate that this external package may not be installed, causing tooltip functionality issues. The previous version used a local tooltip implementation from frontend/src/components/ui/tooltip.tsx.

Either:

  1. Install @heroui/tooltip package if that's the intended solution, or
  2. Revert to using the local tooltip implementation:
-import { Tooltip } from '@heroui/tooltip'
+import { Tooltip } from 'components/ui/tooltip'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { Tooltip } from '@heroui/tooltip'
import { Tooltip } from 'components/ui/tooltip'

Comment on lines 37 to 43
<Tooltip
content={`${Icons[item as keyof typeof Icons]?.label}`}
recipe={TooltipRecipe}
openDelay={150}
delay={150}
closeDelay={100}
showArrow
positioning={{ placement: 'top' }}
placement="bottom"
>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix tooltip API incompatibility issues

The tooltip API has changed, which might explain why tooltips aren't appearing for social links as mentioned in previous reviews.

If continuing with the external package, ensure the props match the expected API:

<Tooltip
  content={`${Icons[item as keyof typeof Icons]?.label}`}
  delay={150}
  closeDelay={100}
  showArrow
  placement="bottom"
+  // Add any other required props from @heroui/tooltip
>

Alternatively, if reverting to the local tooltip implementation:

<Tooltip
  content={`${Icons[item as keyof typeof Icons]?.label}`}
-  delay={150}
+  openDelay={150}
  closeDelay={100}
  showArrow
-  placement="bottom"
+  positioning="bottom"
>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Tooltip
content={`${Icons[item as keyof typeof Icons]?.label}`}
recipe={TooltipRecipe}
openDelay={150}
delay={150}
closeDelay={100}
showArrow
positioning={{ placement: 'top' }}
placement="bottom"
>
<Tooltip
content={`${Icons[item as keyof typeof Icons]?.label}`}
delay={150}
closeDelay={100}
showArrow
placement="bottom"
// Add any other required props from @heroui/tooltip
>
Suggested change
<Tooltip
content={`${Icons[item as keyof typeof Icons]?.label}`}
recipe={TooltipRecipe}
openDelay={150}
delay={150}
closeDelay={100}
showArrow
positioning={{ placement: 'top' }}
placement="bottom"
>
<Tooltip
content={`${Icons[item as keyof typeof Icons]?.label}`}
openDelay={150}
closeDelay={100}
showArrow
positioning="bottom"
>

Copy link

sonarqubecloud bot commented Apr 9, 2025

@srinjoy933
Copy link
Contributor Author

please have a look at this @kasya. is it ok now?

Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srinjoy933 Could you add a video of how this works on your computer?
I'm still not able to see any tooltips on social media icons for Chapters.

If you check Card.tsx component there's no Tooltip anywhere near social links

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

Successfully merging this pull request may close these issues.

3 participants