Skip to content

Commit

Permalink
update variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
joshfarrant committed Nov 18, 2024
1 parent 4d37a95 commit e5cd4c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/docs/content/components/FormControl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,13 @@ const App = () => {
setValue(event.target.value)
}

const containsWhitespace = /\s/g.test(value)
const isInvalid = /\s/g.test(value)

return (
<FormControl validationStatus={containsWhitespace ? 'error' : 'success'}>
<FormControl validationStatus={isInvalid ? 'error' : 'success'}>
<FormControl.Label>GitHub handle</FormControl.Label>
<TextInput onChange={handleChange} value={value} fullWidth />
{containsWhitespace ? (
{isInvalid ? (
<FormControl.Validation>
GitHub handles cannot contain spaces.{' '}
{value && `Did you mean "${value.replaceAll(' ', '')}"`}
Expand Down

0 comments on commit e5cd4c2

Please sign in to comment.