mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-05-01 17:30:33 +03:00
Added support to enable/disable validating the URL while it is created
This commit is contained in:
parent
0ed88079ad
commit
8f7e356e54
4 changed files with 28 additions and 12 deletions
src/utils
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue