/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at . */ import React, { Component } from "react"; import PropTypes from "prop-types"; import Modal from "./shared/Modal"; import { formatKeyShortcut } from "../utils/text"; const classnames = require("devtools/client/shared/classnames.js"); import "./ShortcutsModal.css"; const isMacOS = Services.appinfo.OS === "Darwin"; export class ShortcutsModal extends Component { static get propTypes() { return { enabled: PropTypes.bool.isRequired, handleClose: PropTypes.func.isRequired, }; } renderPrettyCombos(combo) { return combo .split(" ") .map(c => ( {c} )) .reduce((prev, curr) => [prev, " + ", curr]); } renderShorcutItem(title, combo) { return (
  • {title} {this.renderPrettyCombos(combo)}
  • ); } renderEditorShortcuts() { return ( ); } renderSteppingShortcuts() { return ( ); } renderSearchShortcuts() { return ( ); } renderShortcutsContent() { return (

    {L10N.getStr("shortcuts.header.editor")}

    {this.renderEditorShortcuts()}

    {L10N.getStr("shortcuts.header.stepping")}

    {this.renderSteppingShortcuts()}

    {L10N.getStr("shortcuts.header.search")}

    {this.renderSearchShortcuts()}
    ); } render() { const { enabled } = this.props; if (!enabled) { return null; } return ( {this.renderShortcutsContent()} ); } }