Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
c3a2093
added auto hide tooltip content after 1s for touch devices
codevory Jan 24, 2026
bc5cd56
added tests for auto hide on touch devices
codevory Jan 24, 2026
d4b8acd
updated docs for adding auto hide on tooltip component
codevory Jan 24, 2026
a2acccc
removed extra comments
codevory Jan 24, 2026
b87a2db
formating..
codevory Jan 24, 2026
911d03c
fixed memory leak problem
codevory Jan 24, 2026
c165782
improved the docs
codevory Jan 24, 2026
782e72c
format issue
codevory Jan 24, 2026
ac80098
fixed formatting with prettier
codevory Jan 24, 2026
a256aad
removed eventBubling code
codevory Jan 27, 2026
491dd0a
docs improvement
codevory Jan 27, 2026
f063343
Merge branch 'main' into main
codevory Jan 27, 2026
bbdd3ce
eslint issue
codevory Jan 27, 2026
62c7f9d
added SSR safety to avoid throwing error on server side rendering
codevory Jan 27, 2026
3713b64
added prettier style formatting
codevory Jan 27, 2026
12d766e
fixed formatting issue of newly added files
codevory Jan 27, 2026
b1bb0e5
added formatting style
codevory Jan 27, 2026
f26545e
removed prettier duplicate configuration
codevory Jan 27, 2026
1da1b47
Merge branch 'Ryan-Millard:main' into main
codevory Jan 30, 2026
1423944
added position as props to set independent position for cards with de…
codevory Jan 30, 2026
47ee36c
added Tooltip position as top to fix the content position bug
codevory Jan 30, 2026
59f7a8a
Merge branch 'main' of https://github.com/codevory/Img2Num
codevory Jan 30, 2026
b48bf40
formatting fixed
codevory Jan 30, 2026
8043328
style(tooltip): clean up tooltip code and fix WasmImageProcessor tooltip
Ryan-Millard Jan 30, 2026
7602015
style: run format script
Ryan-Millard Jan 30, 2026
8c02b1a
fix(tooltip-prop-types): remove required from props with defaults
Ryan-Millard Jan 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/components/Tooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import PropTypes from "prop-types";
import { Tooltip as ReactTooltip } from "react-tooltip";
import { useState, useEffect, useRef, useId, cloneElement, isValidElement } from "react";

export default function Tooltip({ content, children, id, dynamicPositioning = true }) {
export default function Tooltip({ children, content = "Tooltip content", id = undefined, position = "right", dynamicPositioning = true }) {
const reactId = useId();
const tooltipId = id || `tooltip-${reactId}`;
const tooltipId = id ?? `tooltip-${reactId}`;

const [isOpen, setIsOpen] = useState(false);
const [isTouchDevice, setIsTouchDevice] = useState(false);
const hideTimeoutRef = useRef(null);
Expand Down Expand Up @@ -115,9 +116,9 @@ export default function Tooltip({ content, children, id, dynamicPositioning = tr
{childWithTooltip}
<ReactTooltip
id={tooltipId}
place="right"
place={position}
appendTo={typeof document !== "undefined" ? document.body : undefined}
positionStrategy="fixed"
positionStrategy="absolute"
fallbackPlacements={dynamicPositioning ? ["bottom", "top", "left"] : []}
openOnFocus
isOpen={isTouchDevice ? isOpen : undefined}
Expand All @@ -127,8 +128,9 @@ export default function Tooltip({ content, children, id, dynamicPositioning = tr
}

Tooltip.propTypes = {
content: PropTypes.string.isRequired,
children: PropTypes.node.isRequired,
content: PropTypes.string,
id: PropTypes.string,
dynamicPositioning: PropTypes.bool,
position: PropTypes.string,
};
14 changes: 7 additions & 7 deletions src/components/WasmImageProcessor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,16 @@ const WasmImageProcessor = () => {
const EmptyState = useMemo(
() => (
<>
<Tooltip content="Upload an image from your device">
<Tooltip content="Upload an image">
<Upload className={`anchor-style ${styles.uploadIcon}`} />
</Tooltip>

<p className={`text-center ${styles.dragDropText}`}>
Drag & Drop or{" "}
<Tooltip content="Select an image file from your computer">
<span className={`anchor-style ${styles.noTextWrap}`}>Choose File</span>
</Tooltip>
</p>
<Tooltip content="Choose an image">
<p className={`text-center ${styles.dragDropText}`}>
Drag & Drop or&nbsp;
<span className={`anchor-style ${styles.noTextWrap}`}>Choose Image</span>
</p>
</Tooltip>
</>
),
[],
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Home/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ const Home = () => (

<div className={styles.featureContainer}>
<GlassCard>
<Tooltip content="Performance feature">
<Tooltip content="Performance feature" position="top">
<h3>⚡ Fast & Lightweight</h3>
</Tooltip>
<p>Compiled C++ runs in your browser via WebAssembly with near-native speed.</p>
</GlassCard>

<GlassCard>
<Tooltip content="Integration feature">
<Tooltip content="Integration feature" position="top">
<h3>🛠️ Easy to Integrate</h3>
</Tooltip>
<p>Minimal dependencies, works with any project or workflow.</p>
Expand Down