UX: hide settings btn when disabled

Also sets lighter border on hover
This commit is contained in:
chapoi 2023-05-15 07:53:30 +02:00 committed by GitHub
parent 64971e5972
commit 74f01b8cbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 10 deletions

View File

@ -2,8 +2,8 @@
display: flex;
flex-direction: row;
padding: 0.5rem;
border-radius: 6px;
background-color: var(--d-selected);
border-radius: 4px;
background-color: var(--primary-very-low);
border: 1px solid transparent;
}
@ -14,7 +14,7 @@
.touch & {
&:active {
background-color: var(--d-hover);
border: 1px solid var(--primary-medium);
border: 1px solid var(--primary-300);
}
}
@ -22,7 +22,7 @@
&:hover,
&:active {
background-color: var(--d-hover);
border: 1px solid var(--primary-medium);
border: 1px solid var(--primary-300);
}
}
@ -41,6 +41,10 @@
font-weight: bold;
}
&__settings[disabled] {
display: none;
}
&__open-button {
display: flex;
flex-direction: column;

View File

@ -14,7 +14,7 @@
flex-direction: column;
.chat-thread-list-item {
margin: 0.5rem 0.25rem 0.5rem 0.5rem;
margin: 0.75rem 0.25rem 0.75rem 0.5rem;
& + .chat-thread-list-item {
margin-top: 0;

View File

@ -108,12 +108,12 @@ describe "Thread list in side panel | full page", type: :system, js: true do
it "does not allow updating if user is neither admin nor original message user" do
thread_1.update!(original_message_user: other_user)
thread_1.original_message.update!(user: other_user)
open_thread_list
expect(
thread_list_page.item_by_id(thread_1.id).find(".chat-thread-list-item__settings")[
:disabled
],
).to eq("true")
expect(thread_list_page.item_by_id(thread_1.id)).to have_no_css(
".chat-thread-list-item__settings",
)
end
end
end