Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beasy-mobile
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
G
beasy-mobile
Commits
d18e9f36
Commit
d18e9f36
authored
May 17, 2024
by
G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basic implementation for hide/reveal secret value
parent
9dbd9170
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
4 deletions
+21
-4
eye_hidden.png
assets/eye_hidden.png
+0
-0
BalanceContainer.tsx
src/components/BalanceContainer.tsx
+21
-4
No files found.
assets/eye_hidden.png
0 → 100644
View file @
d18e9f36
3.25 KB
src/components/BalanceContainer.tsx
View file @
d18e9f36
import
Box
from
"@components/bases/Box"
;
import
Text
from
"@components/bases/Text"
;
import
{
images
}
from
"@styles/Commons"
;
import
{
Image
}
from
"react-native"
;
import
{
useState
}
from
"react"
;
import
{
Image
,
TouchableOpacity
}
from
"react-native"
;
type
Props
=
{
balance
:
number
;
label
:
string
};
const
BalanceContainer
=
({
label
,
balance
}:
Props
)
=>
{
const
[
showBalance
,
setShowBalance
]
=
useState
(
false
);
return
(
<
Box
position=
{
"relative"
}
...
...
@@ -28,9 +31,23 @@ const BalanceContainer = ({ label, balance }: Props) => {
</
Box
>
<
Box
alignItems=
{
"center"
}
gap=
{
"s"
}
>
<
Text
fontSize=
{
30
}
variant=
{
"black"
}
>
{
balance
}
</
Text
>
<
TouchableOpacity
onPress=
{
()
=>
setShowBalance
(
!
showBalance
)
}
>
<
Box
height=
{
50
}
alignItems=
{
"center"
}
justifyContent=
{
"center"
}
>
{
showBalance
?
(
<
Text
fontSize=
{
30
}
variant=
{
"black"
}
>
{
balance
}
</
Text
>
)
:
(
<
Box
width=
{
40
}
height=
{
40
}
>
<
Image
source=
{
require
(
"../../assets/eye_hidden.png"
)
}
style=
{
images
.
contain
}
/>
</
Box
>
)
}
</
Box
>
</
TouchableOpacity
>
<
Text
color=
{
"gray"
}
>
{
label
}
</
Text
>
</
Box
>
</
Box
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment