크레딧 충전 기능 및 UI 수정

This commit is contained in:
skkim committed 2026-05-04 13:47:38 +09:00
1 parent 82dcda0038
commit 00ea49b7ed
8 files changed
+419 -13

No files matched your search

+12 -3
View File
@@ -118,6 +118,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
const [isAnalysisComplete, setIsAnalysisComplete] = useState(false);
const [userInfo, setUserInfo] = useState<UserMeResponse | null>(null);
const [credits, setCredits] = useState<number | null>(null);
const [myInfoInitialTab, setMyInfoInitialTab] = useState<'basic' | 'payment' | 'business' | undefined>(undefined);
const tutorial = useTutorial();
const refreshCredits = useCallback(async () => {
@@ -247,7 +248,8 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
setIsAnalysisComplete(true);
} catch (err) {
console.error('Autocomplete error:', err);
setAnalysisError(err instanceof Error ? err.message : t('app.autocompleteError'));
const msg = err instanceof Error ? err.message : '';
setAnalysisError(/^HTTP error!/.test(msg) ? t('app.autocompleteError') : (msg || t('app.autocompleteError')));
goToWizardStep(-2); // URL 입력으로 돌아가기
}
};
@@ -366,8 +368,15 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
}
}, [activeItem]);
// 결제 탭으로 바로 이동하는 핸들러 (크레딧 충전하기 버튼용)
const handleGoToPayment = () => {
setMyInfoInitialTab('payment');
setActiveItem('내 정보');
};
// 네비게이션 핸들러 - "새 프로젝트 만들기" 클릭 시 기존 프로젝트 데이터 초기화
const handleNavigate = (item: string) => {
setMyInfoInitialTab(undefined);
if (item === '새 프로젝트 만들기') {
// 기존 프로젝트 데이터 초기화
clearAllProjectStorage();
@@ -455,6 +464,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
mId={analysisData?.m_id ?? 0}
videoGenerationStatus={videoGenerationStatus}
videoGenerationProgress={videoGenerationProgress}
onGoToPayment={handleGoToPayment}
onStatusChange={(status: string) => {
if (status === 'generating_song' && !tutorial.hasSeen(TUTORIAL_KEYS.SOUND_LYRICS)) {
setTimeout(() => tutorial.startTutorial(TUTORIAL_KEYS.SOUND_LYRICS), 400);
@@ -479,7 +489,6 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
songTaskId={songTaskId}
onVideoStatusChange={setVideoGenerationStatus}
onVideoProgressChange={setVideoGenerationProgress}
onVideoComplete={refreshCredits}
onGoToCalendar={() => handleNavigate('콘텐츠 캘린더')}
/>
);
@@ -504,7 +513,7 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
case '콘텐츠 캘린더':
return <ContentCalendarContent onNavigate={handleNavigate} />;
case '내 정보':
return <MyInfoContent />;
return <MyInfoContent initialTab={myInfoInitialTab} />;
case '새 프로젝트 만들기':
// 브랜드 분석(0)과 로딩(-1)은 전체 화면으로 표시
if (wizardStep === 0 || wizardStep === -1) {