From 1e9da7fd82790e1beff33cfdb533691c86c857c5 Mon Sep 17 00:00:00 2001 From: Pablo Pettinari Date: Wed, 13 Jul 2022 12:33:06 -0300 Subject: [PATCH] fix typing in function to get skill translations string --- src/components/TutorialMetadata.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/TutorialMetadata.tsx b/src/components/TutorialMetadata.tsx index 44184dbdb4f..0656867213a 100644 --- a/src/components/TutorialMetadata.tsx +++ b/src/components/TutorialMetadata.tsx @@ -10,6 +10,7 @@ import { FakeLink } from "./SharedStyledComponents" import Emoji from "./Emoji" import Translation from "./Translation" import { Lang } from "../utils/languages" +import { TranslationKey } from "../utils/translations" const Container = styled.div` display: flex; @@ -90,8 +91,8 @@ export enum Skill { ADVANCED = "advanced", } -export const getSkillTranslationId = (skill: Skill) => - `page-tutorial-${Skill[skill.toUpperCase()]}` +export const getSkillTranslationId = (skill: Skill): TranslationKey => + `page-tutorial-${Skill[skill.toUpperCase() as keyof typeof Skill]}` const TutorialMetadata: React.FC = ({ tutorial }) => { const intl = useIntl()