From d8927af29a83296d61774cc60436e6d93ad7a802 Mon Sep 17 00:00:00 2001 From: anko9801 Date: Sat, 14 Sep 2024 10:31:32 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=8E=A8=20=E3=83=AC=E3=82=A4=E3=82=A2?= =?UTF-8?q?=E3=82=A6=E3=83=88=E3=82=92=20Figma=20=E3=81=AB=E6=8F=83?= =?UTF-8?q?=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/groupDetail/GroupBudget.vue | 58 ++-------------- .../groupDetail/GroupDescription.vue | 64 ++---------------- src/components/groupDetail/GroupMembers.vue | 66 +++++++++---------- src/components/groupDetail/GroupName.vue | 38 +++-------- src/components/groupDetail/GroupOwners.vue | 64 +++++++++--------- src/components/shared/InputSelectMultiple.vue | 12 ++-- src/pages/GroupDetailPage.vue | 38 ++--------- 7 files changed, 91 insertions(+), 249 deletions(-) diff --git a/src/components/groupDetail/GroupBudget.vue b/src/components/groupDetail/GroupBudget.vue index 4d54cbb7..54a6a262 100644 --- a/src/components/groupDetail/GroupBudget.vue +++ b/src/components/groupDetail/GroupBudget.vue @@ -2,65 +2,15 @@ import { storeToRefs } from 'pinia' import { useGroupDetailStore } from '/@/stores/groupDetail' -import { useUserStore } from '/@/stores/user' -import type { EditMode } from '/@/components/groupDetail/composables/useGroupInformation' -import EditButton from '/@/components/shared/EditButton.vue' -import InputNumber from '/@/components/shared/InputNumber.vue' -import SimpleButton from '/@/components/shared/SimpleButton.vue' - -interface Props { - isEditMode: boolean - isSending: boolean -} - -const props = defineProps() -const emit = defineEmits<{ - (e: 'changeEditMode', value: EditMode): void - (e: 'finishEditing'): void -}>() - -const userStore = useUserStore() const groupDetailStore = useGroupDetailStore() -const { group, editedValue } = storeToRefs(groupDetailStore) -const { canEditGroup } = groupDetailStore -const { me } = storeToRefs(userStore) - -const hasAuthority = canEditGroup(me.value) +const { group } = storeToRefs(groupDetailStore) diff --git a/src/components/groupDetail/GroupDescription.vue b/src/components/groupDetail/GroupDescription.vue index d94be342..3c054395 100644 --- a/src/components/groupDetail/GroupDescription.vue +++ b/src/components/groupDetail/GroupDescription.vue @@ -2,74 +2,18 @@ import { storeToRefs } from 'pinia' import { useGroupDetailStore } from '/@/stores/groupDetail' -import { useUserStore } from '/@/stores/user' -import type { EditMode } from '/@/components/groupDetail/composables/useGroupInformation' -import InputTextarea from '/@/components/shared/InputTextarea.vue' -import SimpleButton from '/@/components/shared/SimpleButton.vue' - -interface Props { - isEditMode: boolean - isSending: boolean -} - -const props = defineProps() -const emit = defineEmits<{ - (e: 'changeEditMode', value: EditMode): void - (e: 'finishEditing'): void -}>() - -const userStore = useUserStore() const groupDetailStore = useGroupDetailStore() -const { group, editedValue } = storeToRefs(groupDetailStore) -const { canEditGroup } = groupDetailStore -const { me } = storeToRefs(userStore) - -const hasAuthority = canEditGroup(me.value) +const { group } = storeToRefs(groupDetailStore) diff --git a/src/components/groupDetail/GroupMembers.vue b/src/components/groupDetail/GroupMembers.vue index fafa6295..c4de6f93 100644 --- a/src/components/groupDetail/GroupMembers.vue +++ b/src/components/groupDetail/GroupMembers.vue @@ -24,43 +24,41 @@ const { absentMemberOptions, isSending, addMembers, removeMember } = diff --git a/src/components/groupDetail/GroupName.vue b/src/components/groupDetail/GroupName.vue index 924a7d88..a47e8d07 100644 --- a/src/components/groupDetail/GroupName.vue +++ b/src/components/groupDetail/GroupName.vue @@ -6,7 +6,7 @@ import { useUserStore } from '/@/stores/user' import type { EditMode } from '/@/components/groupDetail/composables/useGroupInformation' import InputText from '/@/components/shared/InputText.vue' -import SimpleButton from '/@/components/shared/SimpleButton.vue' +import EditButton from '/@/components/shared/EditButton.vue' interface Props { isEditMode: boolean @@ -29,8 +29,8 @@ const hasAuthority = canEditGroup(me.value) diff --git a/src/components/groupDetail/GroupOwners.vue b/src/components/groupDetail/GroupOwners.vue index d3edb578..2304987c 100644 --- a/src/components/groupDetail/GroupOwners.vue +++ b/src/components/groupDetail/GroupOwners.vue @@ -24,42 +24,40 @@ const { absentOwnerOptions, isSending, addOwners, removeOwner } = diff --git a/src/components/shared/InputSelectMultiple.vue b/src/components/shared/InputSelectMultiple.vue index b83bc3d2..b0df8b5e 100644 --- a/src/components/shared/InputSelectMultiple.vue +++ b/src/components/shared/InputSelectMultiple.vue @@ -181,7 +181,7 @@ const handleKeydown = (e: KeyboardEvent, option: Value) => { const length = searchQuery.value !== '' ? searchedOptions.value.length - : props.options?.length ?? 0 + : (props.options?.length ?? 0) focusingListItemIndex.value = (focusingListItemIndex.value + 1) % length const buttonEl = listItemRefs.value[focusingListItemIndex.value] .firstChild as HTMLButtonElement @@ -202,7 +202,7 @@ const handleKeydown = (e: KeyboardEvent, option: Value) => { const length = searchQuery.value !== '' ? searchedOptions.value.length - : props.options?.length ?? 0 + : (props.options?.length ?? 0) focusingListItemIndex.value = (focusingListItemIndex.value - 1 + length) % length const buttonEl = listItemRefs.value[focusingListItemIndex.value] @@ -269,14 +269,12 @@ onUnmounted(() => {