From b3e9e4aceb0ef8c470289c13f5faf3b6d3346427 Mon Sep 17 00:00:00 2001 From: BFlat Date: Fri, 27 Jan 2023 13:21:25 +0700 Subject: [PATCH 1/3] explore rollout on btn click --- .../fakeyou.com/src/scss/site-refresh.scss | 17 +++ .../tts/tts_model_list/TtsModelListPage.tsx | 93 +++++++----- .../explore/ExploreVoicesModal.tsx | 143 +++++------------- 3 files changed, 116 insertions(+), 137 deletions(-) diff --git a/packages/fakeyou.com/src/scss/site-refresh.scss b/packages/fakeyou.com/src/scss/site-refresh.scss index 7c8f830011..a76fe66c24 100644 --- a/packages/fakeyou.com/src/scss/site-refresh.scss +++ b/packages/fakeyou.com/src/scss/site-refresh.scss @@ -828,6 +828,23 @@ styles with important tags: .tippy-box[data-theme~="fakeyou"] > .tippy-svg-arrow { fill: lighten($secondary, 5%); } + + .sliding-content { + overflow: hidden; + opacity: 0; + height: 0; + transition-property: none !important; + transition: all 0.05s !important; + transition-timing-function: ease !important; + } + .sliding-content.open { + overflow: visible; + opacity: 1; + height: 100%; + transition-property: none !important; + transition: all 0.2s !important; + transition-timing-function: ease !important; + } } select { diff --git a/packages/fakeyou.com/src/v2/view/pages/tts/tts_model_list/TtsModelListPage.tsx b/packages/fakeyou.com/src/v2/view/pages/tts/tts_model_list/TtsModelListPage.tsx index 6f5e9a9df0..ca41cd5e7f 100644 --- a/packages/fakeyou.com/src/v2/view/pages/tts/tts_model_list/TtsModelListPage.tsx +++ b/packages/fakeyou.com/src/v2/view/pages/tts/tts_model_list/TtsModelListPage.tsx @@ -39,7 +39,8 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faArrowRight, faBarsStaggered, - faCompass, + faChevronDown, + faChevronUp, faDeleteLeft, faGlobe, faVolumeHigh, @@ -64,11 +65,11 @@ import { AVAILABLE_TTS_LANGUAGE_CATEGORY_MAP, ENGLISH_LANGUAGE, } from "../../../../../_i18n/AvailableLanguageMap"; -import { ExploreVoicesModal } from "./explore/ExploreVoicesModal"; import { WebUrl } from "../../../../../common/WebUrl"; import { usePrefixedDocumentTitle } from "../../../../../common/UsePrefixedDocumentTitle"; import { RatingButtons } from "../../../_common/ratings/RatingButtons"; import { RatingStats } from "../../../_common/ratings/RatingStats"; +import { ExploreVoicesModal } from "./explore/ExploreVoicesModal"; export interface EnqueueJobResponsePayload { success: boolean; @@ -149,6 +150,14 @@ function TtsModelListPage(props: Props) { return () => clearTimeout(timeout); }, []); + const [isSliding, setIsSliding] = useState(false); + const [isOpen, setIsOpen] = useState(false); + + const handleClick = () => { + setIsSliding(!isSliding); + setIsOpen(!isOpen); + }; + let { setTtsModels, setAllTtsCategories, @@ -326,19 +335,19 @@ function TtsModelListPage(props: Props) { props.maybeSelectedTtsModel .ietf_primary_language_subtag as AvailableTtsLanguageKey ] || ENGLISH_LANGUAGE; - + let ratingButtons = <>; if (props.sessionWrapper.isLoggedIn()) { ratingButtons = ( - ); } directViewLink = ( -
+

{t("tts.TtsModelListPage.voiceDetails.voiceBy")}{" "} @@ -384,11 +393,14 @@ function TtsModelListPage(props: Props) { {ratingButtons} -

); @@ -508,10 +520,10 @@ function TtsModelListPage(props: Props) {
-
+
{/* Explore Modal */} - + +
+ +
{directViewLink} diff --git a/packages/fakeyou.com/src/v2/view/pages/tts/tts_model_list/explore/ExploreVoicesModal.tsx b/packages/fakeyou.com/src/v2/view/pages/tts/tts_model_list/explore/ExploreVoicesModal.tsx index 0380a35eb9..96435ece7d 100644 --- a/packages/fakeyou.com/src/v2/view/pages/tts/tts_model_list/explore/ExploreVoicesModal.tsx +++ b/packages/fakeyou.com/src/v2/view/pages/tts/tts_model_list/explore/ExploreVoicesModal.tsx @@ -1,15 +1,11 @@ import React from "react"; -import { - faArrowRight, - faCompass, - faEraser, -} from "@fortawesome/free-solid-svg-icons"; +import { faEraser } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { LanguageOptions } from "./LanguageOptions"; import { TtsCategoryType } from "../../../../../../AppWrapper"; import { TtsModelListItem } from "@storyteller/components/src/api/tts/ListTtsModels"; import { CategoryOptions } from "./CategoryOptions"; -import { ScopedVoiceModelOptions } from "./ScopedVoiceModelOptions"; +// import { ScopedVoiceModelOptions } from "./ScopedVoiceModelOptions"; import { t } from "i18next"; interface Props { @@ -90,106 +86,49 @@ export function ExploreVoicesModal(props: Props) { }; return ( -