From d64b54912035f8dba1384ce0215de6242469492e Mon Sep 17 00:00:00 2001 From: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com> Date: Thu, 14 Aug 2025 18:42:03 +0700 Subject: [PATCH] revert(#60948): Test adding transcript tabs to lectures (#61813) --- client/i18n/locales/english/translations.json | 1 - .../components/challenge-transcript.tsx | 13 +-- .../src/templates/Challenges/generic/show.css | 9 -- .../src/templates/Challenges/generic/show.tsx | 83 +++---------------- 4 files changed, 11 insertions(+), 95 deletions(-) diff --git a/client/i18n/locales/english/translations.json b/client/i18n/locales/english/translations.json index c7c86f03188..4de5cae413d 100644 --- a/client/i18n/locales/english/translations.json +++ b/client/i18n/locales/english/translations.json @@ -466,7 +466,6 @@ "answered-mcq": "You have unanswered questions and/or incorrect answers.", "explanation": "Explanation", "transcript": "Transcript", - "video": "Video", "solution-link": "Solution Link", "source-code-link": "Source Code Link", "ms-link": "Microsoft Link", diff --git a/client/src/templates/Challenges/components/challenge-transcript.tsx b/client/src/templates/Challenges/components/challenge-transcript.tsx index cc3ad08c406..782f013dd80 100644 --- a/client/src/templates/Challenges/components/challenge-transcript.tsx +++ b/client/src/templates/Challenges/components/challenge-transcript.tsx @@ -8,12 +8,10 @@ import './challenge-transcript.css'; interface ChallengeTranscriptProps { transcript: string; - showTranscriptTabs?: boolean; } function ChallengeTranscript({ - transcript, - showTranscriptTabs + transcript }: ChallengeTranscriptProps): JSX.Element { const { t } = useTranslation(); @@ -28,15 +26,6 @@ function ChallengeTranscript({ setIsOpen(!isOpen); } - if (showTranscriptTabs) - return ( - <> - - - - - ); - return ( <>
diff --git a/client/src/templates/Challenges/generic/show.css b/client/src/templates/Challenges/generic/show.css index 1b7bd088fb3..7c4f7d49b38 100644 --- a/client/src/templates/Challenges/generic/show.css +++ b/client/src/templates/Challenges/generic/show.css @@ -31,12 +31,3 @@ input[type='checkbox']:checked::before { audio { background-color: aqua; } - -.transcript-tabs button[aria-selected='false'] { - color: var(--secondary-color); - background-color: transparent; -} - -.transcript-tabs button[aria-selected='false']:hover { - background-color: var(--quaternary-background); -} diff --git a/client/src/templates/Challenges/generic/show.tsx b/client/src/templates/Challenges/generic/show.tsx index 36aba2bf3ff..99b230e67b9 100644 --- a/client/src/templates/Challenges/generic/show.tsx +++ b/client/src/templates/Challenges/generic/show.tsx @@ -3,21 +3,10 @@ import React, { useEffect, useRef, useState } from 'react'; import Helmet from 'react-helmet'; import { useTranslation } from 'react-i18next'; import { connect } from 'react-redux'; -import { - Container, - Col, - Row, - Button, - Spacer, - Tabs, - TabsContent, - TabsTrigger, - TabsList -} from '@freecodecamp/ui'; +import { Container, Col, Row, Button, Spacer } from '@freecodecamp/ui'; import { isEqual } from 'lodash'; import store from 'store'; import { YouTubeEvent } from 'react-youtube'; -import { useFeatureIsOn } from '@growthbook/growthbook-react'; // Local Utilities import LearnLayout from '../../../components/layouts/learn'; @@ -115,11 +104,6 @@ const ShowGeneric = ({ const { t } = useTranslation(); const container = useRef(null); - // just test on this particular block - const transcriptTabsFlagIsOn = useFeatureIsOn('transcript-tabs'); - const showTranscriptTabs = - block === 'lecture-html-fundamentals' && transcriptTabsFlagIsOn; - const blockNameTitle = `${t( `intro:${superBlock}.blocks.${block}.title` )} - ${title}`; @@ -143,11 +127,6 @@ const ShowGeneric = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - const tabs = { - transcript: 'transcript', - video: 'video' - } as const; - // video const [videoIsLoaded, setVideoIsLoaded] = useState(false); @@ -249,54 +228,7 @@ const ShowGeneric = ({ )} - {showTranscriptTabs && ( - - - - {t('learn.transcript')} - - - {t('learn.video')} - - - - {transcript && ( - - )} - - - - {videoId && ( - <> - - - - )} - - - )} - {videoId && !showTranscriptTabs && ( + {videoId && ( <> } - {transcript && !showTranscriptTabs && ( - - )} + {transcript && } + {instructions && ( <> )} + {assignments.length > 0 && ( )} + {questions.length > 0 && ( )} + {explanation ? ( ) : null} + {!hasAnsweredMcqCorrectly && (

{t('learn.answered-mcq')}

)} + +