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

feat(UI-1313): add tooltip to sidebar menu items #987

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

J1za
Copy link
Collaborator

@J1za J1za commented Feb 11, 2025

Description

Add tooltip to sidebar menu

Linear Ticket

https://linear.app/autokitteh/issue/UI-1313/menu-hover-with-name-tootlip

What type of PR is this? (check all applicable)

  • 💡 (feat) - A new feature (non-breaking change which adds functionality)
  • 🔄 (refactor) - Code Refactoring - A code change that neither fixes a bug nor adds a feature
  • 🐞 (fix) - Bug Fix (non-breaking change which fixes an issue)
  • 🏎 (perf) - Optimization
  • 📄 (docs) - Documentation - Documentation only changes
  • 📄 (test) - Tests - Adding missing tests or correcting existing tests
  • 🎨 (style) - Styles - Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • ⚙️ (ci) - Continuous Integrations - Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • ☑️ (chore) - Chores - Other changes that don't modify src or test files
  • ↩️ (revert) - Reverts - Reverts a previous commit(s).

@@ -5,20 +5,20 @@ import { FloatingPortal, offset, useFloating, useHover, useInteractions, shift }
import { TooltipProps } from "@src/interfaces/components";
import { cn } from "@src/utilities";

export const Tooltip = ({ content, children, variant = "default" }: TooltipProps) => {
export const Tooltip = ({ content, children, variant = "default", position = "top", disabled }: TooltipProps) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export const Tooltip = ({ content, children, variant = "default", position = "top", disabled }: TooltipProps) => {
export const Tooltip = ({ content, children, variant = "default", position = "top", hide }: TooltipProps) => {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

changed

Comment on lines 39 to 40
className={cn("z-40 rounded-md px-3 py-2 text-sm shadow-md", {
"bg-gray-850 text-white": variant === "default",
Copy link
Contributor

Choose a reason for hiding this comment

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

Where variant === error have gone? 🤔
Also, what do you think if we'll extract the styles into a constant?

const tooltipStyles = {
	default: "bg-gray-850 text-white",
	error: "bg-red-600 text-white",
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good idea, refactored

@RonenMars RonenMars enabled auto-merge (squash) February 11, 2025 14:59
@RonenMars RonenMars force-pushed the vitaly/feat/tooltip-sidebar-menu-items branch from 6b7e449 to 21f1e02 Compare February 11, 2025 14:59
@RonenMars RonenMars merged commit 2fa38c4 into main Feb 11, 2025
26 checks passed
@RonenMars RonenMars deleted the vitaly/feat/tooltip-sidebar-menu-items branch February 11, 2025 15:06
Copy link

🎉 This PR is included in version 2.141.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants