Remove close button from clock widget and simplify its props

Remove the 'X' close button from the clock widget and refactor its props, simplifying the component by removing unused `onHide` and `hideLabel` functionalities.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: b2e77920-44ee-4103-9c61-e01b6ccb0094
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/PwtbShH
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
riyadhafraa
2026-04-21 17:41:46 +00:00
parent 369e418fd3
commit a4b9ad9b86
-25
View File
@@ -26,7 +26,6 @@ import {
MessageSquare,
BellRing,
Sparkles,
X,
} from "lucide-react";
import * as LucideIcons from "lucide-react";
import type { LucideIcon } from "lucide-react";
@@ -156,16 +155,12 @@ function SortableClockTile({
hour12,
size,
onToggleSize,
onHide,
hideLabel,
}: {
time: Date;
lang: string;
hour12: boolean | null | undefined;
size: HomeClockSize;
onToggleSize: () => void;
onHide: () => void;
hideLabel: string;
}) {
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
id: CLOCK_TILE_ID,
@@ -245,24 +240,6 @@ function SortableClockTile({
size={px - (isLarge ? 16 : 10)}
showLabels={false}
/>
<button
type="button"
aria-label={hideLabel}
title={hideLabel}
onPointerDown={(e) => {
e.stopPropagation();
clearTimer();
}}
onPointerUp={(e) => e.stopPropagation()}
onClick={(e) => {
e.stopPropagation();
clearTimer();
onHide();
}}
className="absolute top-1 end-1 opacity-70 hover:opacity-100 focus:opacity-100 transition-opacity bg-foreground/10 hover:bg-foreground/20 text-foreground rounded-full w-5 h-5 flex items-center justify-center shadow-sm"
>
<X size={12} />
</button>
</div>
<span className="text-[11px] text-foreground/85 font-medium text-center leading-tight max-w-[78px] truncate">
{formatTime(time, lang, {
@@ -548,8 +525,6 @@ export default function HomePage() {
hour12={user?.clockHour12 ?? null}
size={clockSize}
onToggleSize={toggleClockSize}
onHide={() => setHomeClockVisible(false)}
hideLabel={t("home.clockStyle.hideWidget")}
/>
);
}