1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 22:44:19 +00:00
pds-2021-g2-nest/nest_frontend/components/interactive/FormInlineUser.js

31 lines
673 B
JavaScript
Raw Normal View History

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
*/
export default function FormInlineUser({ ...props }) {
const validate = value => {
return value.replace(INVALID_CHARACTERS, "")
}
return (
<FormInlineText
textIcon={faAt}
placeholder={"jack"}
validate={validate}
{...props}
/>
)
}