Implemented logic to edit domain redirects

This commit is contained in:
Alejandro Celaya
2021-08-21 17:53:06 +02:00
parent bf29158a8a
commit 69cb3bd619
28 changed files with 347 additions and 141 deletions

View File

@@ -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>

View File

@@ -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)}
/>

View File

@@ -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;