From 7556e1fd033207ec8efa3cf09c5511d8da007fbf Mon Sep 17 00:00:00 2001 From: David <33458145+davidmcpowell@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:12:54 +0100 Subject: [PATCH] Merge pull request #25598 from overleaf/dp-proptypes-misc Convert HotkeysModal components to Typescript GitOrigin-RevId: c2cf7a3a33afeb996650faa6e3ed91c4fe14ef1a --- ...text.jsx => hotkeys-modal-bottom-text.tsx} | 0 .../{hotkeys-modal.jsx => hotkeys-modal.tsx} | 27 +++++++++---------- ....stories.jsx => hotkeys-modal.stories.tsx} | 9 ++++--- ...ys.test.jsx => help-show-hotkeys.test.tsx} | 0 ...jsx => hotkeys-modal-bottom-text.test.tsx} | 0 ...-modal.test.jsx => hotkeys-modal.test.tsx} | 2 +- 6 files changed, 20 insertions(+), 18 deletions(-) rename services/web/frontend/js/features/hotkeys-modal/components/{hotkeys-modal-bottom-text.jsx => hotkeys-modal-bottom-text.tsx} (100%) rename services/web/frontend/js/features/hotkeys-modal/components/{hotkeys-modal.jsx => hotkeys-modal.tsx} (93%) rename services/web/frontend/stories/{hotkeys-modal.stories.jsx => hotkeys-modal.stories.tsx} (63%) rename services/web/test/frontend/features/editor-left-menu/components/{help-show-hotkeys.test.jsx => help-show-hotkeys.test.tsx} (100%) rename services/web/test/frontend/features/hotkeys-modal/components/{hotkeys-modal-bottom-text.test.jsx => hotkeys-modal-bottom-text.test.tsx} (100%) rename services/web/test/frontend/features/hotkeys-modal/components/{hotkeys-modal.test.jsx => hotkeys-modal.test.tsx} (95%) diff --git a/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal-bottom-text.jsx b/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal-bottom-text.tsx similarity index 100% rename from services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal-bottom-text.jsx rename to services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal-bottom-text.tsx diff --git a/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.jsx b/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.tsx similarity index 93% rename from services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.jsx rename to services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.tsx index 269b528397..695b3a1fa2 100644 --- a/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.jsx +++ b/services/web/frontend/js/features/hotkeys-modal/components/hotkeys-modal.tsx @@ -1,4 +1,3 @@ -import PropTypes from 'prop-types' import { Trans, useTranslation } from 'react-i18next' import HotkeysModalBottomText from './hotkeys-modal-bottom-text' import OLModal, { @@ -17,6 +16,12 @@ export default function HotkeysModal({ show, isMac = false, trackChangesVisible = false, +}: { + animation?: boolean + handleHide: () => void + show: boolean + isMac?: boolean + trackChangesVisible?: boolean }) { const { t } = useTranslation() @@ -201,15 +206,13 @@ export default function HotkeysModal({ ) } -HotkeysModal.propTypes = { - animation: PropTypes.bool, - isMac: PropTypes.bool, - show: PropTypes.bool.isRequired, - handleHide: PropTypes.func.isRequired, - trackChangesVisible: PropTypes.bool, -} - -function Hotkey({ combination, description }) { +function Hotkey({ + combination, + description, +}: { + combination: string + description: string +}) { return (