Merge pull request #643 from storytold/dashboard-tools-reloacted

relocated dashboard tools components
This commit is contained in:
Victor O authored and GitHub committed 2024-07-30 14:40:28 -07:00
commit 192f9c5ff0
7 files changed
+92 -79

No files matched your search

@@ -0,0 +1,69 @@
import React from "react";
import { faFlask, faSparkles } from "@fortawesome/pro-solid-svg-icons";
import { useLocalize } from "hooks";
import AIToolsRow from "./AIToolsRow";
export default function AITools() {
const { t } = useLocalize("LandingPage");
const items = [
{
to: "/tts",
title: t("productTtsTitle"),
text: t("productTtsText"),
imgSrc: "/images/landing/select-tts.webp",
imgAlt: "Text to Speech",
},
{
to: "/voice-conversion",
title: t("productVcTitle"),
text: t("productVcText"),
imgSrc: "/images/landing/select-v2v.webp",
imgAlt: "Voice Conversion",
},
{
to: "/voice-designer",
title: t("productVdTitle"),
text: t("productVdText"),
imgSrc: "/images/landing/select-vd.webp",
imgAlt: "Voice Cloning",
badgeContent: {
type: "beta",
icon: faFlask,
label: "BETA",
},
},
{
to: "/face-animator",
title: t("productFaceAnimatorTitle"),
text: t("productFaceAnimatorText"),
imgSrc: "/images/landing/select-fa.webp",
imgAlt: "Face Animator",
},
{
to: "/style-video",
title: t("productVideoStyleTransferTitle"),
text: t("productVideoStyleTransferText"),
imgSrc: "/images/landing/select-vst.webp",
imgAlt: "Video Style Transfer",
badgeContent: {
type: "new",
icon: faSparkles,
label: "NEW",
},
},
{
to: "/ai-face-mirror",
title: t("productFaceMirrorTitle"),
text: t("productFaceMirrorText"),
imgSrc: "/images/landing/select-fm.webp",
imgAlt: "AI Face Mirror",
badgeContent: {
type: "new",
icon: faSparkles,
label: "NEW",
},
},
];
return <AIToolsRow {...{ items }} />;
}
@@ -10,7 +10,7 @@ interface BadgeContent {
label: string;
}
interface DashboardItemProps {
interface AIToolsItemProps {
to: string;
title: string;
text?: string;
@@ -19,14 +19,14 @@ interface DashboardItemProps {
badgeContent?: BadgeContent;
}
export function DashboardItem({
export function AIToolsItem({
to,
title,
text,
imgSrc,
imgAlt,
badgeContent,
}: DashboardItemProps) {
}: AIToolsItemProps) {
return (
<div className="col-12 col-md-6 col-lg-4">
<Link
@@ -66,21 +66,21 @@ export function DashboardItem({
);
}
interface DashboardRowProps {
items: DashboardItemProps[];
interface AIToolsRowProps {
items: AIToolsItemProps[];
bgDotsLeft?: boolean;
bgDotsRight?: boolean;
}
export function DashboardRow({
export default function AIToolsRow({
items,
bgDotsLeft,
bgDotsRight,
}: DashboardRowProps) {
}: AIToolsRowProps) {
return (
<div className="row g-4 position-relative">
{items.map((item, index) => (
<DashboardItem key={index} {...item} />
<AIToolsItem key={index} {...item} />
))}
{bgDotsLeft && (
<img
@@ -99,5 +99,3 @@ export function DashboardRow({
</div>
);
}
export default DashboardRow;
@@ -0,0 +1,2 @@
export { default } from "./AITools";
export { default as AIToolsRow } from "./AIToolsRow";
@@ -1,3 +1,4 @@
import AIFaceMirrorCTA from "./AIFaceMirrorCTA";
import AITools, { AIToolsRow } from "./AITools";
export { AIFaceMirrorCTA };
export { AIFaceMirrorCTA, AITools, AIToolsRow };
@@ -15,7 +15,7 @@ import { usePrefixedDocumentTitle } from "common/UsePrefixedDocumentTitle";
import { Button, Container, Panel } from "components/common";
import { useLocalize } from "hooks";
import React from "react";
import DashboardRow from "../landing/components/DashboardRow";
import { AIToolsRow } from "components/marketing";
import "./CreatorTools.scss";
interface CreatorToolsPageProps {
@@ -119,11 +119,11 @@ export default function CreatorToolsPage(props: CreatorToolsPageProps) {
<div className="d-flex flex-column gap-5">
<div>
<h2 className="fw-bold mb-3 mt-4">Video</h2>
<DashboardRow items={videoProducts} />
<AIToolsRow items={videoProducts} />
</div>
<div>
<h2 className="fw-bold mb-3 mt-4">Voice & Audio</h2>
<DashboardRow items={voiceProducts} />
<AIToolsRow items={voiceProducts} />
</div>
<div>
<h2 className="fw-bold mb-3 mt-4">
@@ -9,10 +9,10 @@ import {
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { SessionWrapper } from "@storyteller/components/src/session/SessionWrapper";
import { Panel } from "components/common";
import { AITools } from "components/marketing";
import { useLocalize } from "hooks";
import React from "react";
import { Link } from "react-router-dom";
import DashboardRow from "./components/DashboardRow";
interface DashboardProps {
sessionWrapper: SessionWrapper;
@@ -66,71 +66,11 @@ export default function Dashboard(props: DashboardProps) {
);
}
const dashboardProducts = [
{
to: "/tts",
title: t("productTtsTitle"),
text: t("productTtsText"),
imgSrc: "/images/landing/select-tts.webp",
imgAlt: "Text to Speech",
},
{
to: "/voice-conversion",
title: t("productVcTitle"),
text: t("productVcText"),
imgSrc: "/images/landing/select-v2v.webp",
imgAlt: "Voice Conversion",
},
{
to: "/voice-designer",
title: t("productVdTitle"),
text: t("productVdText"),
imgSrc: "/images/landing/select-vd.webp",
imgAlt: "Voice Cloning",
badgeContent: {
type: "beta",
icon: faFlask,
label: "BETA",
},
},
{
to: "/face-animator",
title: t("productFaceAnimatorTitle"),
text: t("productFaceAnimatorText"),
imgSrc: "/images/landing/select-fa.webp",
imgAlt: "Face Animator",
},
{
to: "/style-video",
title: t("productVideoStyleTransferTitle"),
text: t("productVideoStyleTransferText"),
imgSrc: "/images/landing/select-vst.webp",
imgAlt: "Video Style Transfer",
badgeContent: {
type: "new",
icon: faSparkles,
label: "NEW",
},
},
{
to: "/ai-face-mirror",
title: t("productFaceMirrorTitle"),
text: t("productFaceMirrorText"),
imgSrc: "/images/landing/select-fm.webp",
imgAlt: "AI Face Mirror",
badgeContent: {
type: "new",
icon: faSparkles,
label: "NEW",
},
},
];
return (
<Panel clear={true} className={`${!isLoggedIn ? "section" : "mt-5"}`}>
<h1 className="fw-bold mb-4">{t("productsTitle")}</h1>
<DashboardRow items={dashboardProducts} />
<AITools />
{uploadModelSection}
</Panel>
@@ -57,9 +57,10 @@ import { SearchOmnibar } from "./search/SearchOmnibar";
import { PosthogClient } from "@storyteller/components/src/analytics/PosthogClient";
import { useInferenceJobs, useLocalize } from "hooks";
import { Container, Panel } from "components/common";
import { AITools } from "components/marketing";
import PageHeaderWithImage from "components/layout/PageHeaderWithImage";
import { faMessageDots } from "@fortawesome/pro-solid-svg-icons";
import StorytellerStudioCTA from "components/common/StorytellerStudioCTA";
// import StorytellerStudioCTA from "components/common/StorytellerStudioCTA";
export interface EnqueueJobResponsePayload {
success: boolean;
@@ -611,8 +612,10 @@ function TtsModelListPage(props: Props) {
{/* <SessionTtsModelUploadResultList /> */}
</Container>
<Container type="panel" className="py-5 mt-5 d-flex flex-column gap-5">
<StorytellerStudioCTA />
<Container type="panel" className="py-5 gap-5">
<h2 {...{ className: "mb-3" }}>Try our other AI tools</h2>
<AITools />
{/*<StorytellerStudioCTA />*/}
</Container>
</>
);