1
This commit is contained in:
@@ -1014,6 +1014,7 @@ function PuzzleLevelDetailDialog({
|
||||
}
|
||||
|
||||
function PuzzlePublishDialog({
|
||||
actionError,
|
||||
blockers,
|
||||
editState,
|
||||
imageRefreshKey,
|
||||
@@ -1022,6 +1023,7 @@ function PuzzlePublishDialog({
|
||||
onClose,
|
||||
onPublish,
|
||||
}: {
|
||||
actionError: string | null;
|
||||
blockers: string[];
|
||||
editState: DraftEditState;
|
||||
imageRefreshKey: string;
|
||||
@@ -1076,7 +1078,11 @@ function PuzzlePublishDialog({
|
||||
<div className="text-xs font-bold tracking-[0.18em] text-[var(--platform-text-soft)]">
|
||||
发布检查
|
||||
</div>
|
||||
{publishReady ? (
|
||||
{actionError ? (
|
||||
<div className="platform-banner platform-banner--danger text-sm leading-6">
|
||||
{actionError}
|
||||
</div>
|
||||
) : publishReady ? (
|
||||
<div className="platform-banner platform-banner--success text-sm leading-6">
|
||||
当前作品已满足发布条件。
|
||||
</div>
|
||||
@@ -1361,6 +1367,7 @@ function PuzzleWorkInfoTab({
|
||||
}
|
||||
|
||||
function PuzzleResultActionBar({
|
||||
actionError,
|
||||
editState,
|
||||
imageRefreshKey,
|
||||
isBusy,
|
||||
@@ -1368,6 +1375,7 @@ function PuzzleResultActionBar({
|
||||
publishBlockers,
|
||||
onPublish,
|
||||
}: {
|
||||
actionError: string | null;
|
||||
editState: DraftEditState;
|
||||
imageRefreshKey: string;
|
||||
isBusy: boolean;
|
||||
@@ -1376,12 +1384,21 @@ function PuzzleResultActionBar({
|
||||
onPublish: () => void;
|
||||
}) {
|
||||
const [showPublishDialog, setShowPublishDialog] = useState(false);
|
||||
const [hasAttemptedPublish, setHasAttemptedPublish] = useState(false);
|
||||
|
||||
const closePublishDialog = () => {
|
||||
setHasAttemptedPublish(false);
|
||||
setShowPublishDialog(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="mt-4 flex items-center justify-end gap-3 pb-[max(0.25rem,env(safe-area-inset-bottom))]">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setShowPublishDialog(true)}
|
||||
onClick={() => {
|
||||
setHasAttemptedPublish(false);
|
||||
setShowPublishDialog(true);
|
||||
}}
|
||||
disabled={isBusy}
|
||||
className={`platform-button platform-button--primary ${isBusy ? 'opacity-55' : ''}`}
|
||||
>
|
||||
@@ -1393,13 +1410,17 @@ function PuzzleResultActionBar({
|
||||
|
||||
{showPublishDialog ? (
|
||||
<PuzzlePublishDialog
|
||||
actionError={hasAttemptedPublish ? actionError : null}
|
||||
blockers={publishBlockers}
|
||||
editState={editState}
|
||||
imageRefreshKey={imageRefreshKey}
|
||||
isBusy={isBusy}
|
||||
publishReady={publishReady}
|
||||
onClose={() => setShowPublishDialog(false)}
|
||||
onPublish={onPublish}
|
||||
onClose={closePublishDialog}
|
||||
onPublish={() => {
|
||||
setHasAttemptedPublish(true);
|
||||
onPublish();
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -1671,6 +1692,7 @@ export function PuzzleResultView({
|
||||
) : null}
|
||||
|
||||
<PuzzleResultActionBar
|
||||
actionError={error}
|
||||
editState={editState}
|
||||
imageRefreshKey={imageRefreshKey}
|
||||
isBusy={isBusy}
|
||||
|
||||
Reference in New Issue
Block a user