diff --git a/src/app/dashboard/settings/page.tsx b/src/app/dashboard/settings/page.tsx index 6015f0138..bfef75a17 100644 --- a/src/app/dashboard/settings/page.tsx +++ b/src/app/dashboard/settings/page.tsx @@ -909,7 +909,6 @@ function SettingsPageContent() { {statusMessage.message} )} - {/* Public Profile Section */}
diff --git a/src/components/StreakTracker.tsx b/src/components/StreakTracker.tsx index 51f8ab70d..3f016f4f9 100644 --- a/src/components/StreakTracker.tsx +++ b/src/components/StreakTracker.tsx @@ -24,7 +24,7 @@ interface StreakData { longest: number; lastCommitDate: string | null; totalActiveDays: number; - freezeDates: string[]; + Dates: string[]; } interface ContributionData { @@ -35,14 +35,14 @@ interface ContributionData { interface FreezeData { hasFreeze: boolean; - freezeDate?: string | null; + Date?: string | null; } export function useStreakTracker() { const { selectedAccount } = useAccount(); const [data, setData] = useState(null); const [contributionData, setContributionData] = useState(null); - const [freezeDates, setFreezeDates] = useState([]); + const [Dates, setFreezeDates] = useState([]); const [loading, setLoading] = useState(true); const [dismissedMilestones, setDismissedMilestones] = useState([]); const [lastCelebratedMilestone, setLastCelebratedMilestone] = useState(0); @@ -52,7 +52,7 @@ export function useStreakTracker() { const [error, setError] = useState(null); const [calendarMonth, setCalendarMonth] = useState(new Date()); const [freeze, setFreeze] = useState(null); - const [freezeLoading, setFreezeLoading] = useState(true); + const [Loading, setFreezeLoading] = useState(true); const [cancelling, setCancelling] = useState(false); const [confirmCancel, setConfirmCancel] = useState(false); const [showFreezeConfirm, setShowFreezeConfirm] = useState(false); @@ -124,7 +124,7 @@ export function useStreakTracker() { const fetchFreeze = useCallback(() => { setFreezeLoading(true); - fetch("/api/streak/freeze") + fetch("/api/streak/") .then((r) => r.json()) .then((d: FreezeData) => setFreeze(d)) .catch((err) => { @@ -184,20 +184,20 @@ export function useStreakTracker() { async function handleApplyFreeze() { setFreezeLoading(true); try { - const res = await fetch("/api/streak/freeze", { method: "POST" }); - if (!res.ok) throw new Error("Failed to apply freeze"); + const res = await fetch("/api/streak/", { method: "POST" }); + if (!res.ok) throw new Error("Failed to apply "); const streakUrl = selectedAccount !== null ? `/api/metrics/streak?accountId=${encodeURIComponent(selectedAccount)}` : "/api/metrics/streak"; - const [streakRes, freezeRes] = await Promise.all([ + const [streakRes, Res] = await Promise.all([ fetch(streakUrl), - fetch("/api/streak/freeze"), + fetch("/api/streak/"), ]); - const [streakData, freezeData] = await Promise.all([ + const [streakData, Data] = await Promise.all([ streakRes.json() as Promise, - freezeRes.json() as Promise, + Res.json() as Promise, ]); setData(streakData); setFreeze(freezeData); @@ -219,8 +219,8 @@ export function useStreakTracker() { setCancelling(true); try { - const res = await fetch("/api/streak/freeze", { method: "DELETE" }); - if (!res.ok) throw new Error("Failed to cancel freeze"); + const res = await fetch("/api/streak/", { method: "DELETE" }); + if (!res.ok) throw new Error("Failed to cancel "); setConfirmCancel(false); @@ -228,13 +228,13 @@ export function useStreakTracker() { selectedAccount !== null ? `/api/metrics/streak?accountId=${encodeURIComponent(selectedAccount)}` : "/api/metrics/streak"; - const [streakRes, freezeRes] = await Promise.all([ + const [streakRes, Res] = await Promise.all([ fetch(streakUrl), - fetch("/api/streak/freeze"), + fetch("/api/streak/"), ]); - const [streakData, freezeData] = await Promise.all([ + const [streakData, Data] = await Promise.all([ streakRes.json() as Promise, - freezeRes.json() as Promise, + Res.json() as Promise, ]); setData(streakData); setFreeze(freezeData); @@ -782,25 +782,23 @@ export default function StreakTracker() {
)} - {freeze && !freeze.hasFreeze && ( -
-
- Streak Freeze - ❄️ 1 available -
- - ? - -
- A streak freeze protects your streak for one missed day. You can only use one freeze at a time. -
-
-
-
+ {!Loading && ?.hasFreeze && ( +
+
+
+ {confirmCancel ? ( +
+ Remove ? +

- Frozen days are set via the streak freeze feature above. + Frozen days are set via the streak feature above.

);