2021-05-21 17:52:56 +00:00
|
|
|
import React from "react"
|
|
|
|
import FormInlineText from "./FormInlineText"
|
|
|
|
import { faAt } from "@fortawesome/free-solid-svg-icons"
|
|
|
|
|
|
|
|
|
|
|
|
const INVALID_CHARACTERS = /[^a-zA-Z0-9]/g
|
|
|
|
|
|
|
|
|
2021-05-23 03:03:41 +00:00
|
|
|
/**
|
|
|
|
* A {@link FormInline} allowing the user to select a Twitter user.
|
|
|
|
*
|
|
|
|
* @param props - Additional props to pass to the form.
|
|
|
|
* @returns {JSX.Element}
|
|
|
|
* @constructor
|
|
|
|
*/
|
2021-05-23 03:35:17 +00:00
|
|
|
export default function FormInlineUser({ ...props }) {
|
2021-05-21 17:52:56 +00:00
|
|
|
|
|
|
|
const validate = value => {
|
|
|
|
return value.replace(INVALID_CHARACTERS, "")
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<FormInlineText
|
|
|
|
textIcon={faAt}
|
|
|
|
placeholder={"jack"}
|
|
|
|
validate={validate}
|
|
|
|
{...props}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|