-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #760 from tone-row/dev
v1.60.0
- Loading branch information
Showing
21 changed files
with
667 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { useState, useEffect } from "react"; | ||
import { X } from "phosphor-react"; | ||
import { Trans } from "@lingui/macro"; | ||
|
||
export function GraphTip() { | ||
const [isVisible, setIsVisible] = useState(true); | ||
const [isFading, setIsFading] = useState(false); | ||
|
||
useEffect(() => { | ||
const timeout = setTimeout(() => { | ||
setIsFading(true); | ||
}, 10000); | ||
|
||
return () => clearTimeout(timeout); | ||
}, []); | ||
|
||
if (!isVisible) return null; | ||
|
||
return ( | ||
<div | ||
className={` | ||
absolute top-4 left-4 | ||
max-w-[200px] | ||
text-xs text-gray-500/60 dark:text-gray-400/60 | ||
transition-opacity duration-1000 | ||
${isFading ? "opacity-0" : "opacity-100"} | ||
`} | ||
onTransitionEnd={() => { | ||
if (isFading) setIsVisible(false); | ||
}} | ||
> | ||
<Trans> | ||
Pro tip: Right-click any node to customize its shape and color | ||
</Trans> | ||
<button | ||
onClick={() => setIsFading(true)} | ||
className="inline-block ml-1 text-gray-400/60 hover:text-gray-600 dark:hover:text-gray-300" | ||
aria-label="Close tip" | ||
> | ||
<X size={12} /> | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.