From f8341086bfdd26ef60a4ff3056ce6d5d43d81f6e Mon Sep 17 00:00:00 2001 From: Alex Anderson Date: Mon, 27 May 2024 10:08:10 -0400 Subject: [PATCH] More type fixes --- src/components/views/DamageControl/wingPower.tsx | 6 +++++- src/helpers/hooks/usePatchedSubscriptions.ts | 2 +- src/helpers/tourHelper.js | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/views/DamageControl/wingPower.tsx b/src/components/views/DamageControl/wingPower.tsx index dc3516deb..fbafcb72e 100644 --- a/src/components/views/DamageControl/wingPower.tsx +++ b/src/components/views/DamageControl/wingPower.tsx @@ -34,6 +34,7 @@ const WingPower: React.FC<{ wingedSystems, }) => { const [setWingPower] = useReactorSetWingPowerMutation(); + const reactorPower = reactor[`${wing}WingPower`]; return ( @@ -53,7 +54,10 @@ const WingPower: React.FC<{ {capitalCase(wing)} Wing Power reactor[`${wing}WingPower`]} + alert={ + typeof reactorPower === "number" && + wingedSystems[`${wing}Power`] > reactorPower + } > {wingedSystems[`${wing}Power`]} diff --git a/src/helpers/hooks/usePatchedSubscriptions.ts b/src/helpers/hooks/usePatchedSubscriptions.ts index 50eba6e6e..df33a4134 100644 --- a/src/helpers/hooks/usePatchedSubscriptions.ts +++ b/src/helpers/hooks/usePatchedSubscriptions.ts @@ -65,7 +65,7 @@ function usePatchedSubscriptions( .request({ query, operationName, - variables, + variables: variables as any, }) .subscribe({ next: ({data}) => { diff --git a/src/helpers/tourHelper.js b/src/helpers/tourHelper.js index 69395625e..20a6e9db7 100644 --- a/src/helpers/tourHelper.js +++ b/src/helpers/tourHelper.js @@ -17,6 +17,16 @@ const SET_CLIENT_TRAINING = gql` } `; +/** + * Helper component for displaying a tour with steps. + * + * @param {Object} props - The component props. + * @param {Array} props.steps - An array of steps for the tour. + * @param {string} [props.innerKey] - The inner key for the tour component. + * @param {boolean} [props.training] - Flag indicating if the tour is in training mode. + * @param {function} [props.onRequestClose] - Callback function to be called when the tour is closed. + * @returns {JSX.Element|null} The rendered Tour component or null if there are no steps. + */ const TourHelper = ({ steps, innerKey = undefined,