Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ export function VisualEditorContent({
}) {
// If there's an error, show warning below header with disabled button
if (error) {
const hideRightButton = error.type === "REPO_NOT_CONNECTED";

return (
<VisualEditorCard
rightContent={<GoToEditorButton docsUrl={docsUrl} session={session} disabled />}
rightContent={hideRightButton ? undefined : <GoToEditorButton docsUrl={docsUrl} session={session} disabled />}
warningContent={
<VisualEditorValidationErrorHandler
error={error}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTi
import { Skeleton } from "../ui/skeleton";
import { Step, Steps } from "../ui/steps";
import { MarkAsReadyButton } from "./MarkAsReadyButton";
import { ReleaseConfirmDialog } from "./ReleaseConfirmDialog";

export interface EditorNextStepsModalProps {
open: boolean;
Expand All @@ -18,6 +19,7 @@ export interface EditorNextStepsModalProps {

export function EditorNextStepsModal({ open, onOpenChange }: EditorNextStepsModalProps) {
const [showConfetti, setShowConfetti] = useState(true);
const [showReleaseConfirm, setShowReleaseConfirm] = useState(false);
const { gitPrUrl, isReadyForReview } = useGitPrInfo();
const { startConfetti } = useConfetti();

Expand All @@ -29,6 +31,9 @@ export function EditorNextStepsModal({ open, onOpenChange }: EditorNextStepsModa
}
}, [open, showConfetti, startConfetti]);

const handleRelease = () => {
};

return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-md">
Expand All @@ -53,12 +58,30 @@ export function EditorNextStepsModal({ open, onOpenChange }: EditorNextStepsModa
</Step>
</Steps>
</DialogBody>
<div className="px-6 pb-6">
<p className="text-sm text-muted-foreground">
Do you want to{" "}
<button
type="button"
onClick={() => setShowReleaseConfirm(true)}
className="text-primary hover:underline cursor-pointer"
>
release this change now
</button>
?
</p>
</div>
<DialogFooter className="justify-end">
<Button variant="outline" onClick={() => onOpenChange(false)}>
Done
</Button>
</DialogFooter>
</DialogContent>
<ReleaseConfirmDialog
open={showReleaseConfirm}
onOpenChange={setShowReleaseConfirm}
onConfirm={handleRelease}
/>
</Dialog>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use client";

import { Button } from "../ui/button";
import { Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "../ui/dialog";

export interface ReleaseConfirmDialogProps {
open: boolean;
onOpenChange: (open: boolean) => void;
onConfirm: () => void;
}

export function ReleaseConfirmDialog({ open, onOpenChange, onConfirm }: ReleaseConfirmDialogProps) {
const handleConfirm = () => {
onConfirm();
onOpenChange(false);
};

return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-sm">
<DialogHeader>
<DialogTitle className="text-center mt-4">Are you sure?</DialogTitle>
</DialogHeader>
<DialogBody className="px-6">
<p className="text-sm text-center text-muted-foreground mb-4">
This will push your changes to production.
</p>
</DialogBody>
<DialogFooter className="justify-end gap-2">
<Button variant="outline" onClick={() => onOpenChange(false)}>
No
</Button>
<Button onClick={handleConfirm}>Yes, release</Button>
</DialogFooter>
</DialogContent>
</Dialog>
);
}
Loading