update checks, disable button if unavailable
This commit is contained in:
@@ -126,11 +126,14 @@ export function StepHandle() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const textFieldInvalid =
|
const isHandleTaken =
|
||||||
(!isPending &&
|
!isPending &&
|
||||||
queryEnabled &&
|
queryEnabled &&
|
||||||
isHandleAvailable &&
|
isHandleAvailable &&
|
||||||
!isHandleAvailable.available) ||
|
!isHandleAvailable.available
|
||||||
|
|
||||||
|
const textFieldInvalid =
|
||||||
|
isHandleTaken ||
|
||||||
!validCheck.frontLengthNotTooLong ||
|
!validCheck.frontLengthNotTooLong ||
|
||||||
!validCheck.handleChars ||
|
!validCheck.handleChars ||
|
||||||
!validCheck.hyphenStartOrEnd ||
|
!validCheck.hyphenStartOrEnd ||
|
||||||
@@ -175,10 +178,7 @@ export function StepHandle() {
|
|||||||
<RequirementText>{state.error}</RequirementText>
|
<RequirementText>{state.error}</RequirementText>
|
||||||
</Requirement>
|
</Requirement>
|
||||||
)}
|
)}
|
||||||
{queryEnabled &&
|
{isHandleTaken && validCheck.overall && (
|
||||||
isHandleAvailable &&
|
|
||||||
!isHandleAvailable.available &&
|
|
||||||
validCheck.overall && (
|
|
||||||
<>
|
<>
|
||||||
<Requirement>
|
<Requirement>
|
||||||
<RequirementText>
|
<RequirementText>
|
||||||
@@ -215,7 +215,10 @@ export function StepHandle() {
|
|||||||
</RequirementText>
|
</RequirementText>
|
||||||
) : (
|
) : (
|
||||||
<RequirementText>
|
<RequirementText>
|
||||||
<Trans>Only contains letters, numbers, and hyphens</Trans>
|
<Trans>
|
||||||
|
Username must only contain letters (a-z), numbers, and
|
||||||
|
hyphens
|
||||||
|
</Trans>
|
||||||
</RequirementText>
|
</RequirementText>
|
||||||
)}
|
)}
|
||||||
</Requirement>
|
</Requirement>
|
||||||
@@ -240,7 +243,7 @@ export function StepHandle() {
|
|||||||
<Animated.View layout={native(LinearTransition)}>
|
<Animated.View layout={native(LinearTransition)}>
|
||||||
<BackNextButtons
|
<BackNextButtons
|
||||||
isLoading={isNextLoading}
|
isLoading={isNextLoading}
|
||||||
isNextDisabled={!validCheck.overall || !!state.error}
|
isNextDisabled={!validCheck.overall || !!state.error || isHandleTaken}
|
||||||
onBackPress={onBackPress}
|
onBackPress={onBackPress}
|
||||||
onNextPress={onNextPress}
|
onNextPress={onNextPress}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user