mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-02 05:36:38 +00:00
Implemented logic to edit domain redirects
This commit is contained in:
@@ -8,12 +8,14 @@ interface FormGroupContainerProps {
|
||||
id?: string;
|
||||
type?: InputType;
|
||||
required?: boolean;
|
||||
placeholder?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const FormGroupContainer: FC<FormGroupContainerProps> = (
|
||||
{ children, value, onChange, id = uuid(), type = 'text', required = true },
|
||||
{ children, value, onChange, id = uuid(), type = 'text', required = true, placeholder, className = '' },
|
||||
) => (
|
||||
<div className="form-group">
|
||||
<div className={`form-group ${className}`}>
|
||||
<label htmlFor={id} className="create-server__label">
|
||||
{children}:
|
||||
</label>
|
||||
@@ -23,6 +25,7 @@ export const FormGroupContainer: FC<FormGroupContainerProps> = (
|
||||
id={id}
|
||||
value={value}
|
||||
required={required}
|
||||
placeholder={placeholder}
|
||||
onChange={(e) => onChange(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -10,14 +10,11 @@ let timer: NodeJS.Timeout | null;
|
||||
interface SearchFieldProps {
|
||||
onChange: (value: string) => void;
|
||||
className?: string;
|
||||
placeholder?: string;
|
||||
large?: boolean;
|
||||
noBorder?: boolean;
|
||||
}
|
||||
|
||||
const SearchField = (
|
||||
{ onChange, className, placeholder = 'Search...', large = true, noBorder = false }: SearchFieldProps,
|
||||
) => {
|
||||
const SearchField = ({ onChange, className, large = true, noBorder = false }: SearchFieldProps) => {
|
||||
const [ searchTerm, setSearchTerm ] = useState('');
|
||||
|
||||
const resetTimer = () => {
|
||||
@@ -43,7 +40,7 @@ const SearchField = (
|
||||
'form-control-lg': large,
|
||||
'search-field__input--no-border': noBorder,
|
||||
})}
|
||||
placeholder={placeholder}
|
||||
placeholder="Search..."
|
||||
value={searchTerm}
|
||||
onChange={(e) => searchTermChanged(e.target.value)}
|
||||
/>
|
||||
|
||||
@@ -43,3 +43,5 @@ export type OptionalString = Optional<string>;
|
||||
export type RecursivePartial<T> = {
|
||||
[P in keyof T]?: RecursivePartial<T[P]>;
|
||||
};
|
||||
|
||||
export const nonEmptyValueOrNull = <T>(value: T): T | null => isEmpty(value) ? null : value;
|
||||
|
||||
Reference in New Issue
Block a user