feat(p2v): 무빙 포스터·롱컷 통합 및 상세·소셜 기능 연결
This commit is contained in:
1 parent
cd71f6d9d3
commit
c06018d88c
42 files changed
+3020
-1610
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { AutocompleteRequest } from '../../utils/api';
|
||||
import SearchInputForm, { SearchType } from '../../components/SearchInputForm';
|
||||
@@ -6,7 +6,8 @@ import PipelineTabs, { Pipeline } from '../../components/PipelineTabs';
|
||||
import SsulCreateForm from '../Ssulbox/SsulCreateForm';
|
||||
import { Scen } from '../Ssulbox/ssulData';
|
||||
import PosterCreateForm from '../Poster/PosterCreateForm';
|
||||
import StylingContent from '../Poster/StylingContent';
|
||||
import PosterStartChoice from '../Poster/PosterStartChoice';
|
||||
import PlayreelCreateForm from '../P2v/PlayreelCreateForm';
|
||||
|
||||
interface UrlInputContentProps {
|
||||
/** 현재 선택된 파이프라인. 소유자는 GenerationFlow (분기·리셋 때문) */
|
||||
@@ -20,6 +21,8 @@ interface UrlInputContentProps {
|
||||
onSsulJobStarted: (taskId: number, scenario: Scen) => void;
|
||||
/** 포스터 영상(F1) 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
||||
onPosterJobStarted: (jobId: string) => void;
|
||||
/** 롱컷 생성 요청 접수 시. 폴링 소유는 GenerationFlow */
|
||||
onPlayreelJobStarted: (jobId: string) => void;
|
||||
/** 크레딧 부족 시 충전 화면으로 */
|
||||
onGoToPayment: () => void;
|
||||
}
|
||||
@@ -38,12 +41,28 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
|
||||
error,
|
||||
onSsulJobStarted,
|
||||
onPosterJobStarted,
|
||||
onPlayreelJobStarted,
|
||||
onGoToPayment,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
// 스타일링은 한 화면짜리 도구라 진입 폼보다 넓은 판이 필요하다 (generation-flow.css 참조)
|
||||
const wide = pipeline === 'styling';
|
||||
/**
|
||||
* 무빙 포스터 탭의 시작 화면. 롱컷은 별도 탭이 아니라 이 화면의 두 번째 갈래다 —
|
||||
* 'choose' 에서 가진 것(이미지 / 상품페이지 주소)을 고르면 폼으로 들어간다.
|
||||
*/
|
||||
const [posterStart, setPosterStart] = useState<'choose' | 'image'>('choose');
|
||||
const showChoice = pipeline === 'poster' && posterStart === 'choose';
|
||||
|
||||
const handleTabChange = (next: Pipeline) => {
|
||||
// 무빙 포스터 탭을 다시 누르면 어느 폼에 있었든 선택 화면으로 돌아간다
|
||||
if (next === 'poster') setPosterStart('choose');
|
||||
onPipelineChange(next);
|
||||
};
|
||||
|
||||
const backToChoice = () => {
|
||||
setPosterStart('choose');
|
||||
onPipelineChange('poster');
|
||||
};
|
||||
|
||||
const renderForm = () => {
|
||||
switch (pipeline) {
|
||||
@@ -59,10 +78,26 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
|
||||
case 'ssul':
|
||||
return <SsulCreateForm onSubmitted={onSsulJobStarted} onNeedCredit={onGoToPayment} />;
|
||||
case 'poster':
|
||||
return <PosterCreateForm onSubmitted={onPosterJobStarted} />;
|
||||
case 'styling':
|
||||
// 스타일링은 위저드가 아니라 도구다 — 진입 화면 안에서 처음부터 끝까지 끝난다
|
||||
return <StylingContent />;
|
||||
return posterStart === 'choose' ? (
|
||||
<PosterStartChoice
|
||||
onPickImage={() => setPosterStart('image')}
|
||||
onPickUrl={() => onPipelineChange('playreel')}
|
||||
/>
|
||||
) : (
|
||||
<PosterCreateForm
|
||||
onSubmitted={onPosterJobStarted}
|
||||
onNeedCredit={onGoToPayment}
|
||||
onBack={backToChoice}
|
||||
/>
|
||||
);
|
||||
case 'playreel':
|
||||
return (
|
||||
<PlayreelCreateForm
|
||||
onSubmitted={onPlayreelJobStarted}
|
||||
onNeedCredit={onGoToPayment}
|
||||
onBack={backToChoice}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -70,16 +105,16 @@ const UrlInputContent: React.FC<UrlInputContentProps> = ({
|
||||
|
||||
return (
|
||||
<div className="url-input-container">
|
||||
<div className={`url-input-content${wide ? ' url-input-content--wide' : ''}`}>
|
||||
<div className="url-input-content">
|
||||
<div className="url-input-logo">
|
||||
<img src="/assets/images/ADO2_with Slogan_white.svg" alt="ADO2" />
|
||||
</div>
|
||||
|
||||
<PipelineTabs value={pipeline} onChange={onPipelineChange} />
|
||||
<PipelineTabs value={pipeline} onChange={handleTabChange} />
|
||||
|
||||
{/* 고른 기능이 무엇을 해주는지 한 줄. 탭 라벨(2~6자)만으로는 네 기능의 차이가
|
||||
전달되지 않아 처음 온 사람이 아무거나 눌러본다. STEP 1 위에 둔다. */}
|
||||
<p className="pipeline-desc">{t(`pipelineTabs.desc.${pipeline}`)}</p>
|
||||
{!showChoice && <p className="pipeline-desc">{t(`pipelineTabs.desc.${pipeline}`)}</p>}
|
||||
|
||||
{renderForm()}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user