-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ledger): ui to ignore inscriptions
chore: discard inscriptions chore: global checks switch wip chore: track satpoint as well as vout chore: track spendable utxos, add them back to queries chore: add total balance set up chore: add tooltip to total balance feat: add recover/unrecover ui fix: flip the balances fix: filter inscriptions ext side fix: hover with parent check for fab feat: add subdued colour to icon fix: skip ids of spendable insciptions
- Loading branch information
1 parent
bf225fc
commit 48b0dd2
Showing
20 changed files
with
487 additions
and
136 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
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 const useHoverWithChildren = (): [boolean, HoverBind] => { | ||
const [isHovered, setIsHovered] = useState<boolean>(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]; | ||
}; |
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
23 changes: 23 additions & 0 deletions
23
src/app/features/collectibles/components/bitcoin/high-sat-value-utxo.tsx
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,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; | ||
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"> | ||
<Circle bg="red" size="sm" /> | ||
</BasicTooltip> | ||
</Box> | ||
); | ||
} |
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
Oops, something went wrong.