mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
styles: format code with prettier
This commit is contained in:
@@ -134,7 +134,7 @@ export const UpdatePort = ({ portId }: Props) => {
|
||||
if (value === "") {
|
||||
field.onChange(0);
|
||||
} else {
|
||||
field.onChange(parseInt(value, 10));
|
||||
field.onChange(Number.parseInt(value, 10));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -228,10 +228,7 @@ export const AddDomain = ({
|
||||
<FormItem>
|
||||
<FormLabel>Container Port</FormLabel>
|
||||
<FormControl>
|
||||
<NumberInput
|
||||
placeholder={"3000"}
|
||||
{...field}
|
||||
/>
|
||||
<NumberInput placeholder={"3000"} {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
|
||||
@@ -364,10 +364,7 @@ export const AddDomainCompose = ({
|
||||
<FormItem>
|
||||
<FormLabel>Container Port</FormLabel>
|
||||
<FormControl>
|
||||
<NumberInput
|
||||
placeholder={"3000"}
|
||||
{...field}
|
||||
/>
|
||||
<NumberInput placeholder={"3000"} {...field} />
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
|
||||
@@ -40,31 +40,30 @@ const NumberInput = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
ref={ref}
|
||||
{...props}
|
||||
value={props.value === undefined ? undefined : String(props.value)}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (value === "") {
|
||||
props.onChange?.(e);
|
||||
} else {
|
||||
const number = Number.parseInt(value, 10);
|
||||
if (!Number.isNaN(number)) {
|
||||
const syntheticEvent = {
|
||||
...e,
|
||||
target: {
|
||||
...e.target,
|
||||
value: number,
|
||||
},
|
||||
};
|
||||
props.onChange?.(
|
||||
syntheticEvent as unknown as React.ChangeEvent<HTMLInputElement>
|
||||
);
|
||||
}
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value;
|
||||
if (value === "") {
|
||||
props.onChange?.(e);
|
||||
} else {
|
||||
const number = Number.parseInt(value, 10);
|
||||
if (!Number.isNaN(number)) {
|
||||
const syntheticEvent = {
|
||||
...e,
|
||||
target: {
|
||||
...e.target,
|
||||
value: number,
|
||||
},
|
||||
};
|
||||
props.onChange?.(
|
||||
syntheticEvent as unknown as React.ChangeEvent<HTMLInputElement>,
|
||||
);
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
NumberInput.displayName = "NumberInput";
|
||||
|
||||
|
||||
export { Input, NumberInput };
|
||||
|
||||
Reference in New Issue
Block a user