Ready to implement member select
This commit is contained in:
parent
39c7163290
commit
e237abe4e1
@ -23,6 +23,7 @@ import { SexSelection } from "../../widgets/forms/SexSelection";
|
||||
import { UploadPhotoButton } from "../../widgets/forms/UploadPhotoButton";
|
||||
import { MemberPhoto } from "../../widgets/MemberPhoto";
|
||||
import { RouterLink } from "../../widgets/RouterLink";
|
||||
import { MemberInput } from "../../widgets/forms/MemberInput";
|
||||
|
||||
/**
|
||||
* Create a new member route
|
||||
@ -399,7 +400,7 @@ export function MemberPage(p: {
|
||||
<PropCheckbox
|
||||
checked={member.dead}
|
||||
editable={p.editing}
|
||||
label="Décédé"
|
||||
label={member.sex === "F" ? "Décédée" : "Décédé"}
|
||||
onValueChange={(v) => {
|
||||
member.dead = v;
|
||||
updatedMember();
|
||||
@ -423,6 +424,30 @@ export function MemberPage(p: {
|
||||
updatedMember();
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Father */}
|
||||
<MemberInput
|
||||
editable={p.editing}
|
||||
label="Père"
|
||||
onValueChange={(m) => {
|
||||
member.father = m;
|
||||
updatedMember();
|
||||
}}
|
||||
filter={(m) => m.sex === "M" || m.sex === undefined}
|
||||
current={member.father}
|
||||
/>
|
||||
|
||||
{/* Mother */}
|
||||
<MemberInput
|
||||
editable={p.editing}
|
||||
label="Mère"
|
||||
onValueChange={(m) => {
|
||||
member.father = m;
|
||||
updatedMember();
|
||||
}}
|
||||
filter={(m) => m.sex === "F" || m.sex === undefined}
|
||||
current={member.father}
|
||||
/>
|
||||
</PropertiesBox>
|
||||
</Grid>
|
||||
|
||||
|
11
geneit_app/src/widgets/forms/MemberInput.tsx
Normal file
11
geneit_app/src/widgets/forms/MemberInput.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
import { Member } from "../../api/MemberApi";
|
||||
|
||||
export function MemberInput(p: {
|
||||
editable: boolean;
|
||||
current?: number;
|
||||
onValueChange: (n?: number) => void;
|
||||
label: string;
|
||||
filter: (m: Member) => boolean;
|
||||
}): React.ReactElement {
|
||||
return <>CHOOSE</>;
|
||||
}
|
Loading…
Reference in New Issue
Block a user