Make the Keyboard Shortcuts
dialog into a settings tab (#7198)
This commit is contained in:
parent
cb42173e11
commit
1f298250b9
13 changed files with 191 additions and 155 deletions
|
@ -26,7 +26,6 @@ import PlatformPeg from "../../../../../PlatformPeg";
|
|||
import { SettingLevel } from "../../../../../settings/SettingLevel";
|
||||
import { replaceableComponent } from "../../../../../utils/replaceableComponent";
|
||||
import SettingsFlag from '../../../elements/SettingsFlag';
|
||||
import * as KeyboardShortcuts from "../../../../../accessibility/KeyboardShortcuts";
|
||||
import AccessibleButton from "../../../elements/AccessibleButton";
|
||||
import GroupAvatar from "../../../avatars/GroupAvatar";
|
||||
import dis from "../../../../../dispatcher/dispatcher";
|
||||
|
@ -36,6 +35,8 @@ import { useDispatcher } from "../../../../../hooks/useDispatcher";
|
|||
import { CreateEventField, IGroupSummary } from "../../../dialogs/CreateSpaceFromCommunityDialog";
|
||||
import { createSpaceFromCommunity } from "../../../../../utils/space";
|
||||
import Spinner from "../../../elements/Spinner";
|
||||
import { UserTab } from "../../../dialogs/UserSettingsDialog";
|
||||
import { OpenToTabPayload } from "../../../../../dispatcher/payloads/OpenToTabPayload";
|
||||
import { Action } from "../../../../../dispatcher/actions";
|
||||
|
||||
interface IProps {
|
||||
|
@ -296,6 +297,13 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
});
|
||||
}
|
||||
|
||||
private onKeyboardShortcutsClicked = (): void => {
|
||||
dis.dispatch<OpenToTabPayload>({
|
||||
action: Action.ViewUserSettings,
|
||||
initialTabId: UserTab.Keyboard,
|
||||
});
|
||||
};
|
||||
|
||||
getShowLocationIfEnabled(): string[] {
|
||||
// TODO: when location sharing is out of labs, this can be deleted and
|
||||
// we can just add this to COMPOSER_SETTINGS
|
||||
|
@ -372,7 +380,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
<span className="mx_SettingsTab_subheading">{ _t("Keyboard shortcuts") }</span>
|
||||
<div className="mx_SettingsFlag">
|
||||
{ _t("To view all keyboard shortcuts, <a>click here</a>.", {}, {
|
||||
a: sub => <AccessibleButton kind="link" onClick={KeyboardShortcuts.toggleDialog}>
|
||||
a: sub => <AccessibleButton kind="link" onClick={this.onKeyboardShortcutsClicked}>
|
||||
{ sub }
|
||||
</AccessibleButton>,
|
||||
}) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue