From e7b7886d8390b22ab33615dacffd6cf74ae6e25d Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Sat, 17 Aug 2024 17:45:18 +0200 Subject: [PATCH] DEV: removes route action usage from sidebar footer (#28408) `routeAction` is an old and bad pattern we don't want to have in the codebase anymore. Co-authored-by: Jarek Radosz --- .../app/components/sidebar/footer.gjs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/sidebar/footer.gjs b/app/assets/javascripts/discourse/app/components/sidebar/footer.gjs index 58ddde88fc1..83fc442eba8 100644 --- a/app/assets/javascripts/discourse/app/components/sidebar/footer.gjs +++ b/app/assets/javascripts/discourse/app/components/sidebar/footer.gjs @@ -2,9 +2,10 @@ import Component from "@glimmer/component"; import { action } from "@ember/object"; import { service } from "@ember/service"; import DButton from "discourse/components/d-button"; +import KeyboardShortcutsHelp from "discourse/components/modal/keyboard-shortcuts-help"; import SidebarSectionForm from "discourse/components/modal/sidebar-section-form"; import PluginOutlet from "discourse/components/plugin-outlet"; -import routeAction from "discourse/helpers/route-action"; +import mobile from "discourse/lib/mobile"; import { MAIN_PANEL } from "discourse/lib/sidebar/panels"; export default class SidebarFooter extends Component { @@ -26,15 +27,21 @@ export default class SidebarFooter extends Component { ); } - get showKeyboardShortcutsButton() { - return this.site.desktopView; - } - @action manageSections() { this.modal.show(SidebarSectionForm); } + @action + showKeyboardShortcuts() { + this.modal.show(KeyboardShortcutsHelp); + } + + @action + toggleMobileView() { + mobile.toggleMobileView(); + } +