Spaces:
Runtime error
Runtime error
fix: use "required"
Browse files
src/components/base/secret.tsx
CHANGED
@@ -3,7 +3,7 @@ import { useState } from "react";
|
|
3 |
import { Visibility, VisibilityOff } from "@mui/icons-material";
|
4 |
|
5 |
export default function Secret(props: TextFieldProps) {
|
6 |
-
const { name = "secret", label = "Secret", required =
|
7 |
const [showSecret, setShowSecret] = useState(false);
|
8 |
|
9 |
const handleShowSecret = () => setShowSecret(!showSecret);
|
@@ -14,7 +14,7 @@ export default function Secret(props: TextFieldProps) {
|
|
14 |
label={label}
|
15 |
name={name}
|
16 |
type={showSecret ? "text" : "password"}
|
17 |
-
required
|
18 |
InputProps={{
|
19 |
endAdornment: (
|
20 |
<InputAdornment position="end">
|
|
|
3 |
import { Visibility, VisibilityOff } from "@mui/icons-material";
|
4 |
|
5 |
export default function Secret(props: TextFieldProps) {
|
6 |
+
const { name = "secret", label = "Secret", required = true } = props;
|
7 |
const [showSecret, setShowSecret] = useState(false);
|
8 |
|
9 |
const handleShowSecret = () => setShowSecret(!showSecret);
|
|
|
14 |
label={label}
|
15 |
name={name}
|
16 |
type={showSecret ? "text" : "password"}
|
17 |
+
required={required}
|
18 |
InputProps={{
|
19 |
endAdornment: (
|
20 |
<InputAdornment position="end">
|