Align handling (#8255)
This commit is contained in:
@@ -53,6 +53,7 @@ export function Component({
|
|||||||
const {closeModal} = useModalControls()
|
const {closeModal} = useModalControls()
|
||||||
const updateMutation = useProfileUpdateMutation()
|
const updateMutation = useProfileUpdateMutation()
|
||||||
const [imageError, setImageError] = useState<string>('')
|
const [imageError, setImageError] = useState<string>('')
|
||||||
|
const initialDisplayName = profile.displayName || ''
|
||||||
const [displayName, setDisplayName] = useState<string>(
|
const [displayName, setDisplayName] = useState<string>(
|
||||||
profile.displayName || '',
|
profile.displayName || '',
|
||||||
)
|
)
|
||||||
@@ -145,7 +146,6 @@ export function Component({
|
|||||||
const verification = useSimpleVerificationState({
|
const verification = useSimpleVerificationState({
|
||||||
profile,
|
profile,
|
||||||
})
|
})
|
||||||
const [touchedDisplayName, setTouchedDisplayName] = useState(false)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView style={s.flex1} behavior="height">
|
<KeyboardAvoidingView style={s.flex1} behavior="height">
|
||||||
@@ -193,12 +193,11 @@ export function Component({
|
|||||||
accessible={true}
|
accessible={true}
|
||||||
accessibilityLabel={_(msg`Display name`)}
|
accessibilityLabel={_(msg`Display name`)}
|
||||||
accessibilityHint={_(msg`Edit your display name`)}
|
accessibilityHint={_(msg`Edit your display name`)}
|
||||||
onFocus={() => setTouchedDisplayName(true)}
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{verification.isVerified &&
|
{verification.isVerified &&
|
||||||
verification.role === 'default' &&
|
verification.role === 'default' &&
|
||||||
touchedDisplayName && (
|
displayName !== initialDisplayName && (
|
||||||
<View style={{paddingTop: 8}}>
|
<View style={{paddingTop: 8}}>
|
||||||
<Admonition type="error">
|
<Admonition type="error">
|
||||||
<Trans>
|
<Trans>
|
||||||
|
|||||||
Reference in New Issue
Block a user