mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor(client): have a single place to edit sounds url (#66381)
This commit is contained in:
@@ -12,6 +12,7 @@ import SpeakingModal from './speaking-modal';
|
||||
import ChallengeHeading from './challenge-heading';
|
||||
import PrismFormatted from './prism-formatted';
|
||||
import { stripHtmlTags } from './speaking-modal-helpers';
|
||||
import { sounds } from './scene/scene-assets';
|
||||
|
||||
type MultipleChoiceQuestionsProps = {
|
||||
questions: Question[];
|
||||
@@ -54,9 +55,7 @@ function MultipleChoiceQuestions({
|
||||
};
|
||||
|
||||
const constructAudioUrl = (audioId?: string): string | undefined =>
|
||||
audioId
|
||||
? `https://cdn.freecodecamp.org/curriculum/english/animation-assets/sounds/${audioId}`
|
||||
: undefined;
|
||||
audioId ? `${sounds}/${audioId}` : undefined;
|
||||
|
||||
const getAudioUrl = (
|
||||
questionIndex: number,
|
||||
|
||||
@@ -37,6 +37,7 @@ import {
|
||||
import { isChallengeCompletedSelector } from '../redux/selectors';
|
||||
import PrismFormatted from '../components/prism-formatted';
|
||||
import { usePageLeave } from '../hooks';
|
||||
import { sounds } from '../components/scene/scene-assets';
|
||||
import ExitQuizModal from './exit-quiz-modal';
|
||||
import FinishQuizModal from './finish-quiz-modal';
|
||||
|
||||
@@ -170,7 +171,7 @@ const ShowQuiz = ({
|
||||
|
||||
const audioData = question.audioData?.audio?.filename
|
||||
? {
|
||||
audioUrl: `https://cdn.freecodecamp.org/curriculum/english/animation-assets/sounds/${question.audioData.audio.filename}`,
|
||||
audioUrl: `${sounds}/${question.audioData.audio.filename}`,
|
||||
audioStartTime:
|
||||
question.audioData.audio.startTimestamp ?? undefined,
|
||||
audioFinishTime:
|
||||
|
||||
Reference in New Issue
Block a user