Can update / delete member information through UI

This commit is contained in:
2023-08-08 15:21:05 +02:00
parent b828fce039
commit 6495085df6
7 changed files with 203 additions and 10 deletions

View File

@ -33,6 +33,7 @@ import { useAlert } from "../context_providers/AlertDialogProvider";
interface FamilyContext {
family: Family;
familyId: number;
reloadFamilyInfo: () => void;
}
@ -92,6 +93,7 @@ export function BaseFamilyRoute(): React.ReactElement {
<FamilyContextK.Provider
value={{
family: family!,
familyId: family!.family_id,
reloadFamilyInfo: onReload,
}}
>

View File

@ -4,13 +4,29 @@ import {
RadioGroup,
FormControlLabel,
Radio,
Typography,
} from "@mui/material";
import { Sex } from "../api/MemberApi";
export function SexSelection(p: {
readonly?: boolean;
current?: Sex;
onChange: (s: Sex) => void;
}): React.ReactElement {
if (p.readonly) {
if (p.current === undefined || p.current === null) return <></>;
return (
<Typography
variant="body2"
display="block"
style={{ marginBottom: "15px" }}
>
Sexe : {p.current === "M" ? "Homme" : "Femme"}
</Typography>
);
}
return (
<FormControl style={{ marginBottom: "15px" }}>
<FormLabel id="sex-label">Sexe</FormLabel>