mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-01 21:26:46 +00:00
Added support to enable/disable validating the URL while it is created
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ChangeEvent, FC } from 'react';
|
||||
import { ChangeEvent, FC, useRef } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { identity } from 'ramda';
|
||||
@@ -17,7 +17,7 @@ interface BooleanControlWithTypeProps extends BooleanControlProps {
|
||||
const BooleanControl: FC<BooleanControlWithTypeProps> = (
|
||||
{ checked = false, onChange = identity, className, children, type, inline = false },
|
||||
) => {
|
||||
const id = uuid();
|
||||
const { current: id } = useRef(uuid());
|
||||
const onChecked = (e: ChangeEvent<HTMLInputElement>) => onChange(e.target.checked, e);
|
||||
const typeClasses = {
|
||||
'custom-switch': type === 'switch',
|
||||
|
||||
Reference in New Issue
Block a user