mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
add auth enabling hints
This commit is contained in:
@@ -209,7 +209,8 @@ export const Switch = forwardRef<
|
||||
<RadixSwitch.Root
|
||||
className={clsx(
|
||||
"relative cursor-pointer rounded-full bg-muted border-2 border-transparent outline-none ring-1 dark:ring-primary/10 ring-primary/20 data-[state=checked]:ring-primary/60 data-[state=checked]:bg-primary/60 appearance-none transition-colors hover:bg-muted/80",
|
||||
SwitchSizes[props.size ?? "md"].root
|
||||
SwitchSizes[props.size ?? "md"].root,
|
||||
props.disabled && "opacity-50 !cursor-not-allowed"
|
||||
)}
|
||||
onCheckedChange={(bool) => {
|
||||
console.log("setting", bool);
|
||||
|
||||
@@ -12,6 +12,7 @@ import { coerce, isType, isTypeSchema } from "./utils";
|
||||
export type FieldProps = {
|
||||
onChange?: (e: ChangeEvent<any>) => void;
|
||||
placeholder?: string;
|
||||
disabled?: boolean;
|
||||
} & Omit<FieldwrapperProps, "children" | "schema">;
|
||||
|
||||
export const Field = (props: FieldProps) => {
|
||||
@@ -49,7 +50,7 @@ const FieldImpl = ({ name, onChange, placeholder, required: _required, ...props
|
||||
return <ArrayField path={name} />;
|
||||
}
|
||||
|
||||
const disabled = schema.readOnly ?? "const" in schema ?? false;
|
||||
const disabled = props.disabled ?? schema.readOnly ?? "const" in schema ?? false;
|
||||
|
||||
const handleChange = useEvent((e: ChangeEvent<HTMLInputElement>) => {
|
||||
const value = coerce(e.target.value, schema as any, { required });
|
||||
|
||||
Reference in New Issue
Block a user