feat: wire profile feedback navigation
This commit is contained in:
@@ -222,6 +222,7 @@ import { useRpgCreationEnterWorld } from '../rpg-entry/useRpgCreationEnterWorld'
|
|||||||
import { useRpgCreationResultAutosave } from '../rpg-entry/useRpgCreationResultAutosave';
|
import { useRpgCreationResultAutosave } from '../rpg-entry/useRpgCreationResultAutosave';
|
||||||
import { useRpgCreationSessionController } from '../rpg-entry/useRpgCreationSessionController';
|
import { useRpgCreationSessionController } from '../rpg-entry/useRpgCreationSessionController';
|
||||||
import { PlatformEntryCreationTypeModal } from './PlatformEntryCreationTypeModal';
|
import { PlatformEntryCreationTypeModal } from './PlatformEntryCreationTypeModal';
|
||||||
|
import { PlatformFeedbackView } from './PlatformFeedbackView';
|
||||||
import type { PlatformCreationTypeId } from './platformEntryCreationTypes';
|
import type { PlatformCreationTypeId } from './platformEntryCreationTypes';
|
||||||
import { isPlatformCreationTypeVisible } from './platformEntryCreationTypes';
|
import { isPlatformCreationTypeVisible } from './platformEntryCreationTypes';
|
||||||
import {
|
import {
|
||||||
@@ -1352,6 +1353,22 @@ export function PlatformEntryFlowShellImpl({
|
|||||||
});
|
});
|
||||||
const { setPlatformTab } = platformBootstrap;
|
const { setPlatformTab } = platformBootstrap;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (selectionStage === 'profile-feedback') {
|
||||||
|
setPlatformTab('profile');
|
||||||
|
}
|
||||||
|
}, [selectionStage, setPlatformTab]);
|
||||||
|
|
||||||
|
const openProfileFeedback = useCallback(() => {
|
||||||
|
if (!authUi?.user) {
|
||||||
|
authUi?.openLoginModal();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setPlatformTab('profile');
|
||||||
|
setSelectionStage('profile-feedback');
|
||||||
|
}, [authUi, setPlatformTab, setSelectionStage]);
|
||||||
|
|
||||||
const enterCreateTab = useCallback(() => {
|
const enterCreateTab = useCallback(() => {
|
||||||
// 只依赖稳定的 setter,避免把 bootstrap 对象的 render 级引用变化
|
// 只依赖稳定的 setter,避免把 bootstrap 对象的 render 级引用变化
|
||||||
// 传导成 Agent session 恢复 effect 的重复触发。
|
// 传导成 Agent session 恢复 effect 的重复触发。
|
||||||
@@ -5465,6 +5482,7 @@ export function PlatformEntryFlowShellImpl({
|
|||||||
setIsProfilePlayStatsOpen(false);
|
setIsProfilePlayStatsOpen(false);
|
||||||
}}
|
}}
|
||||||
onOpenPlayedWork={openPlayedWork}
|
onOpenPlayedWork={openPlayedWork}
|
||||||
|
onOpenFeedback={openProfileFeedback}
|
||||||
onOpenProfileDashboardCard={(cardKey) => {
|
onOpenProfileDashboardCard={(cardKey) => {
|
||||||
if (cardKey === 'playedWorks') {
|
if (cardKey === 'playedWorks') {
|
||||||
openProfilePlayedWorks();
|
openProfilePlayedWorks();
|
||||||
@@ -5479,6 +5497,23 @@ export function PlatformEntryFlowShellImpl({
|
|||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{selectionStage === 'profile-feedback' && (
|
||||||
|
<motion.div
|
||||||
|
key="platform-profile-feedback"
|
||||||
|
initial={{ opacity: 0, y: 12 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
exit={{ opacity: 0, y: -12 }}
|
||||||
|
className="flex h-full min-h-0 flex-col"
|
||||||
|
>
|
||||||
|
<PlatformFeedbackView
|
||||||
|
onBack={() => {
|
||||||
|
setPlatformTab('profile');
|
||||||
|
setSelectionStage('platform');
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</motion.div>
|
||||||
|
)}
|
||||||
|
|
||||||
{selectionStage === 'work-detail' && selectedPublicWorkDetail && (
|
{selectionStage === 'work-detail' && selectedPublicWorkDetail && (
|
||||||
<motion.div
|
<motion.div
|
||||||
key="platform-work-detail"
|
key="platform-work-detail"
|
||||||
|
|||||||
Reference in New Issue
Block a user