forge
Explore
Log in

Don't you dare go Hollow

🍅 move pomodoro start/finish buttons into PageHeader actions

Browse files at this commit

aec4c7037cf6f7faf55991a342a20afb8ebaed80Burak BoduroğluParent: 9377421
  • refactor
    • 🍅 move pomodoro start/finish buttons into PageHeader actions
Show full message
refactor: 🍅 move pomodoro start/finish buttons into PageHeader actions
- removes redundant button row inside the card, uses header action slot
  like other detail pages
src/pages/pomodoro-page.tsxmodified+20 -13
@@ -65,7 +65,26 @@ function PomodoroContent() {
6565
6666 return (
6767 <div class="space-y-6">
68- <PageHeader accent="mint" eyebrow={t("nav.pomodoro")} title={t("pomodoro.title")} description={t("pomodoro.subtitle")} />
68+ <PageHeader
69+ accent="mint"
70+ eyebrow={t("nav.pomodoro")}
71+ title={t("pomodoro.title")}
72+ description={t("pomodoro.subtitle")}
73+ actions={
74+ <Show
75+ when={running()}
76+ fallback={
77+ <Button type="button" size="sm" class="min-w-[7.5rem] rounded-lg" disabled={pending()} onClick={() => void run(postPomodoroStart, t("pomodoro.started"))}>
78+ {t("pomodoro.start")}
79+ </Button>
80+ }
81+ >
82+ <Button type="button" size="sm" variant="outline" class="min-w-[7.5rem] rounded-lg" disabled={pending()} onClick={() => void run(postPomodoroFinish, t("pomodoro.finished"))}>
83+ {t("pomodoro.finish")}
84+ </Button>
85+ </Show>
86+ }
87+ />
6988
7089 <Show when={flash()}>
7190 <Alert variant="success">{flash()}</Alert>
@@ -83,18 +102,6 @@ function PomodoroContent() {
83102 <Badge variant={running() ? "default" : "secondary"} class="rounded-sm">
84103 {running() ? t("pomodoro.running") : t("pomodoro.idle")}
85104 </Badge>
86- <Show
87- when={running()}
88- fallback={
89- <Button type="button" size="sm" class="rounded-sm" disabled={pending()} onClick={() => void run(postPomodoroStart, t("pomodoro.started"))}>
90- {t("pomodoro.start")}
91- </Button>
92- }
93- >
94- <Button type="button" size="sm" variant="outline" class="rounded-sm" disabled={pending()} onClick={() => void run(postPomodoroFinish, t("pomodoro.finished"))}>
95- {t("pomodoro.finish")}
96- </Button>
97- </Show>
98105 </div>
99106 </div>
100107 </section>