From 07e6f1d414baca12b2a3d18ada24dcefe3902957 Mon Sep 17 00:00:00 2001 From: Jaya Krishna Date: Thu, 17 Oct 2024 19:20:45 +0530 Subject: [PATCH] fix dependencies from the package.json lists --- .../src/node-handlers.ts | 7 ++++++ .../end2end/__snapshots__/index.ts.snap | 25 +++++++++++++++++++ .../__tests__/end2end/index.ts | 4 +-- .../package.json | 4 ++- packages/teleport-types/package.json | 3 +++ 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/packages/teleport-plugin-html-base-component/src/node-handlers.ts b/packages/teleport-plugin-html-base-component/src/node-handlers.ts index dd7fc0e72..e8e58c2fe 100644 --- a/packages/teleport-plugin-html-base-component/src/node-handlers.ts +++ b/packages/teleport-plugin-html-base-component/src/node-handlers.ts @@ -501,6 +501,13 @@ const generateDynamicNode: NodeToHTML => { + if (node.content.referenceType === 'locale') { + const localeTag = HASTBuilders.createHTMLNode('span') + const commentNode = HASTBuilders.createComment(`Content for locale ${node.content.id}`) + HASTUtils.addChildNode(localeTag, commentNode) + return localeTag + } + const usedReferenceValue = getValueFromReference( node.content.id, node.content.referenceType === 'prop' ? propDefinitions : stateDefinitions diff --git a/packages/teleport-project-generator-next/__tests__/end2end/__snapshots__/index.ts.snap b/packages/teleport-project-generator-next/__tests__/end2end/__snapshots__/index.ts.snap index b11d99f38..35052416d 100644 --- a/packages/teleport-project-generator-next/__tests__/end2end/__snapshots__/index.ts.snap +++ b/packages/teleport-project-generator-next/__tests__/end2end/__snapshots__/index.ts.snap @@ -7,11 +7,14 @@ Object { "content": "import React, { useEffect } from 'react' import Head from 'next/head' +import { useTranslations } from 'next-intl' + import Header from '../components/header' import Hero from '../components/hero' import Footer from '../components/footer' const Home = (props) => { + const translate = useTranslations() useEffect(() => import('@lottiefiles/lottie-player'), []) return ( <> @@ -36,6 +39,18 @@ const Home = (props) => { } > + +

+ +