-
Notifications
You must be signed in to change notification settings - Fork 147
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/add ignore inscriptions UI #6028
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { useCallback, useState } from 'react'; | ||
|
||
interface HoverBind { | ||
onMouseEnter(event: React.MouseEvent<HTMLElement, MouseEvent>): void; | ||
onMouseLeave(event: React.MouseEvent<HTMLElement, MouseEvent>): void; | ||
} | ||
|
||
export function useHoverWithChildren(): [boolean, HoverBind] { | ||
const [isHovered, setIsHovered] = useState(false); | ||
|
||
const handleMouseEnter = useCallback(() => { | ||
setIsHovered(true); | ||
}, []); | ||
|
||
const handleMouseLeave = useCallback((event: React.MouseEvent<HTMLElement, MouseEvent>) => { | ||
const relatedTarget = event.relatedTarget as HTMLElement; | ||
|
||
// If the related target is a child of the current element, don't trigger mouseleave | ||
if (event.currentTarget.contains(relatedTarget)) { | ||
return; | ||
} | ||
|
||
setIsHovered(false); | ||
}, []); | ||
|
||
const bind: HoverBind = { | ||
onMouseEnter: handleMouseEnter, | ||
onMouseLeave: handleMouseLeave, | ||
}; | ||
|
||
return [isHovered, bind]; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Box, Circle } from 'leather-styles/jsx'; | ||
|
||
import type { Inscription } from '@leather.io/models'; | ||
|
||
import { BasicTooltip } from '@app/ui/components/tooltip/basic-tooltip'; | ||
|
||
const featureBuilt = false; | ||
|
||
interface HighSatValueUtxoProps { | ||
inscription: Inscription; | ||
} | ||
|
||
export function HighSatValueUtxoWarning({ inscription }: HighSatValueUtxoProps) { | ||
if (Number(inscription.value) < 5_000) return null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This 5_000 constant too. Should this be a part of a wallet config? |
||
if (!featureBuilt) return null; | ||
return ( | ||
<Box position="absolute" top="space.01" right="space.01"> | ||
<BasicTooltip label="This inscription has loads of BTC on it, remove protections? Click"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Possibly specify the amount instead of "loads"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is disabled for now, but yeah would be better to specify |
||
<Circle bg="red" size="sm" /> | ||
</BasicTooltip> | ||
</Box> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like a good place for launch darkly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could delete this as we're not using it, but hoping to add some kind of warning when revisiting this