Merge branch 'feat/v2-stack-final-runtime-modernization' into feat/v2-stack-final-runtime-mobile
This commit is contained in:
2 files changed
+7
-4
No files matched your search
@@ -88,8 +88,11 @@ describe("lazy widget application graph", () => {
|
|||||||
);
|
);
|
||||||
await expect(clockWidget).toBeVisible({ timeout: 15_000 });
|
await expect(clockWidget).toBeVisible({ timeout: 15_000 });
|
||||||
|
|
||||||
|
await expect(page.locator("[data-homarr-dev-benchmark-spotlight-preloaded]")).toHaveCount(1, {
|
||||||
|
timeout: 15_000,
|
||||||
|
});
|
||||||
await page.keyboard.press("Control+K");
|
await page.keyboard.press("Control+K");
|
||||||
await expect(page.locator("[data-homarr-dev-benchmark-spotlight]")).toBeVisible();
|
await expect(page.locator("[data-homarr-dev-benchmark-spotlight]")).toBeVisible({ timeout: 15_000 });
|
||||||
await page.keyboard.press("Escape");
|
await page.keyboard.press("Escape");
|
||||||
await expect(page.locator("[data-homarr-dev-benchmark-spotlight]")).not.toBeVisible();
|
await expect(page.locator("[data-homarr-dev-benchmark-spotlight]")).not.toBeVisible();
|
||||||
|
|
||||||
|
|||||||
@@ -50,14 +50,14 @@ export default function ClockWidget({ options, width, height, displayMode }: Wid
|
|||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
<Title className="clock-time-text" fw={700} order={sizing === "md" ? 2 : sizing === "sm" ? 4 : 6} lh="1">
|
<Title className="clock-time-text" fw={700} order={sizing === "md" ? 2 : sizing === "sm" ? 4 : 6} lh="1">
|
||||||
<time dateTime={dayjs(time).tz(timezone).toISOString()} suppressHydrationWarning>
|
<time dateTime={dayjs(time).tz(timezone).toISOString()}>
|
||||||
{options.customTimeFormat
|
{options.customTimeFormat
|
||||||
? dayjs(time).tz(timezone).format(customTimeFormat)
|
? dayjs(time).tz(timezone).format(customTimeFormat)
|
||||||
: dayjs(time).tz(timezone).format(timeFormat)}
|
: dayjs(time).tz(timezone).format(timeFormat)}
|
||||||
</time>
|
</time>
|
||||||
</Title>
|
</Title>
|
||||||
{options.showDate && (
|
{options.showDate && (
|
||||||
<Text className="clock-date-text" size={sizing} lineClamp={1} suppressHydrationWarning>
|
<Text className="clock-date-text" size={sizing} lineClamp={1}>
|
||||||
{options.customDateFormat
|
{options.customDateFormat
|
||||||
? dayjs(time).tz(timezone).format(customDateFormat)
|
? dayjs(time).tz(timezone).format(customDateFormat)
|
||||||
: dayjs(time).tz(timezone).format(dateFormat)}
|
: dayjs(time).tz(timezone).format(dateFormat)}
|
||||||
@@ -124,7 +124,7 @@ interface UseCurrentTimeProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const useCurrentTime = ({ showSeconds }: UseCurrentTimeProps) => {
|
const useCurrentTime = ({ showSeconds }: UseCurrentTimeProps) => {
|
||||||
const [time, setTime] = useState(new Date());
|
const [time, setTime] = useState(() => new Date(0));
|
||||||
const timeoutRef = useRef<NodeJS.Timeout>(null);
|
const timeoutRef = useRef<NodeJS.Timeout>(null);
|
||||||
const intervalRef = useRef<NodeJS.Timeout>(null);
|
const intervalRef = useRef<NodeJS.Timeout>(null);
|
||||||
const intervalMultiplier = useMemo(() => (showSeconds ? 1 : 60), [showSeconds]);
|
const intervalMultiplier = useMemo(() => (showSeconds ? 1 : 60), [showSeconds]);
|
||||||
|
|||||||
Reference in new issue
Block a user