mirror of
https://github.com/ktds-dg0501/kt-event-marketing-fe.git
synced 2025-12-06 10:56:23 +00:00
이벤트 생성 플로우 수정 - 채널 선택 후 콘텐츠 미리보기/편집 단계 추가
- AI 이벤트 추천 -> 배포채널 선택 -> 콘텐츠 미리보기 -> 콘텐츠 편집 -> 최종승인 순서로 변경 - 우리동네TV, 지니TV, SNS 선택 시에만 콘텐츠 단계 진입하도록 조건부 분기 추가 - ContentPreviewStep, ContentEditStep 컴포넌트 임포트 및 funnel에 통합
This commit is contained in:
parent
01d91e194a
commit
3f8658f9f3
@ -4,6 +4,8 @@ import { useFunnel } from '@use-funnel/browser';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import ObjectiveStep from './steps/ObjectiveStep';
|
||||
import RecommendationStep from './steps/RecommendationStep';
|
||||
import ContentPreviewStep from './steps/ContentPreviewStep';
|
||||
import ContentEditStep from './steps/ContentEditStep';
|
||||
import ChannelStep from './steps/ChannelStep';
|
||||
import ApprovalStep from './steps/ApprovalStep';
|
||||
|
||||
@ -41,6 +43,8 @@ export default function EventCreatePage() {
|
||||
const funnel = useFunnel<{
|
||||
objective: EventData;
|
||||
recommendation: EventData;
|
||||
contentPreview: EventData;
|
||||
contentEdit: EventData;
|
||||
channel: EventData;
|
||||
approval: EventData;
|
||||
}>({
|
||||
@ -79,7 +83,46 @@ export default function EventCreatePage() {
|
||||
channel={({ context, history }) => (
|
||||
<ChannelStep
|
||||
onNext={(channels) => {
|
||||
// 우리동네TV, 지니TV, SNS 중 하나라도 포함되어 있으면 contentPreview로
|
||||
const needsContent = channels.some((ch) =>
|
||||
['uriTV', 'genieTV', 'sns'].includes(ch)
|
||||
);
|
||||
|
||||
if (needsContent) {
|
||||
history.push('contentPreview', { ...context, channels });
|
||||
} else {
|
||||
history.push('approval', { ...context, channels });
|
||||
}
|
||||
}}
|
||||
onBack={() => {
|
||||
history.go(-1);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
contentPreview={({ context, history }) => (
|
||||
<ContentPreviewStep
|
||||
title={context.recommendation?.title || ''}
|
||||
prize={context.recommendation?.prize || ''}
|
||||
onNext={(imageStyle) => {
|
||||
history.push('contentEdit', {
|
||||
...context,
|
||||
contentPreview: { imageStyle },
|
||||
});
|
||||
}}
|
||||
onSkip={() => {
|
||||
history.push('approval', context);
|
||||
}}
|
||||
onBack={() => {
|
||||
history.go(-1);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
contentEdit={({ context, history }) => (
|
||||
<ContentEditStep
|
||||
initialTitle={context.recommendation?.title || ''}
|
||||
initialPrize={context.recommendation?.prize || ''}
|
||||
onNext={(contentEdit) => {
|
||||
history.push('approval', { ...context, contentEdit });
|
||||
}}
|
||||
onBack={() => {
|
||||
history.go(-1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user