Skip to content

Commit 5a0114c

Browse files
committed
feat: enable optional outro audio on Thank You page
- Introduced a constant to control the playback of outro audio on the Thank You page, allowing for future enhancements. - Updated the audio playback logic to conditionally play the closure audio based on the new constant and existing instruction settings. - Removed the SoundControlButton component from the Thank You page for a cleaner interface.
1 parent 761038b commit 5a0114c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/components/ThankYouPage.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { NavLinkWithParams } from "./common/NavLinkWithParams";
55
import { hasGAConsent } from "../utils/gaConsent";
66
import SurveyInline from "./SurveyInline";
77
import { track, EVENTS } from "../analytics/track";
8-
import { SoundControlButton } from "./SoundControl";
98
import { AudioContext } from "../context/AudioContext";
109

10+
/** Set to true to play outro/closure audio on thank-you page. Disabled while intro is used as outro. */
11+
const OUTRO_MESSAGE_ENABLED = false;
1112

1213
const ThankYouPage = () => {
1314
const { t, i18n } = useTranslation();
@@ -22,9 +23,9 @@ const ThankYouPage = () => {
2223

2324
useEffect(() => {
2425
track(EVENTS.THANK_YOU_VIEWED, { locale: lang });
25-
26-
// Only play closure once if instructions are enabled
27-
if (audioContext.instructionsEnabled && !closurePlayedRef.current) {
26+
27+
// Outro/closure: only play once if enabled and instructions are on (architecture kept for when we have a dedicated outro)
28+
if (OUTRO_MESSAGE_ENABLED && audioContext.instructionsEnabled && !closurePlayedRef.current) {
2829
closurePlayedRef.current = true;
2930
audioContext.playClosure();
3031
}
@@ -44,7 +45,6 @@ const ThankYouPage = () => {
4445
<p className="text-center font-bold text-xl text-[white] max-w-[600px]">
4546
{t("repeat-instruction")}
4647
</p>
47-
<SoundControlButton className="fixed right-2 top-4 md:right-2 md:top-4 z-[49]" />
4848
<div className="flex flex-col sm:flex-row flex-wrap justify-center gap-2 sm:gap-4">
4949
<NavLinkWithParams
5050
to="/"

0 commit comments

Comments
 (0)