Skip to content

Commit

Permalink
feat: versions released in the past three days are marked with dots
Browse files Browse the repository at this point in the history
Signed-off-by: 1111mp <[email protected]>
  • Loading branch information
1111mp committed Oct 31, 2024
1 parent 848f3f0 commit 4fd584f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/versions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export const Versions: React.FC = () => {

const columns: ColumnDef<Nvmd.Version>[] = useMemo(() => {
const { version: latest } = versions[0] || { version: '' };
const now = dayjs();
return [
{
accessorKey: 'version',
Expand All @@ -126,13 +127,13 @@ export const Versions: React.FC = () => {
);
},
cell: ({ row }) => {
const { version, lts } = row.original;
const { version, lts, date } = row.original;
return (
<div className='flex gap-1 items-center'>
<div className='relative flex gap-1 items-center'>
<Tooltip>
<TooltipTrigger asChild>
<a
className='h-6 p-0 text-md text-foreground font-medium hover:text-primary hover:underline'
className='h-6 p-0 leading-6 text-md text-foreground font-medium hover:text-primary hover:underline'
href={`https://github.com/nodejs/node/releases/tag/${version}`}
target='_blank'
>
Expand All @@ -150,6 +151,9 @@ export const Versions: React.FC = () => {
({t('latest')})
</span>
) : null}
{dayjs(now).diff(date, 'day') <= 3 ? (
<span className='inline-block absolute w-1 h-1 top-1 -left-1.5 rounded-full bg-primary' />
) : null}
</div>
);
},
Expand Down

0 comments on commit 4fd584f

Please sign in to comment.