UX: hide keyboard shortcuts on mobile (#18575)

This commit is contained in:
chapoi 2022-10-14 03:26:21 +02:00 committed by GitHub
parent d1d0241d8b
commit 92bfea2f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 5 deletions

View File

@ -9,11 +9,13 @@
@class="sidebar-footer-actions-button sidebar-footer-actions-toggle-mobile-view" />
{{/if}}
<DButton
@action={{route-action "showKeyboardShortcutsHelp"}}
@title="keyboard_shortcuts_help.title"
@icon="keyboard"
@class="sidebar-footer-actions-button sidebar-footer-actions-keyboard-shortcuts" />
{{#if this.site.desktopView}}
<DButton
@action={{route-action "showKeyboardShortcutsHelp"}}
@title="keyboard_shortcuts_help.title"
@icon="keyboard"
@class="sidebar-footer-actions-button sidebar-footer-actions-keyboard-shortcuts" />
{{/if}}
</div>
</div>
</div>

View File

@ -74,4 +74,14 @@ acceptance("Sidebar - Mobile - User with sidebar enabled", function (needs) {
"displays the desktop icon for the button"
);
});
test("keyboard shortcuts button is hidden", async function (assert) {
await visit("/");
await click(".hamburger-dropdown");
assert.notOk(
exists(".sidebar-footer-actions-keyboard-shortcuts"),
"keyboard shortcuts button is not shown on mobile"
);
});
});