fix: rework wallet screen
This commit is contained in:
parent
1f7ae74b42
commit
1f6d272aa0
103 changed files with 2094 additions and 3892 deletions
36
new-lamassu-admin/src/components/inputs/base/SecretInput.js
Normal file
36
new-lamassu-admin/src/components/inputs/base/SecretInput.js
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import React, { memo, useState } from 'react'
|
||||
|
||||
import { TextInput } from '../base'
|
||||
|
||||
const SecretInput = memo(({ value, onFocus, onBlur, ...props }) => {
|
||||
const [focused, setFocused] = useState(false)
|
||||
|
||||
const placeholder = '⚬ ⚬ ⚬ This field is set ⚬ ⚬ ⚬'
|
||||
const previouslyFilled = !!value
|
||||
const tempValue = previouslyFilled ? '' : value
|
||||
|
||||
const iOnFocus = event => {
|
||||
setFocused(true)
|
||||
onFocus && onFocus(event)
|
||||
}
|
||||
|
||||
const iOnBlur = event => {
|
||||
setFocused(false)
|
||||
onBlur && onBlur(event)
|
||||
}
|
||||
|
||||
return (
|
||||
<TextInput
|
||||
{...props}
|
||||
type="password"
|
||||
onFocus={iOnFocus}
|
||||
onBlur={iOnBlur}
|
||||
value={value}
|
||||
InputProps={{ value: !focused ? tempValue : value }}
|
||||
InputLabelProps={{ shrink: previouslyFilled || focused }}
|
||||
placeholder={previouslyFilled ? placeholder : ''}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
export default SecretInput
|
||||
Loading…
Add table
Add a link
Reference in a new issue