From 74c73a9e8f3b10be1fbdb6dbabf44d0edf95c034 Mon Sep 17 00:00:00 2001 From: mohamad Date: Sun, 1 Jun 2025 14:10:59 +0200 Subject: [PATCH] refactor: Update GroupsPage to use standard HTML for now --- fe/src/pages/GroupsPage.vue | 148 ++++++++++++++++++------------------ 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/fe/src/pages/GroupsPage.vue b/fe/src/pages/GroupsPage.vue index ea0b40b..b0fb71b 100644 --- a/fe/src/pages/GroupsPage.vue +++ b/fe/src/pages/GroupsPage.vue @@ -2,33 +2,41 @@
- - - + - - - +
+ +

No Groups Yet!

+

You are not a member of any groups yet. Create one or join using an invite code.

+ +

{{ group.name }}

- +
@@ -48,48 +56,52 @@
- - - - - +
+ + +
+ - +

{{ joinGroupFormError }}

- -
- - - - -
-
+ @@ -101,16 +113,9 @@ import { ref, onMounted, nextTick } from 'vue'; import { useRouter } from 'vue-router'; import { apiClient, API_ENDPOINTS } from '@/config/api'; import { useStorage } from '@vueuse/core'; -// import { onClickOutside } from '@vueuse/core'; // No longer needed for VModal +import { onClickOutside } from '@vueuse/core'; import { useNotificationStore } from '@/stores/notifications'; import CreateListModal from '@/components/CreateListModal.vue'; -import VModal from '@/components/valerie/VModal.vue'; -import VFormField from '@/components/valerie/VFormField.vue'; -import VInput from '@/components/valerie/VInput.vue'; -import VButton from '@/components/valerie/VButton.vue'; -import VSpinner from '@/components/valerie/VSpinner.vue'; -import VAlert from '@/components/valerie/VAlert.vue'; -import VCard from '@/components/valerie/VCard.vue'; interface Group { id: number; @@ -130,13 +135,13 @@ const fetchError = ref(null); const showCreateGroupDialog = ref(false); const newGroupName = ref(''); const creatingGroup = ref(false); -const newGroupNameInputRef = ref | null>(null); // Changed type to VInput instance -// const createGroupModalRef = ref(null); // No longer needed +const newGroupNameInputRef = ref(null); +const createGroupModalRef = ref(null); const createGroupFormError = ref(null); const inviteCodeToJoin = ref(''); const joiningGroup = ref(false); -const joinInviteCodeInputRef = ref | null>(null); // Changed type to VInput instance +const joinInviteCodeInputRef = ref(null); const joinGroupFormError = ref(null); const showCreateListModal = ref(false); @@ -178,12 +183,7 @@ const openCreateGroupDialog = () => { createGroupFormError.value = null; showCreateGroupDialog.value = true; nextTick(() => { - // Attempt to focus VInput. This assumes VInput exposes a focus method - // or internally focuses its input element on a `focus()` call. - // If VInput's input element needs to be accessed directly, it might be: - // newGroupNameInputRef.value?.$el.querySelector('input')?.focus(); or similar, - // but ideally VInput itself handles this. - newGroupNameInputRef.value?.focus?.(); + newGroupNameInputRef.value?.focus(); }); }; @@ -191,12 +191,12 @@ const closeCreateGroupDialog = () => { showCreateGroupDialog.value = false; }; -// onClickOutside(createGroupModalRef, closeCreateGroupDialog); // Replaced by VModal's own handling +onClickOutside(createGroupModalRef, closeCreateGroupDialog); const handleCreateGroup = async () => { if (!newGroupName.value.trim()) { createGroupFormError.value = 'Group name is required'; - newGroupNameInputRef.value?.focus?.(); // Use VInput's focus method if available + newGroupNameInputRef.value?.focus(); return; } createGroupFormError.value = null; @@ -229,7 +229,7 @@ const handleCreateGroup = async () => { const handleJoinGroup = async () => { if (!inviteCodeToJoin.value.trim()) { joinGroupFormError.value = 'Invite code is required'; - joinInviteCodeInputRef.value?.focus?.(); // Use VInput's focus method if available + joinInviteCodeInputRef.value?.focus(); return; } joinGroupFormError.value = null;