mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
Pixel/links development. New validations folder. More refactoring.
This commit is contained in:
parent
88639dfe83
commit
247e14646b
136 changed files with 1395 additions and 516 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Tooltip, TooltipTrigger, Text, Focusable } from '@umami/react-zen';
|
||||
import { Text } from '@umami/react-zen';
|
||||
import { formatDistanceToNow } from 'date-fns';
|
||||
import { useLocale, useTimezone } from '@/components/hooks';
|
||||
|
||||
|
|
@ -7,11 +7,8 @@ export function DateDistance({ date }: { date: Date }) {
|
|||
const { dateLocale } = useLocale();
|
||||
|
||||
return (
|
||||
<TooltipTrigger delay={0}>
|
||||
<Focusable>
|
||||
<Text>{formatDistanceToNow(date, { addSuffix: true, locale: dateLocale })}</Text>
|
||||
</Focusable>
|
||||
<Tooltip>{formatTimezoneDate(date.toISOString(), 'PPPpp')}</Tooltip>
|
||||
</TooltipTrigger>
|
||||
<Text title={formatTimezoneDate(date.toISOString(), 'PPPpp')}>
|
||||
{formatDistanceToNow(date, { addSuffix: true, locale: dateLocale })}
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
18
src/components/common/ExternalLink.tsx
Normal file
18
src/components/common/ExternalLink.tsx
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import Link from 'next/link';
|
||||
import { Icon, Row, Text } from '@umami/react-zen';
|
||||
import { ExternalLink as LinkIcon } from '@/components/icons';
|
||||
|
||||
export function ExternalLink({ href, children, ...props }: Icon) {
|
||||
return (
|
||||
<Row alignItems="center" overflow="hidden" gap>
|
||||
<Text title={href} truncate>
|
||||
<Link {...props} href={href} target="_blank">
|
||||
{children}
|
||||
</Link>
|
||||
</Text>
|
||||
<Icon size="sm" strokeColor="muted">
|
||||
<LinkIcon />
|
||||
</Icon>
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue