diff --git a/client/src/templates/Challenges/components/challenge-transcript.css b/client/src/templates/Challenges/components/challenge-transcript.css
index cd8271ca593..0bc2065418d 100644
--- a/client/src/templates/Challenges/components/challenge-transcript.css
+++ b/client/src/templates/Challenges/components/challenge-transcript.css
@@ -1,4 +1,17 @@
.challenge-transcript-heading {
cursor: pointer;
font-weight: bold;
+ margin-top: 1.5em;
+}
+
+#learn-app-wrapper .transcript-table {
+ display: table;
+ width: 100%;
+ border: 1px solid var(--gray-05);
+ border-collapse: collapse;
+}
+
+#learn-app-wrapper .transcript-table td {
+ border: none;
+ text-align: start;
}
diff --git a/client/src/templates/Challenges/components/challenge-transcript.tsx b/client/src/templates/Challenges/components/challenge-transcript.tsx
index 782f013dd80..9bc54727a84 100644
--- a/client/src/templates/Challenges/components/challenge-transcript.tsx
+++ b/client/src/templates/Challenges/components/challenge-transcript.tsx
@@ -2,7 +2,6 @@ import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Spacer } from '@freecodecamp/ui';
import store from 'store';
-import PrismFormatted from './prism-formatted';
import './challenge-transcript.css';
@@ -37,7 +36,20 @@ function ChallengeTranscript({
{t('learn.transcript')}
-
+
+
+ {transcript
+ .split('\n')
+ .filter(line => line.trim() !== '')
+ .map((line, idx) => {
+ return (
+
+ |
+
+ );
+ })}
+
+
>
diff --git a/client/src/templates/Challenges/components/scene/scene.tsx b/client/src/templates/Challenges/components/scene/scene.tsx
index 488e1080a29..04bab79d8e4 100644
--- a/client/src/templates/Challenges/components/scene/scene.tsx
+++ b/client/src/templates/Challenges/components/scene/scene.tsx
@@ -13,6 +13,7 @@ import { useTranslation } from 'react-i18next';
import { FullScene } from '../../../../redux/prop-types';
import { Loader } from '../../../../components/helpers';
import ClosedCaptionsIcon from '../../../../assets/icons/closedcaptions';
+import ChallengeTranscript from '../challenge-transcript';
import { sounds, backgrounds, characterAssets } from './scene-assets';
import Character from './character';
import { SceneSubject } from './scene-subject';
@@ -167,6 +168,25 @@ export function Scene({
setSceneIsReady(true);
};
+ const buildTranscript = () => {
+ let transcriptText = '';
+ commands.forEach(command => {
+ if (command.character && command.dialogue && command.startTime) {
+ transcriptText =
+ transcriptText +
+ '\n' +
+ '' +
+ command.character +
+ ':' +
+ ' ' +
+ command.dialogue.text +
+ '\n';
+ }
+ });
+
+ return transcriptText;
+ };
+
const handlePlay = useCallback(() => {
const pausedAt = pausedAtRef.current;
const updateCurrentTime = () => {
@@ -349,6 +369,7 @@ export function Scene({
};
}, []);
+ const transcriptText = buildTranscript();
return (
)}
-
+
);