Skip to content
Merged
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
22 changes: 16 additions & 6 deletions client/src/module/student/opensource/FirstPRRoadmapPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, useCallback } from "react";
import { ConfirmDialog } from "../../../components/ui/ConfirmDialog";
import { motion, AnimatePresence } from "framer-motion";
import {
CheckCircle2, GitPullRequest, ArrowRight,
Expand All @@ -25,6 +26,7 @@ const STORAGE_KEY = "first-pr-roadmap-completed";

// ─── Page ──────────────────────────────────────────────────────
export default function FirstPRRoadmapPage() {
const [showResetConfirm, setShowResetConfirm] = useState(false);
const [completed, setCompleted] = useState<Set<string>>(() => {
try {
const stored = localStorage.getItem(STORAGE_KEY);
Expand Down Expand Up @@ -153,16 +155,24 @@ export default function FirstPRRoadmapPage() {
Discover repos to contribute to
</Link>
<button
onClick={() => {
if (window.confirm("Reset all steps?")) {
setCompleted(new Set());
try { localStorage.removeItem(STORAGE_KEY); } catch { /**/ }
}
}}
onClick={() => setShowResetConfirm(true)}
className="text-sm text-lime-700 dark:text-lime-400 border border-lime-400 px-3 py-0.5 rounded-lg font-medium"
>
Start over
</button>
<ConfirmDialog
open={showResetConfirm}
title="Reset all steps?"
description="This will remove your progress and reset all completed steps."
confirmLabel="Reset"
cancelLabel="Cancel"
onConfirm={() => {
setCompleted(new Set());
try { localStorage.removeItem(STORAGE_KEY); } catch { /**/ }
setShowResetConfirm(false);
}}
onCancel={() => setShowResetConfirm(false)}
/>
</div>
</div>
</motion.div>
Expand Down
Loading