refactor: 이름 변경
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
// app/layout.tsx
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Geist, Geist_Mono } from "next/font/google";
|
import { Geist, Geist_Mono } from "next/font/google";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
@@ -13,15 +14,16 @@ const geistMono = Geist_Mono({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Create Next App",
|
title: {
|
||||||
description: "Generated by create next app",
|
default: "QuietSprint",
|
||||||
|
template: "%s · QuietSprint",
|
||||||
|
},
|
||||||
|
description: "One goal. Start now.",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
children,
|
children,
|
||||||
}: Readonly<{
|
}: Readonly<{ children: React.ReactNode }>) {
|
||||||
children: React.ReactNode;
|
|
||||||
}>) {
|
|
||||||
return (
|
return (
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<body
|
<body
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ function SessionEndInner() {
|
|||||||
<main className="min-h-screen w-full" style={{ backgroundColor: BG }}>
|
<main className="min-h-screen w-full" style={{ backgroundColor: BG }}>
|
||||||
<header className="px-5 pt-6">
|
<header className="px-5 pt-6">
|
||||||
<div className="select-none text-xl font-bold tracking-tight leading-none text-slate-800">
|
<div className="select-none text-xl font-bold tracking-tight leading-none text-slate-800">
|
||||||
hushroom
|
QuietSprint
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|||||||
15
src/app/session/layout.tsx
Normal file
15
src/app/session/layout.tsx
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// app/session/layout.tsx
|
||||||
|
import type { Metadata } from "next";
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: "Session",
|
||||||
|
description: "Focus session in progress.",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function SessionLayout({
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) {
|
||||||
|
return <>{children}</>;
|
||||||
|
}
|
||||||
@@ -270,12 +270,12 @@ function SessionInner() {
|
|||||||
const [goal, setGoal] = useState("");
|
const [goal, setGoal] = useState("");
|
||||||
const [nextAction, setNextAction] = useState("");
|
const [nextAction, setNextAction] = useState("");
|
||||||
|
|
||||||
// ✅ startedAt/now 기반 시간
|
// startedAt/now 기반 시간
|
||||||
const [startedAt, setStartedAt] = useState<number>(() => Date.now());
|
const [startedAt, setStartedAt] = useState<number>(() => Date.now());
|
||||||
const [now, setNow] = useState<number>(() => Date.now());
|
const [now, setNow] = useState<number>(() => Date.now());
|
||||||
const endedRef = useRef(false);
|
const endedRef = useRef(false);
|
||||||
|
|
||||||
// ✅ away: 누적 ms + (현재 away면 now-startedAt)
|
// away: 누적 ms + (현재 away면 now-startedAt)
|
||||||
const [isAway, setIsAway] = useState(false);
|
const [isAway, setIsAway] = useState(false);
|
||||||
const awayTotalMsRef = useRef(0);
|
const awayTotalMsRef = useRef(0);
|
||||||
const awayStartedAtRef = useRef<number | null>(null);
|
const awayStartedAtRef = useRef<number | null>(null);
|
||||||
@@ -435,7 +435,7 @@ function SessionInner() {
|
|||||||
return formatHHMMSS(remaining);
|
return formatHHMMSS(remaining);
|
||||||
}, [elapsed, remaining, mode]);
|
}, [elapsed, remaining, mode]);
|
||||||
|
|
||||||
// ✅ 타임아웃 종료(점프 포함)
|
// 타임아웃 종료(점프 포함)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!duration) return;
|
if (!duration) return;
|
||||||
if (endedRef.current) return;
|
if (endedRef.current) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user