Task #61: Add quick hide-clock toggle to home top bar
Added a dedicated Eye/EyeOff icon button next to the existing ClockStylePicker in the home top bar. Clicking it instantly hides or shows the home wall-clock widget without opening any popover. - Wired to the existing useHomeClockVisibility hook so it stays in sync with the toggle inside the clock-style popover (same storage key + custom event). - Reuses existing locale keys home.clockStyle.hideWidget / home.clockStyle.showWidget for aria-label and title (flips with state). - aria-pressed reflects hidden state for accessibility. - No new locale keys, no changes to default position behavior, and the popover toggle is left intact as requested. Files: - artifacts/teaboy-os/src/pages/home.tsx (added Eye/EyeOff imports and the new icon button between ClockStylePicker and the language toggle).
This commit is contained in:
@@ -21,6 +21,8 @@ import {
|
||||
Bell,
|
||||
LogOut,
|
||||
Globe,
|
||||
Eye,
|
||||
EyeOff,
|
||||
Grid2X2,
|
||||
Coffee,
|
||||
MessageSquare,
|
||||
@@ -457,6 +459,16 @@ export default function HomePage() {
|
||||
currentStyle={user?.clockStyle ?? null}
|
||||
currentHour12={user?.clockHour12 ?? null}
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setHomeClockVisible(!homeClockVisible)}
|
||||
aria-label={t(homeClockVisible ? "home.clockStyle.hideWidget" : "home.clockStyle.showWidget")}
|
||||
title={t(homeClockVisible ? "home.clockStyle.hideWidget" : "home.clockStyle.showWidget")}
|
||||
aria-pressed={!homeClockVisible}
|
||||
className="text-muted-foreground hover:text-foreground transition-colors p-1.5 rounded-lg hover:bg-foreground/5"
|
||||
>
|
||||
{homeClockVisible ? <Eye size={18} /> : <EyeOff size={18} />}
|
||||
</button>
|
||||
<button
|
||||
onClick={toggleLanguage}
|
||||
aria-label="Toggle language"
|
||||
|
||||
Reference in New Issue
Block a user