-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5819256
commit 9b38da7
Showing
12 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
wondrous-bot-admin/src/components/AddFormEntity/components/RegexText.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Grid } from "@mui/material"; | ||
import TextField from "components/Shared/TextField"; | ||
import { Label } from "./styles"; | ||
|
||
const RegexComponent = ({ error, value, onChange, TextInputStyle, ...rest }) => { | ||
const handleOnChange = (key, val) => { | ||
onChange({ | ||
...value, | ||
[key]: val, | ||
}); | ||
}; | ||
console.log("value", value); | ||
return ( | ||
<Grid display="flex" gap="8px" flexDirection="column" width="100%"> | ||
<Label>Question / Prompt</Label> | ||
<TextField | ||
multiline={false} | ||
value={value?.prompt || ""} | ||
onChange={(value) => { | ||
handleOnChange("prompt", value); | ||
}} | ||
{...rest} | ||
error={error?.prompt} | ||
/> | ||
<Label>Regex to use for checking the answer</Label> | ||
<TextField | ||
placeholder="E.g. To make sure the answer starts with 0x, use ^0x" | ||
value={value?.regex || ""} | ||
onChange={(value) => handleOnChange("regex", value)} | ||
multiline={false} | ||
error={error} | ||
{...rest} | ||
/> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default RegexComponent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters