Can set member country

This commit is contained in:
2023-08-11 11:09:40 +02:00
parent 39190de454
commit 7d97909d06
4 changed files with 101 additions and 35 deletions

View File

@ -8,8 +8,8 @@ export function PropEdit(p: {
label: string;
editable: boolean;
value?: string;
onValueChange: (newVal: string | undefined) => void;
size: LenConstraint;
onValueChange?: (newVal: string | undefined) => void;
size?: LenConstraint;
checkValue?: (s: string) => boolean;
}): React.ReactElement {
if (((!p.editable && p.value) ?? "") === "") return <></>;
@ -19,12 +19,12 @@ export function PropEdit(p: {
label={p.label}
value={p.value}
onChange={(e) =>
p.onValueChange(
p.onValueChange?.(
e.target.value.length === 0 ? undefined : e.target.value
)
}
inputProps={{
maxLength: p.size.max,
maxLength: p.size?.max,
}}
InputProps={{
readOnly: !p.editable,