diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx index 9cdde14b9e..baef2734e6 100644 --- a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsModelListPage.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useCallback, useState, useMemo } from "react"; +import React, { useEffect, useCallback, useState } from "react"; import { Link } from "react-router-dom"; import { SessionTtsInferenceResultListFc } from "../../_common/SessionTtsInferenceResultsListFc"; import { SessionTtsModelUploadResultListFc } from "../../_common/SessionTtsModelUploadResultsListFc"; @@ -38,7 +38,6 @@ import { TwitchTtsNotice } from "./notices/TwitchTtsNotice"; import { PleaseFollowNotice } from "./notices/PleaseFollowNotice"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { - faStar, faTrash, faVolumeHigh, faVolumeUp, @@ -46,8 +45,9 @@ import { import { GenericNotice } from "./notices/GenericNotice"; import { DiscordLink2 } from "@storyteller/components/src/elements/DiscordLink2"; import { motion } from "framer-motion"; -import { container, item, image, panel } from "../../../../data/animation"; +import { container, panel } from "../../../../data/animation"; import { SessionSubscriptionsWrapper } from "@storyteller/components/src/session/SessionSubscriptionsWrapper"; +import { TtsPageHero } from "./TtsPageHero"; export interface EnqueueJobResponsePayload { success: boolean; @@ -112,19 +112,6 @@ function TtsModelListPage(props: Props) { setMaybeSelectedTtsModel, } = props; - const randomImage = useMemo(() => { - const images = [ - // "mascot/halloween_1.webp", - // "mascot/halloween_2.webp", - // "mascot/halloween_3.webp", - - "mascot/kitsune_pose2.webp", - "mascot/kitsune_wizard.webp", - ]; - - return images[Math.floor(Math.random() * images.length)]; - }, []); - const [maybeTtsError, setMaybeTtsError] = useState< GenerateTtsAudioErrorType | undefined >(undefined); @@ -320,35 +307,6 @@ function TtsModelListPage(props: Props) { } } - let signUpButton = <>; - let upgradeButton = <>; - - if (!props.sessionWrapper.isLoggedIn()) { - signUpButton = ( - <> - - - - - ); - } - - if (props.sessionWrapper.isLoggedIn()) { - if (!props.sessionSubscriptionsWrapper.hasPaidFeatures()) { - upgradeButton = ( - <> - - - - - ); - } - } // NB: If the text is too long, don't allow submission let remainingCharactersButtonDisabled = props.textBuffer.trim().length > 1024; @@ -365,54 +323,10 @@ function TtsModelListPage(props: Props) { {twitchTtsNotice} -
-
-
-
- -
-
-
-
- - {t("tts.TtsModelListPage.heroSection.title")} - - - - Use FakeYou's deepfake tech to say stuff with your favorite - characters. - - -
- - - {upgradeButton} - {signUpButton} - - - - -
-
-
+
diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsPageHero.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsPageHero.tsx new file mode 100644 index 0000000000..2bae84b509 --- /dev/null +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/TtsPageHero.tsx @@ -0,0 +1,112 @@ +import React, { useMemo } from "react"; +import { SessionWrapper } from "@storyteller/components/src/session/SessionWrapper"; +import { SessionSubscriptionsWrapper } from "@storyteller/components/src/session/SessionSubscriptionsWrapper"; +import { Link } from "react-router-dom"; +import { Trans } from "react-i18next"; +import { t } from "i18next"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faStar } from "@fortawesome/free-solid-svg-icons"; +import { item, image } from "../../../../data/animation"; +import { motion } from "framer-motion"; + +interface Props { + sessionWrapper: SessionWrapper; + sessionSubscriptionsWrapper: SessionSubscriptionsWrapper; +} + +export function TtsPageHero(props: Props) { + + const randomImage = useMemo(() => { + const images = [ + // "mascot/halloween_1.webp", + // "mascot/halloween_2.webp", + // "mascot/halloween_3.webp", + + "mascot/kitsune_pose2.webp", + "mascot/kitsune_wizard.webp", + ]; + + return images[Math.floor(Math.random() * images.length)]; + }, []); + + let signUpButton = <>; + let upgradeButton = <>; + + if (!props.sessionWrapper.isLoggedIn()) { + signUpButton = ( + <> + + + + + ); + } + + if (props.sessionWrapper.isLoggedIn()) { + if (!props.sessionSubscriptionsWrapper.hasPaidFeatures()) { + upgradeButton = ( + <> + + + + + ); + } + } + + return ( +
+
+
+
+ +
+
+
+
+ + {t("tts.TtsModelListPage.heroSection.title")} + + + + Use FakeYou's deepfake tech to say stuff with your favorite + characters. + + +
+ + + {upgradeButton} + {signUpButton} + + + + +
+
+
+ ); +}