fix: align widget accessibility and locales
This commit is contained in:
1 parent
d880c4a281
commit
6c8dbc182f
11 files changed
+46
-46
No files matched your search
@@ -1,10 +1,11 @@
|
||||
import { Avatar, Badge, Group, Paper, Stack, Text } from "@mantine/core";
|
||||
|
||||
import type { TracearrHistorySession } from "@homarr/integrations/types";
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
import { useCurrentIntlLocale, useScopedI18n } from "@homarr/translation/client";
|
||||
|
||||
export function RecentActivityList({ sessions }: { sessions: TracearrHistorySession[] }) {
|
||||
const t = useScopedI18n("widget.tracearr");
|
||||
const locale = useCurrentIntlLocale();
|
||||
|
||||
return (
|
||||
<Stack gap={4}>
|
||||
@@ -42,7 +43,7 @@ export function RecentActivityList({ sessions }: { sessions: TracearrHistorySess
|
||||
{session.watched ? t("recentActivity.watched") : t("recentActivity.partial")}
|
||||
</Badge>
|
||||
<Text size="xs" c="dimmed" lineClamp={1}>
|
||||
{new Date(session.startedAt).toLocaleDateString()}
|
||||
{new Date(session.startedAt).toLocaleDateString(locale)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Group>
|
||||
|
||||
@@ -2,10 +2,11 @@ import { Avatar, Badge, Group, Paper, Stack, Text } from "@mantine/core";
|
||||
import { IconAlertTriangle } from "@tabler/icons-react";
|
||||
|
||||
import type { TracearrViolation } from "@homarr/integrations/types";
|
||||
import { useScopedI18n } from "@homarr/translation/client";
|
||||
import { useCurrentIntlLocale, useScopedI18n } from "@homarr/translation/client";
|
||||
|
||||
export function ViolationsList({ violations }: { violations: TracearrViolation[] }) {
|
||||
const t = useScopedI18n("widget.tracearr");
|
||||
const locale = useCurrentIntlLocale();
|
||||
|
||||
return (
|
||||
<Stack gap={4}>
|
||||
@@ -53,7 +54,7 @@ export function ViolationsList({ violations }: { violations: TracearrViolation[]
|
||||
{violation.severity}
|
||||
</Badge>
|
||||
<Text size="xs" c="dimmed" lineClamp={1}>
|
||||
{new Date(violation.createdAt).toLocaleDateString()}
|
||||
{new Date(violation.createdAt).toLocaleDateString(locale)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Group>
|
||||
|
||||
Reference in new issue
Block a user