Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/site/components/Common/LinkWithArrow/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@reference "../../../styles/index.css";

.icon {
@apply ml-1
inline
w-3
fill-neutral-600
dark:fill-white;
}

.button {
@apply text-green-600
hover:text-green-900
dark:text-green-400
dark:hover:text-green-200;
}
38 changes: 38 additions & 0 deletions apps/site/components/Common/LinkWithArrow/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { ArrowUpRightIcon } from '@heroicons/react/24/solid';
import classNames from 'classnames';
import type {
ButtonHTMLAttributes,
ComponentProps,
FC,
PropsWithChildren,
} from 'react';

import Link from '#site/components/Link';

import styles from './index.module.css';

type LinkWithArrowProps =
| ComponentProps<typeof Link>
| ButtonHTMLAttributes<HTMLButtonElement>;

const LinkWithArrow: FC<PropsWithChildren<LinkWithArrowProps>> = ({
children,
className,
...props
}) =>
'href' in props ? (
<Link {...props} className={className}>
{children}
<ArrowUpRightIcon className={styles.icon} />
</Link>
) : (
<button
className={classNames(className, styles.button)}
{...(props as ButtonHTMLAttributes<HTMLButtonElement>)}
>
{children}
<ArrowUpRightIcon className={styles.icon} />
</button>
);

export default LinkWithArrow;
2 changes: 1 addition & 1 deletion apps/site/components/Downloads/DownloadLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { FC, PropsWithChildren } from 'react';

import LinkWithArrow from '#site/components/LinkWithArrow';
import LinkWithArrow from '#site/components/Common/LinkWithArrow';
import { useClientContext } from '#site/hooks';
import type { DownloadKind, NodeRelease } from '#site/types';
import { getNodeDownloadUrl } from '#site/util/url';
Expand Down
7 changes: 3 additions & 4 deletions apps/site/components/Downloads/Release/ChangelogLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
import type { FC, PropsWithChildren } from 'react';
import { useContext } from 'react';

import Link from '#site/components/Link';
import LinkWithArrow from '#site/components/LinkWithArrow';
import LinkWithArrow from '#site/components/Common/LinkWithArrow';
import { BASE_CHANGELOG_URL } from '#site/next.constants.mjs';
import { ReleaseContext } from '#site/providers/releaseProvider';

const ChangelogLink: FC<PropsWithChildren> = ({ children }) => {
const { release } = useContext(ReleaseContext);

return (
<LinkWithArrow asChild>
<Link href={`${BASE_CHANGELOG_URL}${release.version}`}>{children}</Link>
<LinkWithArrow href={`${BASE_CHANGELOG_URL}${release.version}`}>
{children}
</LinkWithArrow>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import type { FC } from 'react';
import { useContext, useMemo } from 'react';

import CodeBox from '#site/components/Common/CodeBox';
import LinkWithArrow from '#site/components/Common/LinkWithArrow';
import Link from '#site/components/Link';
import LinkWithArrow from '#site/components/LinkWithArrow';
import { createSval } from '#site/next.jsx.compiler.mjs';
import {
ReleaseContext,
Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/EOL/EOLReleaseTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Fragment, useState } from 'react';
import type { FC } from 'react';

import FormattedTime from '#site/components/Common/FormattedTime';
import LinkWithArrow from '#site/components/Common/LinkWithArrow';
import EOLModal from '#site/components/EOL/EOLModal';
import VulnerabilityChips from '#site/components/EOL/VulnerabilityChips';
import LinkWithArrow from '#site/components/LinkWithArrow';
import provideReleaseData from '#site/next-data/providers/releaseData';
import provideVulnerabilities from '#site/next-data/providers/vulnerabilities';
import { EOL_VERSION_IDENTIFIER } from '#site/next.constants.mjs';
Expand Down
2 changes: 1 addition & 1 deletion apps/site/components/EOL/VulnerabilitiesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import classNames from 'classnames';
import { useTranslations } from 'next-intl';
import type { FC } from 'react';

import LinkWithArrow from '#site/components/Common/LinkWithArrow';
import VulnerabilityChip from '#site/components/EOL/VulnerabilityChips/VulnerabilityChip';
import LinkWithArrow from '#site/components/LinkWithArrow';
import type { Vulnerability } from '#site/types/vulnerabilities';

const VulnerabilitiesTable: FC<{
Expand Down
30 changes: 0 additions & 30 deletions apps/site/components/LinkWithArrow.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion apps/site/components/Releases/PreviousReleasesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { FC } from 'react';
import { useState } from 'react';

import FormattedTime from '#site/components/Common/FormattedTime';
import LinkWithArrow from '#site/components/LinkWithArrow';
import LinkWithArrow from '#site/components/Common/LinkWithArrow';
import provideReleaseData from '#site/next-data/providers/releaseData';

import ReleaseModal from './ReleaseModal';
Expand Down
1 change: 0 additions & 1 deletion apps/site/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const nextConfig = {
'@radix-ui/react-dropdown-menu',
'@radix-ui/react-label',
'@radix-ui/react-select',
'@radix-ui/react-slot',
'@radix-ui/react-tabs',
'@radix-ui/react-toast',
'@radix-ui/react-tooltip',
Expand Down
2 changes: 1 addition & 1 deletion apps/site/next.mdx.use.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import BadgeGroup from '@node-core/ui-components/Common/BadgeGroup';

import Button from './components/Common/Button';
import LinkWithArrow from './components/Common/LinkWithArrow';
import EOLAlertBox from './components/EOL/EOLAlert';
import EOLReleaseTable from './components/EOL/EOLReleaseTable';
import Link from './components/Link';
import LinkWithArrow from './components/LinkWithArrow';
import UpcomingMeetings from './components/MDX/Calendar/UpcomingMeetings';
import PreviousReleasesTable from './components/Releases/PreviousReleasesTable';
import WithBadgeGroup from './components/withBadgeGroup';
Expand Down
1 change: 0 additions & 1 deletion apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"@opentelemetry/sdk-logs": "~0.203.0",
"@orama/react-components": "^0.8.1",
"@oramacloud/client": "^2.1.4",
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-tabs": "^1.1.12",
"@radix-ui/react-tooltip": "^1.2.7",
"@tailwindcss/postcss": "~4.1.11",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading