mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-03 11:30:50 -05:00
update docs
This commit is contained in:
@@ -2,9 +2,7 @@ import { useEffectUpdateSchema } from "../../lib/schema";
|
||||
import { NameRequired, UniversalInputProps } from "../../types";
|
||||
import { Input, InputProps } from "../shared/Input";
|
||||
|
||||
interface EmailUniqueProps {
|
||||
placeholder?: string;
|
||||
}
|
||||
interface EmailUniqueProps {}
|
||||
|
||||
type Props = EmailUniqueProps & InputProps & UniversalInputProps & NameRequired;
|
||||
|
||||
@@ -13,11 +11,5 @@ const inputType = "email";
|
||||
export function Email(props: Props) {
|
||||
useEffectUpdateSchema(props, inputType);
|
||||
|
||||
return (
|
||||
<Input
|
||||
type={{ html: inputType, formbricks: inputType }}
|
||||
additionalProps={{ placeholder: props.placeholder }}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
return <Input type={{ html: inputType, formbricks: inputType }} {...props} />;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Input, InputProps } from "../shared/Input";
|
||||
interface PasswordUniqueProps {
|
||||
minLength?: number;
|
||||
maxLength?: number;
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
type Props = PasswordUniqueProps & InputProps & UniversalInputProps & NameRequired;
|
||||
@@ -28,7 +27,6 @@ export function Password(props: Props) {
|
||||
message: `Your answer musn't be longer than ${props.maxLength} characters`,
|
||||
},
|
||||
}}
|
||||
additionalProps={{ placeholder: props.placeholder }}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Input, InputProps } from "../shared/Input";
|
||||
interface PhoneUniqueProps {
|
||||
minLength?: number;
|
||||
maxLength?: number;
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
type Props = PhoneUniqueProps & InputProps & UniversalInputProps & NameRequired;
|
||||
@@ -29,7 +28,6 @@ export function Phone(props: Props) {
|
||||
message: `Your answer musn't be longer than ${props.maxLength} characters`,
|
||||
},
|
||||
}}
|
||||
additionalProps={{ placeholder: props.placeholder }}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Input, InputProps } from "../shared/Input";
|
||||
interface SearchUniqueProps {
|
||||
minLength?: number;
|
||||
maxLength?: number;
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
type Props = SearchUniqueProps & InputProps & UniversalInputProps & NameRequired;
|
||||
@@ -28,7 +27,6 @@ export function Search(props: Props) {
|
||||
message: `Your answer musn't be longer than ${props.maxLength} characters`,
|
||||
},
|
||||
}}
|
||||
additionalProps={{ placeholder: props.placeholder }}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Input, InputProps } from "../shared/Input";
|
||||
interface TextUniqueProps {
|
||||
minLength?: number;
|
||||
maxLength?: number;
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
type Props = TextUniqueProps & InputProps & UniversalInputProps & NameRequired;
|
||||
@@ -28,7 +27,6 @@ export function Text(props: Props) {
|
||||
message: `Your answer musn't be longer than ${props.maxLength} characters`,
|
||||
},
|
||||
}}
|
||||
additionalProps={{ placeholder: props.placeholder }}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Input, InputProps } from "../shared/Input";
|
||||
interface UrlUniqueProps {
|
||||
minLength?: number;
|
||||
maxLength?: number;
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
type Props = UrlUniqueProps & InputProps & UniversalInputProps & NameRequired;
|
||||
@@ -28,7 +27,6 @@ export function Url(props: Props) {
|
||||
message: `Your answer musn't be longer than ${props.maxLength} characters`,
|
||||
},
|
||||
}}
|
||||
additionalProps={{ placeholder: props.placeholder }}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -12,11 +12,12 @@ import { Outer } from "./Outer";
|
||||
import { Wrapper } from "./Wrapper";
|
||||
|
||||
export interface InputProps {
|
||||
additionalValidation?: any;
|
||||
additionalProps?: any;
|
||||
placeholder?: string;
|
||||
}
|
||||
|
||||
interface UniqueProps {
|
||||
additionalValidation?: any;
|
||||
additionalProps?: any;
|
||||
type: {
|
||||
formbricks: string;
|
||||
html: string;
|
||||
@@ -44,6 +45,7 @@ export function Input(props: FormbricksProps) {
|
||||
type={props.type.html}
|
||||
id={elemId}
|
||||
aria-invalid={errors[props.name] ? "true" : "false"}
|
||||
placeholder={props.placeholder}
|
||||
{...props.additionalProps}
|
||||
{...register(props.name, {
|
||||
required: { value: "required" in validationRules, message: "This field is required" },
|
||||
|
||||
Reference in New Issue
Block a user