Skip to content

Commit

Permalink
🎨 refactor: showIsInputTextAreaExpandedButton を showTextAreaExpandBut…
Browse files Browse the repository at this point in the history
…ton に名称変更
  • Loading branch information
reiroop committed Feb 3, 2025
1 parent 9cf0a4a commit d0049bd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
10 changes: 3 additions & 7 deletions src/components/Main/MainView/MessageInput/MessageInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@
v-model:is-left-controls-expanded="isLeftControlsExpanded"

Check warning on line 29 in src/components/Main/MainView/MessageInput/MessageInput.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInput.vue#L29

Added line #L29 was not covered by tests
v-model:is-preview-shown="isPreviewShown"
v-model:is-input-text-area-expanded="isInputTextAreaExpanded"
:show-is-input-text-area-expanded-button="
showIsInputTextAreaExpandedButton
"
:show-text-area-expand-button="showTextAreaExpandButton"

Check warning on line 32 in src/components/Main/MainView/MessageInput/MessageInput.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInput.vue#L31-L32

Added lines #L31 - L32 were not covered by tests
:class="$style.leftControls"
@click-add-attachment="addAttachment"
/>
<message-input-text-area
ref="textareaComponentRef"
v-model="state.text"
v-model:show-is-input-text-area-expanded-button="
showIsInputTextAreaExpandedButton
"
v-model:show-text-area-expand-button="showTextAreaExpandButton"

Check warning on line 39 in src/components/Main/MainView/MessageInput/MessageInput.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInput.vue#L39

Added line #L39 was not covered by tests
:channel-id="channelId"
:is-posting="isPosting"
:shrink-to-one-line="
Expand Down Expand Up @@ -117,7 +113,7 @@ const { channelsMap } = useChannelsStore()
const isLeftControlsExpanded = ref(false)
const isPreviewShown = ref(false)
const isInputTextAreaExpanded = ref(true)
const showIsInputTextAreaExpandedButton = ref(false)
const showTextAreaExpandButton = ref(false)

Check warning on line 116 in src/components/Main/MainView/MessageInput/MessageInput.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInput.vue#L115-L116

Added lines #L115 - L116 were not covered by tests
const isArchived = computed(
() => channelsMap.value.get(props.channelId)?.archived ?? false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div :class="$style.outerContainer" :style="outerContainerStyle">

Check warning on line 2 in src/components/Main/MainView/MessageInput/MessageInputLeftControls.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputLeftControls.vue#L2

Added line #L2 was not covered by tests
<icon-button
v-if="showIsInputTextAreaExpandedButton"
v-if="showTextAreaExpandButton"

Check warning on line 4 in src/components/Main/MainView/MessageInput/MessageInputLeftControls.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputLeftControls.vue#L4

Added line #L4 was not covered by tests
:class="$style.button"
:icon-name="isInputTextAreaExpanded ? 'chevron-down' : 'chevron-up'"

Check warning on line 6 in src/components/Main/MainView/MessageInput/MessageInputLeftControls.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputLeftControls.vue#L6

Added line #L6 was not covered by tests
icon-mdi
Expand Down Expand Up @@ -40,7 +40,7 @@ const props = defineProps<{
isLeftControlsExpanded: boolean
isPreviewShown: boolean
isInputTextAreaExpanded: boolean
showIsInputTextAreaExpandedButton: boolean
showTextAreaExpandButton: boolean
}>()
const emit = defineEmits<{
Expand Down Expand Up @@ -69,7 +69,7 @@ const isPreviewShownValue = computed<boolean>({
})
const outerContainerStyle = computed(() => ({
'--justify-content': props.showIsInputTextAreaExpandedButton
'--justify-content': props.showTextAreaExpandButton
? 'space-between'
: 'flex-end'
}))

Check warning on line 75 in src/components/Main/MainView/MessageInput/MessageInputLeftControls.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputLeftControls.vue#L71-L75

Added lines #L71 - L75 were not covered by tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ const textareaAutosizeStyle = computed(() => ({
'--max-height': textAreaAutoSizeMaxHeight.value
}))

Check warning on line 167 in src/components/Main/MainView/MessageInput/MessageInputTextArea.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputTextArea.vue#L164-L167

Added lines #L164 - L167 were not covered by tests
const showIsInputTextAreaExpandedButton = defineModel<boolean>(
'showIsInputTextAreaExpandedButton',
const showTextAreaExpandButton = defineModel<boolean>(
'showTextAreaExpandButton',

Check warning on line 170 in src/components/Main/MainView/MessageInput/MessageInputTextArea.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputTextArea.vue#L169-L170

Added lines #L169 - L170 were not covered by tests
{
default: false
}
Expand All @@ -176,7 +176,7 @@ const showIsInputTextAreaExpandedButton = defineModel<boolean>(
const updateShowIsInputTextareaExpandButtonVisibility = () => {
nextTick(() => {
if (textareaRef.value) {
showIsInputTextAreaExpandedButton.value =
showTextAreaExpandButton.value =
textareaRef.value.scrollHeight > textAreaAutoSizeMaxHeightShrunk.value
}
})

Check warning on line 182 in src/components/Main/MainView/MessageInput/MessageInputTextArea.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputTextArea.vue#L176-L182

Added lines #L176 - L182 were not covered by tests
Expand Down

0 comments on commit d0049bd

Please sign in to comment.