Add blur to app password copy screen

This commit is contained in:
Dominik Biedebach
2024-11-29 09:32:10 +01:00
parent 5f4a0f2881
commit 424bf84ef2
@@ -22,6 +22,7 @@ import * as Dialog from '#/components/Dialog'
import * as TextInput from '#/components/forms/TextField'
import * as Toggle from '#/components/forms/Toggle'
import {ChevronRight_Stroke2_Corner0_Rounded as ChevronRight} from '#/components/icons/Chevron'
import {Eye_Stroke2_Corner0_Rounded as EyeIcon} from '#/components/icons/Eye'
import {SquareBehindSquare4_Stroke2_Corner0_Rounded as CopyIcon} from '#/components/icons/SquareBehindSquare4'
import {Text} from '#/components/Typography'
import {CopyButton} from './CopyButton'
@@ -47,6 +48,7 @@ function CreateDialogInner({passwords}: {passwords: string[]}) {
const t = useTheme()
const {_} = useLingui()
const autogeneratedName = useRandomName()
const [showPassword, setShowPassword] = useState(false)
const [name, setName] = useState('')
const [privileged, setPrivileged] = useState(false)
const {
@@ -191,15 +193,37 @@ function CreateDialogInner({passwords}: {passwords: string[]}) {
Use this to sign into the other app along with your handle.
</Trans>
</Text>
<CopyButton
value={data.password}
label={_(msg`Copy App Password`)}
size="large"
variant="solid"
color="secondary">
<ButtonText>{data.password}</ButtonText>
<ButtonIcon icon={CopyIcon} />
</CopyButton>
<View style={[a.flex_row, a.align_center, a.gap_sm, a.w_full]}>
<View style={[a.flex_grow, a.flex_shrink_0]}>
<CopyButton
value={data.password}
label={_(msg`Copy App Password`)}
size="large"
variant="solid"
color="secondary">
<ButtonText
style={{
color: showPassword
? t.atoms.text.color
: 'transparent',
textShadowColor: t.atoms.text.color,
textShadowRadius: showPassword ? 0 : 8,
}}>
{data.password}
</ButtonText>
<ButtonIcon icon={CopyIcon} />
</CopyButton>
</View>
<Button
label={_(msg`Show Password`)}
size="small"
variant="ghost"
color="primary"
onPress={() => setShowPassword(!showPassword)}
style={[a.flex_shrink]}>
<ButtonIcon icon={EyeIcon} />
</Button>
</View>
<Text
style={[
a.text_md,