Minor adjustements

This commit is contained in:
Pierre HUBERT 2023-08-17 12:50:16 +02:00
parent 65c77be523
commit e753710964
5 changed files with 28 additions and 3 deletions

View File

@ -103,6 +103,7 @@ export class Member implements MemberDataApi {
id: 0,
dead: false,
family_id: family_id,
sex: "M",
});
}

View File

@ -22,7 +22,7 @@ import { PropertiesBox } from "../../widgets/PropertiesBox";
import { RouterLink } from "../../widgets/RouterLink";
import { DateInput } from "../../widgets/forms/DateInput";
import { MemberInput } from "../../widgets/forms/MemberInput";
import { PropSelect } from "../../widgets/forms/SelectInput";
import { PropSelect } from "../../widgets/forms/PropSelect";
import { UploadPhotoButton } from "../../widgets/forms/UploadPhotoButton";
import { useQuery } from "../../hooks/useQuery";

View File

@ -33,7 +33,7 @@ import { DateInput } from "../../widgets/forms/DateInput";
import { MemberInput } from "../../widgets/forms/MemberInput";
import { PropCheckbox } from "../../widgets/forms/PropCheckbox";
import { PropEdit } from "../../widgets/forms/PropEdit";
import { PropSelect } from "../../widgets/forms/SelectInput";
import { PropSelect } from "../../widgets/forms/PropSelect";
import { SexSelection } from "../../widgets/forms/SexSelection";
import { UploadPhotoButton } from "../../widgets/forms/UploadPhotoButton";
import { useQuery } from "../../hooks/useQuery";

View File

@ -6,6 +6,7 @@ import {
mdiFamilyTree,
mdiHumanMaleFemale,
mdiLockCheck,
mdiPlus,
mdiRefresh,
} from "@mdi/js";
import Icon from "@mdi/react";
@ -18,6 +19,7 @@ import {
ListItem,
ListItemButton,
ListItemIcon,
ListItemSecondaryAction,
ListItemText,
ListSubheader,
Tooltip,
@ -145,12 +147,30 @@ export function BaseFamilyRoute(): React.ReactElement {
icon={<Icon path={mdiCrowd} size={1} />}
label="Membres"
uri="members"
secondaryAction={
<Tooltip title="Créer une nouvelle fiche de membre">
<RouterLink to={family!.URL("member/create")}>
<IconButton>
<Icon path={mdiPlus} size={0.75} />
</IconButton>
</RouterLink>
</Tooltip>
}
/>
<FamilyLink
icon={<Icon path={mdiHumanMaleFemale} size={1} />}
label="Couples"
uri="couples"
secondaryAction={
<Tooltip title="Créer une nouvelle fiche de couple">
<RouterLink to={family!.URL("couple/create")}>
<IconButton>
<Icon path={mdiPlus} size={0.75} />
</IconButton>
</RouterLink>
</Tooltip>
}
/>
<FamilyLink
@ -234,6 +254,7 @@ function FamilyLink(p: {
icon: React.ReactElement;
uri: string;
label: string;
secondaryAction?: React.ReactElement;
}): React.ReactElement {
const family = useFamily();
const location = useLocation();
@ -244,6 +265,9 @@ function FamilyLink(p: {
<ListItemButton selected={link === location.pathname}>
<ListItemIcon>{p.icon}</ListItemIcon>
<ListItemText primary={p.label} />
{p.secondaryAction && (
<ListItemSecondaryAction>{p.secondaryAction}</ListItemSecondaryAction>
)}
</ListItemButton>
</RouterLink>
);

View File

@ -23,7 +23,7 @@ export function PropSelect(p: {
<FormControl fullWidth variant="filled" style={{ marginBottom: "15px" }}>
<InputLabel>{p.label}</InputLabel>
<Select
value={p.value}
value={p.value ?? ""}
label={p.label}
onChange={(e) => p.onValueChange(e.target.value)}
>