From cc1b945fabf5c4372ee27ae99ea601f19725b227 Mon Sep 17 00:00:00 2001 From: Nicole Aldurien <77859694+nicolealdurien@users.noreply.github.com> Date: Tue, 21 Sep 2021 04:13:54 -0400 Subject: [PATCH] refactor(client): migrating ActionRow.js to TypeScript (#43490) --- .../Challenges/classic/DesktopLayout.js | 2 +- .../classic/{ActionRow.js => action-row.tsx} | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) rename client/src/templates/Challenges/classic/{ActionRow.js => action-row.tsx} (81%) diff --git a/client/src/templates/Challenges/classic/DesktopLayout.js b/client/src/templates/Challenges/classic/DesktopLayout.js index fc814a711e..123f8e1255 100644 --- a/client/src/templates/Challenges/classic/DesktopLayout.js +++ b/client/src/templates/Challenges/classic/DesktopLayout.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { ReflexContainer, ReflexSplitter, ReflexElement } from 'react-reflex'; import envData from '../../../../../config/env.json'; -import ActionRow from './ActionRow'; import EditorTabs from './EditorTabs'; +import ActionRow from './action-row.tsx'; const { showUpcomingChanges } = envData; diff --git a/client/src/templates/Challenges/classic/ActionRow.js b/client/src/templates/Challenges/classic/action-row.tsx similarity index 81% rename from client/src/templates/Challenges/classic/ActionRow.js rename to client/src/templates/Challenges/classic/action-row.tsx index bafbe97094..8948d6ecf8 100644 --- a/client/src/templates/Challenges/classic/ActionRow.js +++ b/client/src/templates/Challenges/classic/action-row.tsx @@ -1,16 +1,15 @@ -import PropTypes from 'prop-types'; import React from 'react'; import BreadCrumb from '../components/bread-crumb'; import EditorTabs from './EditorTabs'; -const propTypes = { - block: PropTypes.string, - showConsole: PropTypes.bool, - showNotes: PropTypes.bool, - showPreview: PropTypes.bool, - superBlock: PropTypes.string, - switchDisplayTab: PropTypes.func -}; +interface ActionRowProps { + block: string; + showConsole: boolean; + showNotes: boolean; + showPreview: boolean; + superBlock: string; + switchDisplayTab: (displayTab: string) => void; +} const ActionRow = ({ switchDisplayTab, @@ -18,7 +17,7 @@ const ActionRow = ({ showConsole, superBlock, block -}) => { +}: ActionRowProps): JSX.Element => { const restartStep = () => { console.log('restart'); }; @@ -57,6 +56,5 @@ const ActionRow = ({ ); }; -ActionRow.propTypes = propTypes; ActionRow.displayName = 'ActionRow'; export default ActionRow;