Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
intrn(consultation): change the class to indicate the alignment of boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 13, 2022
1 parent 1f54c54 commit bf07ba7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions components/consultation/chat_window/chat_message.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("Component: consultation/chat_window/chat_message", () => {
const messageItemName = wrapper.find(".message-item-name")
const messageItemContent = wrapper.find(".message-item-content")

expect(messageItem.find(".place-right").exists()).toBeTruthy()
expect(messageItem.find(".align-right").exists()).toBeTruthy()
expect(messageItemName.html()).toContain(user.data.name)
expect(messageItemContent.html()).toContain(textValue)
})
Expand Down Expand Up @@ -126,7 +126,7 @@ describe("Component: consultation/chat_window/chat_message", () => {
const messageItemName = wrapper.find(".message-item-name")
const messageItemContent = wrapper.find(".message-item-content")

expect(messageItem.find(".place-left").exists()).toBeTruthy()
expect(messageItem.find(".align-left").exists()).toBeTruthy()
expect(messageItemName.html()).toContain(other.data.name)
expect(messageItemContent.html()).toContain(textValue)
})
Expand Down
14 changes: 7 additions & 7 deletions components/consultation/chat_window/chat_message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
@apply flex
}
.place-left {
.align-left {
@apply flex-1 mr-auto
}
.place-right {
.align-right {
@apply flex-1 ml-auto
}
.place-center {
.align-center {
@apply flex-1 mx-auto
}
</style>
Expand All @@ -47,7 +47,7 @@ const { chatMessage } = defineProps<{
chatMessage: DeserializedChatMessageResource<"user">
}>()
type Alignment = "place-left"|"place-center"|"place-right"
type Alignment = "align-left"|"align-center"|"align-right"
function isStatusMessage(value: DeserializedChatMessageResource<"user">)
: value is DeserializedChatMessageResource<"user"> & StatusMessage {
Expand All @@ -56,12 +56,12 @@ function isStatusMessage(value: DeserializedChatMessageResource<"user">)
const messageAlignment = computed<Alignment>(() => {
if (isStatusMessage(chatMessage)) {
return "place-center"
return "align-center"
} else if (userProfile.data.id === chatMessage.user.data.id) {
return "place-right"
return "align-right"
}
return "place-left"
return "align-left"
})
function isTextMessage(value: DeserializedChatMessageResource<"user">)
Expand Down

0 comments on commit bf07ba7

Please sign in to comment.