diff --git a/src/components/MemberInList.vue b/src/components/MemberInList.vue index 2c41d53..4d90a0a 100644 --- a/src/components/MemberInList.vue +++ b/src/components/MemberInList.vue @@ -5,14 +5,13 @@ IonAvatar, IonLabel, IonItemOptions, - IonItemOption, - modalController + IonItemOption } from "@ionic/vue"; import { Member, getTable } from '../lib/db/entities/members'; import { getBlobURL } from '../lib/util/blob'; import MemberEdit from "../modals/MemberEdit.vue"; - import { ref } from "vue"; + import { provide, ref } from "vue"; const props = defineProps<{ member: Member, @@ -21,32 +20,17 @@ const member = props.member; const canDelete = props.canDelete; + const isOpen = ref(false); + provide("isOpen", isOpen); async function removeFromDatabase() { await getTable().delete(member.uuid); } - - async function showEditModal() { - const modal = ref(); - modal.value = await modalController.create({ - component: MemberEdit, - componentProps: { - self: modal, - member, - add: false, - edit: false - } - }); - - await modal.value.present(); - } - - console.log(member); diff --git a/src/modals/MemberEdit.vue b/src/modals/MemberEdit.vue index fbca0e1..cfd6c53 100644 --- a/src/modals/MemberEdit.vue +++ b/src/modals/MemberEdit.vue @@ -14,7 +14,8 @@ IonFabButton, IonLabel, IonItem, - modalController + modalController, + IonModal } from "@ionic/vue"; import { @@ -31,18 +32,16 @@ import { getBlobURL } from '../lib/util/blob'; import { getFiles } from "../lib/util/misc"; import { resizeImage } from "../lib/util/image"; - import { Ref, inject, ref } from "vue"; + import { Ref, inject, onMounted, ref } from "vue"; import { getMarkdownFor } from "../lib/markdown"; - type PartialBy = Omit & Partial>; + const isOpen = inject>("isOpen"); const props = defineProps<{ - self: Ref, member?: PartialBy, add: boolean, edit?: boolean }>(); - const isIOS = inject("isIOS"); const member = ref({ @@ -83,54 +82,56 @@