forked from leather-io/extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add option to hide balance, closes leather-io#5096
- Loading branch information
1 parent
54fce3e
commit c770a25
Showing
36 changed files
with
351 additions
and
50 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,25 @@ | ||
import { type HTMLStyledProps } from 'leather-styles/jsx'; | ||
|
||
import { useTogglePrivateMode } from '@app/store/settings/settings.actions'; | ||
import { useIsPrivateMode } from '@app/store/settings/settings.selectors'; | ||
import { PrivateTextLayout } from '@app/ui/components/privacy/private-text.layout'; | ||
|
||
interface BalancePrivateProps extends HTMLStyledProps<'span'> { | ||
children: React.ReactNode; | ||
canClickToShow?: boolean; | ||
} | ||
|
||
export function BalancePrivate({ children, canClickToShow, ...rest }: BalancePrivateProps) { | ||
const isPrivateMode = useIsPrivateMode(); | ||
const togglePrivateMode = useTogglePrivateMode(); | ||
|
||
return ( | ||
<PrivateTextLayout | ||
{...rest} | ||
isPrivate={isPrivateMode} | ||
onShowValue={canClickToShow ? togglePrivateMode : undefined} | ||
> | ||
{children} | ||
</PrivateTextLayout> | ||
); | ||
} |
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
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
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
Oops, something went wrong.